diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 6ab02000..df971e9d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -9,6 +9,7 @@ message(STATUS "${PROJECT_NAME}") option(SUPPORT_OSC_1_0 "Build the artifacts supporting OSC standard version 1.0" ON) option(SUPPORT_OSC_1_1 "Build the artifacts supporting OSC standard version 1.1" ON) option(SUPPORT_OSC_1_2 "Build the artifacts supporting OSC standard version 1.2" ON) +option(SUPPORT_OSC_1_3 "Build the artifacts supporting OSC standard version 1.3" ON) if (SUPPORT_OSC_1_0) add_definitions(-DSUPPORT_OSC_1_0) @@ -19,6 +20,9 @@ endif (SUPPORT_OSC_1_1) if (SUPPORT_OSC_1_2) add_definitions(-DSUPPORT_OSC_1_2) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) + add_definitions(-DSUPPORT_OSC_1_3) +endif (SUPPORT_OSC_1_3) diff --git a/cpp/applications/openScenarioReader/src/OpenScenarioReader.cpp b/cpp/applications/openScenarioReader/src/OpenScenarioReader.cpp index d29c552e..2d5b33d9 100644 --- a/cpp/applications/openScenarioReader/src/OpenScenarioReader.cpp +++ b/cpp/applications/openScenarioReader/src/OpenScenarioReader.cpp @@ -42,6 +42,11 @@ #include "XmlScenarioImportLoaderFactoryV1_2.h" #endif +#ifdef SUPPORT_OSC_1_3 +#include "ApiClassImplV1_3.h" +#include "XmlScenarioImportLoaderFactoryV1_3.h" +#endif + #include "ScenarioLoaderException.h" #include "FileResourceLocator.h" #include "../common/version.h" @@ -83,6 +88,17 @@ #include "ExpressionResolverV1_2.h" #include "ExpressionResolverStackV1_2.h" #endif + +#ifdef SUPPORT_OSC_1_3 +#include "UnionCheckerRulesV1_3.h" +#include "RangeCheckerRulesV1_3.h" +#include "OpenScenarioXmlExporterV1_3.h" +#include "XmlParsersV1_3.h" +#include "CatalogCacheV1_3.h" +#include "CatalogReferenceParserContextV1_3.h" +#include "ExpressionResolverV1_3.h" +#include "ExpressionResolverStackV1_3.h" +#endif #endif @@ -104,6 +120,7 @@ static NET_ASAM_OPENSCENARIO::ErrorLevel logLevel = NET_ASAM_OPENSCENARIO::Error static std::string VERSION_1_0 = "v1_0"; static std::string VERSION_1_1 = "v1_1"; static std::string VERSION_1_2 = "v1_2"; +static std::string VERSION_1_3 = "v1_3"; #ifdef SUPPORT_OSC_1_0 std::shared_ptr ExecuteImportParsing(std::string& filename, std::shared_ptr& messageLogger, std::shared_ptr catalogMessageLogger, std::map& injectionParameters) @@ -132,6 +149,15 @@ std::shared_ptr ExecuteImportPars } #endif +#ifdef SUPPORT_OSC_1_3 +std::shared_ptr ExecuteImportParsingV1_3(std::string& filename, std::shared_ptr& messageLogger, std::shared_ptr catalogMessageLogger, std::map& injectionParameters) +{ + auto loaderFactory = NET_ASAM_OPENSCENARIO::v1_3::XmlScenarioImportLoaderFactory(catalogMessageLogger, filename); + auto loader = loaderFactory.CreateLoader(std::make_shared()); + return std::static_pointer_cast(loader->Load(messageLogger, injectionParameters)->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::v1_2::OpenScenarioImpl).name())); +} +#endif + std::string GetFilledString(const size_t length, const char charToFill) { std::stringstream ss; @@ -271,7 +297,16 @@ int CheckFile(std::string& inputFileName, std::string& paramFileName, std::strin try { - if (version == VERSION_1_2) + if (version == VERSION_1_3) + { +#ifdef SUPPORT_OSC_1_3 + ExecuteImportParsingV1_3(inputFileName, messageLogger, catalogMessageLogger, injectedParamters); +#else + std::cout << "Standard Version 1.3 is not supported. Compile Reader with SUPPORT_OSC_1_3 option." << std::endl; + result = ERROR_RESULT; +#endif + } + else if (version == VERSION_1_2) { #ifdef SUPPORT_OSC_1_2 ExecuteImportParsingV1_2(inputFileName, messageLogger, catalogMessageLogger, injectedParamters); @@ -408,6 +443,10 @@ int wmain(int argc, wchar_t** argv) { version = VERSION_1_2; } + else if (argc == 6 && std::wstring(argv[5]) == L"-v1_3") + { + version = VERSION_1_3; + } } else if (argc == 4 && std::wstring(argv[3]) == L"-v1_1") { @@ -417,19 +456,24 @@ int wmain(int argc, wchar_t** argv) { version = VERSION_1_2; } + else if (argc == 4 && std::wstring(argv[3]) == L"-v1_3") + { + version = VERSION_1_3; + } isCommandLineParsable = true; } if (!isCommandLineParsable) { - std::cout << "OpenScenarioChecker [[{-i |-d } [-p ] [-v1_1|-v1_2]] | -v]" << std::endl; + std::cout << "OpenScenarioChecker [[{-i |-d } [-p ] [-v1_1|-v1_2|v1_3]] | -v]" << std::endl; std::cout << "Options:" << std::endl; std::cout << "-i\t file to be validated" << std::endl; std::cout << "-d\t directory to be validated" << std::endl; std::cout << "-p\t a file with name/value pairs. One line per name/value pair. tab separated" << std::endl; std::cout << "-v1_1\tUse standard version 1.1" << std::endl; std::cout << "-v1_2\tUse standard version 1.2" << std::endl; + std::cout << "-v1_3\tUse standard version 1.3" << std::endl; std::cout << "-v\tprint program version" << std::endl; return USAGE_RESULT; @@ -503,6 +547,10 @@ int main(int argc, char** argv) { version = VERSION_1_2; } + else if (argc == 6 && std::string(argv[5]) == "-v1_3") + { + version = VERSION_1_3; + } } else if (argc == 4 && std::string(argv[3]) == "-v1_1") { @@ -512,19 +560,24 @@ int main(int argc, char** argv) { version = VERSION_1_2; } + else if (argc == 4 && std::string(argv[3]) == "-v1_3") + { + version = VERSION_1_3; + } isCommandLineParsable = true; } if (!isCommandLineParsable) { - std::cout << "OpenScenarioChecker [[{-i |-d } [-p ] [-v1_1|-v1_2]] | -v]" << std::endl; + std::cout << "OpenScenarioChecker [[{-i |-d } [-p ] [-v1_1|-v1_2|-v1_3]] | -v]" << std::endl; std::cout << "Options:" << std::endl; std::cout << "-i\t file to be validated" << std::endl; std::cout << "-d\t directory to be validated" << std::endl; std::cout << "-p\t a file with name/value pairs. One line per name/value pair. tab separated" << std::endl; std::cout << "-v1_1\tUse standard version 1.1" << std::endl; std::cout << "-v1_2\tUse standard version 1.2" << std::endl; + std::cout << "-v1_3\tUse standard version 1.3" << std::endl; std::cout << "-v\tprint program version" << std::endl; return USAGE_RESULT; diff --git a/cpp/applications/openScenarioTester/CMakeLists.txt b/cpp/applications/openScenarioTester/CMakeLists.txt index 5cf6aedd..149a8370 100644 --- a/cpp/applications/openScenarioTester/CMakeLists.txt +++ b/cpp/applications/openScenarioTester/CMakeLists.txt @@ -104,6 +104,30 @@ if (SUPPORT_OSC_1_2) ) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) + set( HEADERS + ${HEADERS} + "src/TestDeprecatedV1_3.h" + "src/TestExamplesV1_3.h" + "src/TestBaseV1_3.h" + "src/TestFilesV1_3.h" + "src/TestReaderV1_3.h" + "src/TestWriterApiV1_3.h" + "src/TestImportsV1_3.h" + "src/TestSimpleDemosV1_3.h" + "src/TestRangeCheckerV1_3.h" + "src/TestFlexInterfaceV1_3.h" + "src/TestVersionCheckerV1_3.h" + "src/TestInjectedParametersV1_3.h" + "src/TestAlksV1_3.h" + "src/TestParameterValidationV1_3.h" + "src/TestVariableValidationV1_3.h" + "src/TestDeprecatedValidationV1_3.h" + "src/TestExamplesOscV1_3.h" + "src/TestCardinalityV1_3.h" + ) +endif (SUPPORT_OSC_1_3) + if (SUPPORT_OSC_1_0) set( HEADERS_HELPER ${HEADERS_HELPER} @@ -125,6 +149,13 @@ set( HEADERS_HELPER ) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) +set( HEADERS_HELPER + ${HEADERS_HELPER} + "src/helper/EgoCheckerRuleV1_3.h" +) +endif (SUPPORT_OSC_1_3) + # Source files set( SOURCES "../../externalLibs/TinyXML2/tinyxml2.cpp" @@ -194,6 +225,30 @@ set( SOURCES ) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) +set( SOURCES + ${SOURCES} + "src/TestBaseV1_3.cpp" + "src/TestExamplesV1_3.cpp" + "src/TestFilesV1_3.cpp" + "src/TestFlexInterfaceV1_3.cpp" + "src/TestImportsV1_3.cpp" + "src/TestInjectedParametersV1_3.cpp" + "src/TestRangeCheckerV1_3.cpp" + "src/TestReaderV1_3.cpp" + "src/TestSimpleDemosV1_3.cpp" + "src/TestVersionCheckerV1_3.cpp" + "src/TestWriterApiV1_3.cpp" + "src/TestDeprecatedV1_3.cpp" + "src/TestAlksV1_3.cpp" + "src/TestParameterValidationV1_3.cpp" + "src/TestVariableValidationV1_3.cpp" + "src/TestDeprecatedValidationV1_3.cpp" + "src/TestExamplesOscV1_3.cpp" + "src/TestCardinalityV1_3.cpp" +) +endif (SUPPORT_OSC_1_3) + if (SUPPORT_OSC_1_0) set( SOURCES_HELPER ${SOURCES_HELPER} @@ -215,6 +270,13 @@ set( SOURCES_HELPER ) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) +set( SOURCES_HELPER + ${SOURCES_HELPER} + "src/helper/EgoCheckerRuleV1_3.cpp" +) +endif (SUPPORT_OSC_1_3) + # Resource files if( MSVC ) set( RESOURCE_FILES diff --git a/cpp/applications/openScenarioTester/src/OpenScenarioTester.cpp b/cpp/applications/openScenarioTester/src/OpenScenarioTester.cpp index 4645c9ea..ad1a7e46 100644 --- a/cpp/applications/openScenarioTester/src/OpenScenarioTester.cpp +++ b/cpp/applications/openScenarioTester/src/OpenScenarioTester.cpp @@ -67,6 +67,26 @@ #include "TestCardinalityV1_2.h" #endif +#ifdef SUPPORT_OSC_1_3 +#include +#include +#include +#include "TestAlksV1_3.h" +#include "TestDeprecatedV1_3.h" +#include "TestExamplesV1_3.h" +#include +#include "TestRangeCheckerV1_3.h" +#include "TestFilesV1_3.h" +#include "TestImportsV1_3.h" +#include "TestReaderV1_3.h" +#include "TestSimpleDemosV1_3.h" +#include "TestVersionCheckerV1_3.h" +#include "TestFlexInterfaceV1_3.h" +#include "TestInjectedParametersV1_3.h" +#include "TestWriterApiV1_3.h" +#include "TestCardinalityV1_3.h" +#endif + #ifdef SUPPORT_OSC_1_0 bool TestV1_0(std::string basePath) { @@ -360,7 +380,120 @@ bool TestV1_2(std::string basePath) } #endif +#ifdef SUPPORT_OSC_1_3 +bool TestV1_3(std::string basePath) +{ + NET_ASAM_OPENSCENARIO::v1_3::TestExamples testExamples(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestRangeChecker testRangeChecker(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestFiles testFiles(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestImports testImports(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestReader testReader(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestSimpleDemos testSimpleDemos(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestVersionChecker testVersionChecker(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestFlexInterface testFlexInterface(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestInjectedParameters testInjectedParameters(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestWriterApi testWriterApi(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestDeprecated testDeprecated(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestAlks testAlks(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestParameterValidation testParametervalidation(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestVariableValidation testVariableValidation(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestDeprecatedValidation testDeprecatedValidation(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestExamplesOsc testExamplesOsc(basePath); + NET_ASAM_OPENSCENARIO::v1_3::TestCardinality testCardinality(basePath); + + auto result = true; + + result = testFiles.TestUnicode() && result; + + result = testAlks.TestScenarios() && result; + result = testInjectedParameters.TestInjectionsForSuccess() && result; + result = testFiles.TestExpressionsSuccess() && result; + result = testParametervalidation.TestValidationWrongDataTypes() && result; + result = testExamples.TestExample() && result; + + result = testRangeChecker.TestParamsFailure() && result; + + result = testFiles.TestMultiChoiceElement() && result; + result = testFiles.TestSimpleSuccess() && result; + result = testFiles.TestNonAsciiFilePaths() && result; + result = testFiles.TestParamsSuccess() && result; + + result = testFiles.TestExpressionsFailure() && result; + result = testFiles.TestBomFile() && result; + result = testFiles.TestParamsFailure() && result; + result = testFiles.TestParamsConversionInfo() && result; + result = testFiles.TestParamsConversion() && result; + result = testFiles.TestUnvalidXml() && result; + result = testFiles.TestUnknownElement() && result; + result = testFiles.TestWrongAttributes() && result; + result = testFiles.TestWrongEndElement() && result; + result = testFiles.TestCustomCommandAction() && result; + result = testFiles.TestFileNotFound() && result; + result = testFiles.TestDefaultValues() && result; + result = testImports.TestImportSuccess() && result; + + result = testImports.TestImportWithParametersSuccess() && result; + result = testImports.TestImportWithExpressionsSuccess() && result; + + result = testReader.TestImportSuccess() && result; + result = testReader.TestImportSuccessNonAsciiFile() && result; + result = testReader.TestDirectorySuccess() && result; + result = testReader.TestDirectoryPartlySuccess() && result; + result = testReader.TestFileNotFound() && result; + result = testReader.TestDirectoryNotFound() && result; + result = testReader.TestWithErrors() && result; + result = testReader.TestWrongCommandLine() && result; + result = testReader.TestWithParamFile() && result; + result = testReader.TestWithParamFileSyntaxError() && result; + result = testReader.TestWithParamFileSyntaxError2() && result; + result = testReader.TestWithParamFileNotFound() && result; + + result = testSimpleDemos.TestSimpleDemo() && result; + result = testSimpleDemos.TestImportDemo() && result; + result = testSimpleDemos.TestCheckerRuleDemo() && result; + result = testSimpleDemos.TestCheckerRuleEgoDemo() && result; + + result = testVersionChecker.TestSuccess() && result; + + result = testFlexInterface.TestExample() && result; + + result = testInjectedParameters.TestNullInjectedParameters() && result; + result = testInjectedParameters.TestEmptyInjectedParameters() && result; + result = testInjectedParameters.TestInjectionsForSuccess() && result; + result = testInjectedParameters.TestWrongFormats() && result; + result = testInjectedParameters.TestNotDefined() && result; + result = testInjectedParameters.TestNotDefinedWithNoGlobalParameters() && result; + + result = testWriterApi.TestSimpleSuccess() && result; + result = testWriterApi.TestParamsSuccess() && result; + result = testWriterApi.TestBomFile() && result; + + result = testDeprecated.TestDeprecatedSuccess() && result; + result = testDeprecated.TestDeprecatedSupress() && result; + + + result = testAlks.TestCatalogs() && result; + result = testAlks.TestVariations() && result; + + result = testParametervalidation.TestValidation() && result; + result = testParametervalidation.TestValidationErrors() && result; + + result = testVariableValidation.TestValidation() && result; + result = testVariableValidation.TestValidationWrongDataTypes() && result; + result = testVariableValidation.TestVariableNotDefined() && result; + result = testVariableValidation.TestValidationWrongSetAction() && result; + + result = testDeprecatedValidation.TestValidation() && result; + + result = testExamplesOsc.TestScenarios() && result; + + result = testCardinality.TestEmptyStory() && result; + result = testCardinality.TestMultipleGroupElements() && result; + + return result; +} +#endif int main(int argc, char** argv) @@ -389,6 +522,11 @@ int main(int argc, char** argv) result = TestV1_2(basePath) && result; #else result = testVersionOptionsWithReader.TestOptionNotSetVersion1_2() && result; +#endif +#ifdef SUPPORT_OSC_1_3 + result = TestV1_3(basePath) && result; +#else + result = testVersionOptionsWithReader.TestOptionNotSetVersion1_3() && result; #endif if (result) return 0; diff --git a/cpp/applications/openScenarioTester/src/TestAlksV1_3.cpp b/cpp/applications/openScenarioTester/src/TestAlksV1_3.cpp new file mode 100644 index 00000000..7ebb688a --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestAlksV1_3.cpp @@ -0,0 +1,127 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestAlksV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestAlks::TestAlks(std::string& executablePath) : TestBase(executablePath) {} + + std::string TestAlks::pathNameCatalogs = "alks/Catalogs"; + std::string TestAlks::pathNameScenarios = "alks/Scenarios";; + std::string TestAlks::pathNameVariations = "alks/Variations"; + + + bool TestAlks::TestFiles(std::vector scenarioFiles, std::string path) + { + bool res = true; + + try + { + for (auto filename : scenarioFiles) + { + ClearMessageLogger(); + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::INFO); + // ReSharper disable once CppLocalVariableMayBeConst + auto openScenario = std::dynamic_pointer_cast(ExecuteImportParsing(_executablePath + "/" + kInputDir + "/" + path + "/" + filename, catalogMessageLogger)); + + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + if(! Assert(filterByErrorLevelLogger.empty(), ASSERT_LOCATION)) + { + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + res = false; + } + + } + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + return res; + } + + bool TestAlks::TestScenarios() + { + std::vector scenarioFiles = + { + "ALKS_Scenario_4.1_3_SideVehicle_TEMPLATE.xosc", + "ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc", + "ALKS_Scenario_4.1_2_SwervingLeadVehicle_TEMPLATE.xosc", + "ALKS_Scenario_4.2_1_FullyBlockingTarget_TEMPLATE.xosc", + "ALKS_Scenario_4.2_2_PartiallyBlockingTarget_TEMPLATE.xosc", + "ALKS_Scenario_4.2_3_CrossingPedestrian_TEMPLATE.xosc", + "ALKS_Scenario_4.2_4_MultipleBlockingTargets_TEMPLATE.xosc", + "ALKS_Scenario_4.3_1_FollowLeadVehicleComfortable_TEMPLATE.xosc", + "ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_TEMPLATE.xosc", + "ALKS_Scenario_4.4_1_CutInNoCollision_TEMPLATE.xosc", + "ALKS_Scenario_4.4_2_CutInUnavoidableCollision_TEMPLATE.xosc", + "ALKS_Scenario_4.5_1_CutOutFullyBlocking_TEMPLATE.xosc", + "ALKS_Scenario_4.5_2_CutOutMultipleBlockingTargets_TEMPLATE.xosc", + "ALKS_Scenario_4.6_1_ForwardDetectionRange_TEMPLATE.xosc", + "ALKS_Scenario_4.6_2_LateralDetectionRange_TEMPLATE.xosc", + }; + return TestFiles(scenarioFiles, pathNameScenarios); + } + + bool TestAlks::TestCatalogs() + { + std::vector scenarioFiles = + { + "Controllers/ControllerCatalog.xosc", + "MiscObjects/MiscObjectCatalog.xosc", + "Pedestrians/PedestrianCatalog.xosc", + "Vehicles/VehicleCatalog.xosc" + }; + return TestFiles(scenarioFiles, pathNameCatalogs); + } + + bool TestAlks::TestVariations() + { + std::vector scenarioFiles = + { + "ALKS_Scenario_4.1_1_FreeDriving_Variation.xosc", + "ALKS_Scenario_4.1_2_SwervingLeadVehicle_Variation.xosc", + "ALKS_Scenario_4.1_3_SideVehicle_Variation.xosc", + "ALKS_Scenario_4.2_1_FullyBlockingTarget_Variation.xosc", + "ALKS_Scenario_4.2_2_PartiallyBlockingTarget_Variation.xosc", + "ALKS_Scenario_4.2_3_CrossingPedestrian_Variation.xosc", + "ALKS_Scenario_4.2_4_MultipleBlockingTargets_Variation.xosc", + "ALKS_Scenario_4.3_1_FollowLeadVehicleComfortable_Variation.xosc", + "ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_Variation.xosc", + "ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_Variation_Reference.xosc", + "ALKS_Scenario_4.4_1_CutInNoCollision_Variation.xosc", + "ALKS_Scenario_4.5_1_CutOutFullyBlocking_Variation.xosc", + "ALKS_Scenario_4.5_2_CutOutMultipleBlockingTargets_Variation.xosc", + "ALKS_Scenario_4.6_1_ForwardDetectionRange_Variation.xosc", + "ALKS_Scenario_4.6_2_LateralDetectionRange_Variation.xosc", + }; + return TestFiles(scenarioFiles, pathNameVariations); + } + + + } +} diff --git a/cpp/applications/openScenarioTester/src/TestAlksV1_3.h b/cpp/applications/openScenarioTester/src/TestAlksV1_3.h new file mode 100644 index 00000000..7d43f455 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestAlksV1_3.h @@ -0,0 +1,46 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestAlks : public TestBase + { + + private : + static std::string pathNameCatalogs; + static std::string pathNameScenarios; + static std::string pathNameVariations; + bool TestFiles(std::vector scenarioFiles, std::string path); + + public: + + TestAlks(std::string& executablePath); + + bool TestScenarios(); + + bool TestCatalogs(); + + bool TestVariations(); + + + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestBaseV1_3.cpp b/cpp/applications/openScenarioTester/src/TestBaseV1_3.cpp new file mode 100644 index 00000000..77fe00c3 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestBaseV1_3.cpp @@ -0,0 +1,155 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#include "MessageLogger.h" +#include "TestBaseV1_3.h" +#include "FileResourceLocator.h" +#include + +#define ASSERT_LOCATION __FILE__, __func__, __LINE__ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + TestBase::TestBase(std::string& executablePath) : _executablePath(executablePath) {} + + std::shared_ptr TestBase::ExecuteParsing(std::string filename, std::map injectedProperties) const + { + auto loaderFactory = NET_ASAM_OPENSCENARIO::v1_3::XmlScenarioLoaderFactory(filename); + auto loader = loaderFactory.CreateLoader(std::make_shared()); + auto ptr = loader->Load(_messageLogger, injectedProperties); + if (ptr != nullptr) + return std::static_pointer_cast(ptr->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::v1_3::OpenScenarioImpl).name())); + return nullptr; + } + + std::shared_ptr TestBase::ExecuteParsing(std::string filename) const + { + std::map emptyMap; + return ExecuteParsing(filename, emptyMap); + } + + + std::shared_ptr TestBase::ExecuteImportParsing(const std::string filename, std::shared_ptr catalogMessageLogger) const + { + auto loaderFactory = NET_ASAM_OPENSCENARIO::v1_3::XmlScenarioImportLoaderFactory(catalogMessageLogger, filename); + auto loader = loaderFactory.CreateLoader(std::make_shared()); + auto ptr = loader->Load(_messageLogger); + if (ptr != nullptr) + return std::static_pointer_cast(ptr->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::v1_3::OpenScenarioImpl).name())); + else + return nullptr; + } + + void TestBase::ClearMessageLogger() + { + _messageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + } + + bool TestBase::Assert(const bool condition, const std::string fileName, const std::string function, const int lineNumber) + { + if (!condition) + std::cout << "Assert failed in file " << fileName << " at line " << lineNumber << " " << function << std::endl; + return condition; + } + + + bool TestBase::AssertMessages(std::vector& messages, NET_ASAM_OPENSCENARIO::ErrorLevel errorLevel, std::shared_ptr logger) + { + auto kFilterByErrorLevelMessages = FilterByErrorLevel(messages, errorLevel); + auto filterByErrorLevelLogger = logger->GetMessagesFilteredByErrorLevel(errorLevel); + std::sort(filterByErrorLevelLogger.begin(), filterByErrorLevelLogger.end(), []( NET_ASAM_OPENSCENARIO::FileContentMessage& lhs, NET_ASAM_OPENSCENARIO::FileContentMessage& rhs) { + return lhs.GetMsg() < rhs.GetMsg(); + }); + + if (kFilterByErrorLevelMessages.size() != filterByErrorLevelLogger.size()) + { + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + + } + return kFilterByErrorLevelMessages.size() == filterByErrorLevelLogger.size() && + std::equal(kFilterByErrorLevelMessages.begin(), kFilterByErrorLevelMessages.end(), filterByErrorLevelLogger.begin(), + [](NET_ASAM_OPENSCENARIO::FileContentMessage & l, NET_ASAM_OPENSCENARIO::FileContentMessage & r) + { + if (l.ToString() != r.ToString()) + { + std::cout << l.ToString() << "\n"; + std::cout << r.ToString() << "\n"; + } + + return l.ToString() == r.ToString(); + }); + } + + std::vector TestBase::FilterByErrorLevel(std::vector messages, NET_ASAM_OPENSCENARIO::ErrorLevel& errorLevel) + { + std::vector result; + for (auto&& message : messages) + { + if (errorLevel == message.GetErrorLevel()) + { + result.push_back(message); + } + } + + std::sort(result.begin(), result.end(), []( NET_ASAM_OPENSCENARIO::FileContentMessage& lhs, NET_ASAM_OPENSCENARIO::FileContentMessage& rhs) { + return lhs.GetMsg() < rhs.GetMsg(); + }); + return result; + } + + std::string TestBase::GetLine(const std::string fileName, const int lineNum) const + { +#ifdef WIN32 + std::wstring path; + if (!FileResourceLocator::Utf8ToWstring(_executablePath + "/" + kInputDir + fileName, path)) + { + return ""; + } + std::ifstream file(path); + +#elif defined (__linux__) || defined (__APPLE__) + std::ifstream file( _executablePath + "/" + kInputDir + fileName); +#else +# error "Operating system not supported." +#endif + std::string line; + + if (file.bad() || file.fail()) + { + return ""; + } + + int counter = 0; + + while (std::getline(file, line)) + { + counter++; + if (counter == lineNum) + { + file.close(); + return line; + } + } + file.close(); + return ""; + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestBaseV1_3.h b/cpp/applications/openScenarioTester/src/TestBaseV1_3.h new file mode 100644 index 00000000..7c803688 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestBaseV1_3.h @@ -0,0 +1,62 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "SimpleMessageLogger.h" +#include "XmlScenarioImportLoaderFactoryV1_3.h" +#include +//#pragma execution_character_set("utf-8") + +#define ASSERT_LOCATION __FILE__, __func__, __LINE__ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestBase + { + + protected: + std::shared_ptr _messageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + const std::string kInputDir = u8"test-rc/"; + + std::string _executablePath; + + public: + + TestBase(std::string& executablePath); + + std::shared_ptr ExecuteParsing(std::string filename, std::map injectedProperties) const; + + std::shared_ptr ExecuteParsing(std::string filename) const; + + + std::shared_ptr ExecuteImportParsing(const std::string filename, std::shared_ptr catalogMessageLogger) const; + + void ClearMessageLogger(); + + static bool Assert(const bool condition, const std::string fileName, const std::string function, const int lineNumber); + + protected: + + bool AssertMessages(std::vector& messages, NET_ASAM_OPENSCENARIO::ErrorLevel errorLevel, std::shared_ptr logger); + std::vector FilterByErrorLevel(std::vector messages, NET_ASAM_OPENSCENARIO::ErrorLevel& errorLevel); + std::string GetLine(const std::string fileName, const int lineNum) const; + + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.cpp b/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.cpp new file mode 100644 index 00000000..d8ac6c84 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.cpp @@ -0,0 +1,63 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestCardinalityV1_3.h" +#include "FileResourceLocator.h" +#include + +#include "PropertyTreeContext.h" +#include "ScenarioLoaderException.h" + +#undef ERROR + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestCardinality::TestCardinality(std::string& executablePath) : TestBase(executablePath) + { + } + + bool TestCardinality::TestEmptyStory() + { + ClearMessageLogger(); + const std::string kFileName = _executablePath + "/" + kInputDir + "cardinalityChecks/EmptyStory.xosc"; + (void)ExecuteParsing(kFileName); + + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Too few children children are set (Act). min defined: 1. actual size: 0", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(65, 4, kFileName))); + const bool kResult = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + return kResult; + } + + bool TestCardinality::TestMultipleGroupElements() + { + ClearMessageLogger(); + const std::string kFileName = _executablePath + "/" + kInputDir + "cardinalityChecks/ActionsMultipleElements.xosc"; + (void)ExecuteParsing(kFileName); + + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "One of these properties is required (GlobalAction; UserDefinedAction; PrivateAction)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(157, 14, kFileName))); + const bool kResult = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + return kResult; + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.h b/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.h new file mode 100644 index 00000000..34cf256d --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestCardinalityV1_3.h @@ -0,0 +1,35 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestCardinality: public TestBase + { + public: + + TestCardinality(std::string& executablePath); + + bool TestEmptyStory(); + bool TestMultipleGroupElements(); + }; + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.cpp b/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.cpp new file mode 100644 index 00000000..4a80a8bb --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.cpp @@ -0,0 +1,105 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestDeprecatedV1_3.h" +#include + +#include "FileResourceLocator.h" +#include "ScenarioLoaderException.h" +#include "ErrorLevel.h" + +#undef ERROR + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + + TestDeprecated::TestDeprecated(std::string& executablePath) : TestBase(executablePath) {} + + bool TestDeprecated::TestDeprecatedSuccess() + { + ClearMessageLogger(); + // Creating a message logger to pick up the messages + auto msgLogger = std::dynamic_pointer_cast(_messageLogger); + + // Instantiating the factory + std::string fileName = _executablePath + "/" + kInputDir + "DoubleLaneChangerDeprecated1_2.xosc"; + auto loaderFactory = XmlScenarioLoaderFactory(fileName); + + // Creating the loader + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading + auto openScenario = std::static_pointer_cast(loader->Load(_messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Attribute 'alongRoute' is deprecated since standard version '1.1'. Comment: 'Use \"coordinateSystem\" and \"relativeDistanceType\"'.", + NET_ASAM_OPENSCENARIO::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(202, 92, fileName))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Element 'Trajectory' is deprecated since standard version '1.1'. Comment: 'Use trajectoryRef instead.'.", + NET_ASAM_OPENSCENARIO::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(170, 18, fileName))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Enumeration literal 'wind' is deprecated since standard version '1.1'. Use instead XSDcomplexeType \"Wind\" in \"Weather\".'.", + NET_ASAM_OPENSCENARIO::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(72, 41, fileName))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Enumeration literal 'overwrite' is deprecated since standard version '1.2'. Deprecated for consistency. Use override instead'.", + NET_ASAM_OPENSCENARIO::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(153, 59, fileName))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Enumeration literal 'overwrite' is deprecated since standard version '1.2'. Deprecated for consistency. Use override instead'.", + NET_ASAM_OPENSCENARIO::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(213, 58, fileName))); + //Check for errors + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + res = res && Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::WARNING, _messageLogger), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + + if (!openScenario) + res = res && Assert(false, ASSERT_LOCATION); + return res; + } + bool TestDeprecated::TestDeprecatedSupress() + { + ClearMessageLogger(); + // Creating a message logger to pick up the messages + auto msgLogger = std::dynamic_pointer_cast(_messageLogger); + + // Instantiating the factory + std::string fileName = _executablePath + "/" + kInputDir + "DoubleLaneChangerDeprecated.xosc"; + auto loaderFactory = XmlScenarioLoaderFactory(fileName, true); + + // Creating the loader + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading + auto openScenario = std::static_pointer_cast(loader->Load(_messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + + return Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::WARNING).empty(), ASSERT_LOCATION); + + } + + + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.h b/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.h new file mode 100644 index 00000000..53c0375b --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestDeprecatedV1_3.h @@ -0,0 +1,35 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestDeprecated : public TestBase + { + public: + + TestDeprecated(std::string& executablePath); + + bool TestDeprecatedSuccess(); + bool TestDeprecatedSupress(); + }; + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.cpp b/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.cpp new file mode 100644 index 00000000..5d14562b --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.cpp @@ -0,0 +1,73 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestDeprecatedValidationV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestDeprecatedValidation::TestDeprecatedValidation(std::string& executablePath) : TestBase(executablePath) {} + + bool TestDeprecatedValidation::TestValidation() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerDeprecationValidationErrors1_2.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'height' is deprecated and must not be used with attribute 'altitude'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(137, 16, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'latitude' is deprecated and must not be used with attribute 'latitudeDeg'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(145, 16, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'longitude' is deprecated and must not be used with attribute 'longitudeDeg'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(153, 16, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'value' is deprecated and must not be used with element 'BrakePercent' or 'BrakeForce'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(161, 18, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'number' is deprecated and must not be used with attribute 'gear'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(170, 18, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'value' is deprecated and must not be used with element 'BrakePercent' or 'BrakeForce'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(179, 18, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'intensity' is deprecated and must not be used with attribute 'illuminance'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(79, 16, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'velocity' is deprecated and must not be used with attribute 'speed'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(257, 18, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'velocity' is deprecated and must not be used with element 'InitialSpeedRange'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(278, 18, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'cloudState' is deprecated and must not be used with attribute 'fractionalCloudCover'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(78, 14, kFilename))); + // From 1.1 + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'curvatureDot' is deprecated and must not be used with attribute 'isSetCurvaturePrime'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(302, 26, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'alongRoute' is deprecated and must not be used with attribute 'coordinateSystem'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(327, 25, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'alongRoute' is deprecated and must not be used with attribute 'relativeDistanceType'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(327, 25, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Attribute 'intensity' is deprecated and must not be used with attribute 'precipitationIntensity'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(80, 16, kFilename))); + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + + } +} diff --git a/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.h b/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.h new file mode 100644 index 00000000..b8a153f8 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestDeprecatedValidationV1_3.h @@ -0,0 +1,37 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestDeprecatedValidation : public TestBase + { + + private : + static double epsilon; + public: + + TestDeprecatedValidation(std::string& executablePath); + + bool TestValidation(); + + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.cpp b/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.cpp new file mode 100644 index 00000000..c7071835 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.cpp @@ -0,0 +1,93 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestExamplesOscV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestExamplesOsc::TestExamplesOsc(std::string& executablePath) : TestBase(executablePath) {} + + + std::string TestExamplesOsc::pathNameScenarios = "exampleFilesVersion1_3";; + + + bool TestExamplesOsc::TestFiles(std::vector scenarioFiles, std::string path) + { + bool res = true; + + try + { + for (auto filename : scenarioFiles) + { + ClearMessageLogger(); + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::INFO); + // ReSharper disable once CppLocalVariableMayBeConst + auto openScenario = std::dynamic_pointer_cast(ExecuteImportParsing(_executablePath + "/" + kInputDir + path + "/" + filename, catalogMessageLogger)); + + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + if(! Assert(filterByErrorLevelLogger.empty(), ASSERT_LOCATION)) + { + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + res = false; + } + + } + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + return res; + } + + bool TestExamplesOsc::TestScenarios() + { + std::vector scenarioFiles = + { + "CutIn.xosc", + "DoubleLaneChanger.xosc", + "EndOfTrafficJam.xosc", + "EndofTrafficJamNeighboringLaneOccupied.xosc", + "EndOfTrafficJamParameterSet.xosc", + "FastOvertakeWithReInitialization.xosc", + "Overtaker.xosc", + "SequentialEvents_0-100-0kph_Explicit.xosc", + "SequentialEvents_0-100-0kph_Implicit.xosc", + "SimpleOvertake.xosc", + "SlowPrecedingVehicle.xosc", + "SlowPrecedingVehicleDeterministicParameterSet.xosc", + "SlowPrecedingVehicleStochasticParameterSet.xosc", + "SynchronizedArrivalToIntersection.xosc", + "TrafficJam.xosc", + "FollowTrajectory_Nurbs.xosc", + }; + return TestFiles(scenarioFiles, pathNameScenarios); + } + + + + } +} diff --git a/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.h b/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.h new file mode 100644 index 00000000..518d583f --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestExamplesOscV1_3.h @@ -0,0 +1,40 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestExamplesOsc : public TestBase + { + + private : + static std::string pathNameScenarios; + bool TestFiles(std::vector scenarioFiles, std::string path); + + public: + + TestExamplesOsc(std::string& executablePath); + + bool TestScenarios(); + + + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestExamplesV1_3.cpp b/cpp/applications/openScenarioTester/src/TestExamplesV1_3.cpp new file mode 100644 index 00000000..71a5b3ed --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestExamplesV1_3.cpp @@ -0,0 +1,161 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestExamplesV1_3.h" +#include "FileResourceLocator.h" +#include + +#include "PropertyTreeContext.h" +#include "ScenarioLoaderException.h" + +#undef ERROR + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + TestExamples::TestExamples(std::string& executablePath) : TestBase(executablePath) {} + + bool TestExamples::TestExample() const + { + // Creating a message logger to pick up the messages + auto msgLogger = std::dynamic_pointer_cast(_messageLogger); + + // Instantiating the factory + std::string fileName = _executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc"; + auto loaderFactory = XmlScenarioLoaderFactory(fileName); + + // Creating the loader + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading + auto openScenario = std::static_pointer_cast(loader->Load(_messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + + //Check for errors + if (_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty()) + { + // Browse through the results + auto fileHeader = openScenario->GetFileHeader(); + std::cout << "Major Revision :" << fileHeader->GetRevMajor() << std::endl; + std::cout << "Minor Revision :" << fileHeader->GetRevMinor() << std::endl; + } + + if (!openScenario) + return Assert(false, ASSERT_LOCATION); + + auto openScenarioCategory = openScenario->GetOpenScenarioCategory(); + + if (openScenarioCategory) + { + // This is a scenario definition, not a catalog + auto scenarioDefinition = openScenarioCategory->GetScenarioDefinition(); + + // Browse through parameter declarations + auto parameterDeclarations = scenarioDefinition->GetParameterDeclarations(); + + // Browse through roadNetwork definition + auto roadNetwork = scenarioDefinition->GetRoadNetwork(); + + // Browse through entities + auto entities = scenarioDefinition->GetEntities(); + + // Browse through storyboard + auto storyboard = scenarioDefinition->GetStoryboard(); + + // Browse through catalog locations + auto catalogLocations = scenarioDefinition->GetCatalogLocations(); + + } + + auto checkerRuleLogger = std::make_shared(NET_ASAM_OPENSCENARIO::INFO); + + // Using the adapter interface to get the checker + auto scenarioChecker = std::static_pointer_cast( openScenario->GetAdapter(typeid(IScenarioChecker).name())); + + class CheckerRule: public NET_ASAM_OPENSCENARIO::ICheckerRule + { + private: + bool DoesNameMatches(std::shared_ptr object) const + { + const auto kName = object->GetName(); + // name must start with a capital letter + return std::regex_match(kName, std::regex("^[A-Z].*")); + } + + std::string GetMsg() + { + return "Name must start with a capital letter"; + } + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override + { + auto typedObject = std::dynamic_pointer_cast(object); + + const auto kName = typedObject->GetName(); + + // name must start with a capital letter + if(!DoesNameMatches(typedObject)) + { + // Get the textmarker at the error + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + const auto kTextmarker = locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__NAME); + + // Add a message to the logger + auto msg = NET_ASAM_OPENSCENARIO::FileContentMessage(GetMsg(), NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, kTextmarker); + messageLogger->LogMessage(msg); + } + } + + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override + { + auto typedObject = std::dynamic_pointer_cast(object); + if (!DoesNameMatches(typedObject)) + { + + // Get the textmarker at the error + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + const auto kTextmarker = locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__NAME); + + // Add a message to the logger + const auto kContext = NET_ASAM_OPENSCENARIO::PropertyTreeContext::Create(object, OSC_CONSTANTS::ATTRIBUTE__NAME); + NET_ASAM_OPENSCENARIO::TreeContentMessage tcm(GetMsg(), NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, kContext); + messageLogger->LogMessage(tcm); + } + + } + + }; + + // Add a checker rule for all vehicles: E.g. Check ^whether the name starts with a capital letter + scenarioChecker->AddVehicleCheckerRule(std::make_shared()); + // Now start the check. It is applied to all vehicles. For any checker rule violation an entry is created. + scenarioChecker->CheckScenarioInFileContext(checkerRuleLogger, openScenario); + + // Iterate through violations + for ( auto && message : checkerRuleLogger->GetMessages()) + { + // e.g. display the error + std::cout << message.GetMsg() << std::endl; + } + + return true; + } + + + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestExamplesV1_3.h b/cpp/applications/openScenarioTester/src/TestExamplesV1_3.h new file mode 100644 index 00000000..a46694d2 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestExamplesV1_3.h @@ -0,0 +1,35 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestExamples: public TestBase + { + public: + + TestExamples(std::string& executablePath); + + bool TestExample() const; + + }; + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestFilesV1_3.cpp b/cpp/applications/openScenarioTester/src/TestFilesV1_3.cpp new file mode 100644 index 00000000..b1c7406a --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestFilesV1_3.cpp @@ -0,0 +1,540 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestFilesV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestFiles::TestFiles(std::string& executablePath) : TestBase(executablePath) {} + + double TestFiles::epsilon = 0.001; + + bool TestFiles::TestSimpleSuccess() + { + try + { + ClearMessageLogger(); + (void) ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc"); + return Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION);; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestNonAsciiFilePaths() + { + try + { + ClearMessageLogger(); + (void)ExecuteParsing(_executablePath + "/" + kInputDir + "nonAsciiPathßäöü/DoubleLaneChangerßäöü.xosc"); + return Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION);; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestParamsSuccess() + { + try + { + ClearMessageLogger(); + (void) ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerParams.xosc"); + return Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestExpressionsSuccess() + { + try + { + ClearMessageLogger(); + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerExpressions.xosc")); + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + auto privates = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard()->GetInit()->GetActions()->GetPrivates()[0]; + double value = privates->GetPrivateActions()[0]->GetLongitudinalAction()->GetSpeedAction()->GetSpeedActionTarget()->GetAbsoluteTargetSpeed()->GetValue(); + res = res && Assert(std::abs(value - 1.0) < epsilon, ASSERT_LOCATION); + unsigned short revMajor = openScenario->GetFileHeader()->GetRevMajor(); + res = res && Assert(revMajor == 36, ASSERT_LOCATION); + unsigned short revMinor = openScenario->GetFileHeader()->GetRevMinor(); + res = res && Assert(revMinor == 37, ASSERT_LOCATION); + auto worldPosition = privates->GetPrivateActions()[1]->GetTeleportAction()->GetPosition()->GetWorldPosition(); + double yPosition = worldPosition->GetY(); + res = res && Assert(std::abs(yPosition - 26.56157396722825) < epsilon, ASSERT_LOCATION); + double xPosition = worldPosition->GetX(); + res = res && Assert(std::abs(xPosition - 65538.4) < epsilon, ASSERT_LOCATION); + double zPosition = worldPosition->GetZ(); + res = res && Assert(std::abs(zPosition - 34) < epsilon, ASSERT_LOCATION); + double hPosition = worldPosition->GetH(); + res = res && Assert(std::abs(hPosition - 35) < epsilon, ASSERT_LOCATION); + auto condition = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard() + ->GetStories()[0]->GetActs()[0]->GetManeuverGroups()[0]->GetManeuvers()[0]->GetEvents()[0]->GetStartTrigger()->GetConditionGroups()[0] + ->GetConditions()[0]; + res = res && Assert(std::abs(condition->GetDelay() - 21) < epsilon, ASSERT_LOCATION); + auto distanceCondition = condition->GetByEntityCondition()->GetEntityCondition()->GetDistanceCondition(); + res = res && Assert(std::abs(distanceCondition->GetValue() - 41) < epsilon, ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestBomFile() + { + try + { + ClearMessageLogger(); + (void)ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChanger-utf8-BOM.xosc"); + return Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestExpressionsFailure() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerExpressionsError.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value '65536' cannot be converted to type 'unsignedShort'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(19, 24, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Division by zero", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(85, 69, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Division by zero", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 39, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Cannot calculate square root from a negative value.", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 81, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Raising the value 0 to an exponent < 0 is not allowed", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 61, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Raising a negative basis to an exponent that is not 0 or 1 or -1 is not allowed", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 96, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Raising a negative basis to an exponent that is not 0 or 1 or -1 is not allowed", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 116, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Internal Overflow (limits of internal 64 bit double value exceeded)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(95, 131, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Internal Overflow (limits of internal 64 bit double value exceeded)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(106, 71, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Internal Overflow (limits of internal 64 bit double value exceeded)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(114, 40, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Syntax error in expression", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(114, 97, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Syntax error in expression near '}'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(114, 108, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Expressions are exclusively supported for numeric types or boolean type or convertible string type. Parameter '$timeParam' is of not supported type 'dateTime'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(125, 48, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value must be numeric", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(133, 36, kFilename))); + + + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestParamsFailure() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerParamsError.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Parameter 'test' cannot be converted into type 'double' ('wrongDouble').", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(21, 37, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Parameter '$UnknownParameter' is not defined.", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(49, 23, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Parameter '$test' is not defined.", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(85, 46, kFilename))); + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestParamsConversionInfo() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerParamsInfo.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestParamsConversion() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerParamsConversionErrors.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Parameter 'testBoolean' cannot be converted into type 'integer' ('false').", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(21, 44, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Parameter '$testBoolean' is not defined.", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(147, 44, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value '-1' cannot be converted to type 'unsignedInt'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(151, 93, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value 'RRR1.1' cannot be converted to type 'double'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(156, 82, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value '4294967295' cannot be converted to type 'int'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(158, 70, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Value '4294967295' cannot be converted to type 'int'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(192, 70, kFilename))); + + auto res = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return res; + + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestUnvalidXml() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangeExtraHalf.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "XML-Dokumentstrukturen m�ssen innerhalb derselben Entity beginnen und enden.", + NET_ASAM_OPENSCENARIO::FATAL, NET_ASAM_OPENSCENARIO::Textmarker(30, 3, kFilename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::FATAL, _messageLogger), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(true, ASSERT_LOCATION); + } + } + + bool TestFiles::TestDefaultValues() + { + try + { + ClearMessageLogger(); + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerDefaultValues.xosc")); + + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + auto event = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard()->GetStories()[0]->GetActs()[0]->GetManeuverGroups()[0]->GetManeuvers()[0]->GetEvents()[0]; + // get distance condition with alongRoute NOT set + auto distanceCondition = event->GetStartTrigger()->GetConditionGroups()[0]->GetConditions()[0]->GetByEntityCondition()->GetEntityCondition()->GetDistanceCondition(); + + // Test Default value for coordinate System + std::string coordinateSystem = distanceCondition->GetCoordinateSystem().GetLiteral(); + res = Assert(coordinateSystem == "entity", ASSERT_LOCATION) && res; + // Test Default value for relativeDistanceType + std::string relativeDistanceType = distanceCondition->GetRelativeDistanceType().GetLiteral(); + res = Assert(relativeDistanceType == "euclidianDistance", ASSERT_LOCATION) && res; + bool isSet = distanceCondition->IsSetAlongRoute(); + res = Assert( !isSet, ASSERT_LOCATION) && res; + + // get distance condition with alongRoute set + distanceCondition = event->GetStartTrigger()->GetConditionGroups()[0]->GetConditions()[1]->GetByEntityCondition()->GetEntityCondition()->GetDistanceCondition(); + isSet = distanceCondition->IsSetAlongRoute(); + res = Assert(isSet, ASSERT_LOCATION) && res; + return res; + + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(true, ASSERT_LOCATION); + } + } + + bool TestFiles::TestUnknownElement() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangeExtraUnknownElement.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Unknown element 'ScenarioObject'", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(50, 4, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Unknown element 'Test'", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(76, 4, kFilename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestWrongAttributes() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerWrongAttributes.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Cannot convert 'ezert' to a double. Number format error.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(78, 58, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'TTTT' is not allowed.", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(78, 72, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Cannot convert 'TEST' to a double. Number format error.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(80, 39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Cannot convert '-56' to an unsignedInteger. Value must be in [0..4294967295].", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(138, 23, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Cannot convert '-40' to an unsignedInteger. Value must be in [0..4294967295].", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(175, 69, kFilename))); + + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestWrongEndElement() + { + try + { + ClearMessageLogger(); + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChangerWrongEndElement.xosc"; + (void) ExecuteParsing(filename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Elementtyp \"PrivateActions\" muss mit dem entsprechenden Endtag \"\" beendet werden.", NET_ASAM_OPENSCENARIO::FATAL, NET_ASAM_OPENSCENARIO::Textmarker(73, 12, filename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::FATAL, _messageLogger), ASSERT_LOCATION); + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(true, ASSERT_LOCATION); + } + } + + bool TestFiles::TestCustomCommandAction() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerCustomCommandAction.xosc"; + auto openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + std::vector messages; + auto res = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + const auto kContent = openScenarioImpl->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard()->GetInit()->GetActions()->GetUserDefinedActionsAtIndex(0)->GetCustomCommandAction()->GetContent(); + res = res && Assert("\n This is text defined Inhalt" == kContent, ASSERT_LOCATION); + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestFileNotFound() const + { + try + { + const std::string kFilename = _executablePath + "/" + kInputDir + "FileNotFound.xosc"; + (void) ExecuteParsing(kFilename); + return true; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestUnicode() + { + + try + { + ClearMessageLogger(); + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerUnicode.xosc")); + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + auto description = openScenario->GetFileHeader()->GetDescription(); + + res = Assert(description == "Größe", ASSERT_LOCATION) && res; + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestFiles::TestMultiChoiceElement() + { + try + { + ClearMessageLogger(); + std::string filename = _executablePath + "/" + kInputDir + "MultiChoice.xosc"; + + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(filename)); + + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + auto deterministicParameterDistributions = openScenario->GetOpenScenarioCategory()->GetParameterValueDistributionDefinition()->GetParameterValueDistribution()->GetDistributionDefinition()->GetDeterministic()->GetDeterministicParameterDistributions(); + res = Assert(deterministicParameterDistributions.size() == 3, ASSERT_LOCATION) && res; + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(true, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestFilesV1_3.h b/cpp/applications/openScenarioTester/src/TestFilesV1_3.h new file mode 100644 index 00000000..9d2b6b6b --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestFilesV1_3.h @@ -0,0 +1,70 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestFiles : public TestBase + { + + private : + static double epsilon; + public: + + TestFiles(std::string& executablePath); + + bool TestSimpleSuccess(); + + bool TestNonAsciiFilePaths(); + + bool TestParamsSuccess(); + + bool TestExpressionsSuccess(); + + bool TestBomFile(); + + bool TestParamsFailure(); + + bool TestExpressionsFailure(); + + bool TestParamsConversionInfo(); + + bool TestParamsConversion(); + + bool TestUnvalidXml(); + + bool TestDefaultValues(); + + bool TestUnknownElement(); + + bool TestWrongAttributes(); + + bool TestWrongEndElement(); + + bool TestCustomCommandAction(); + + bool TestFileNotFound() const; + + bool TestUnicode(); + + bool TestMultiChoiceElement(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.cpp b/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.cpp new file mode 100644 index 00000000..c060125f --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.cpp @@ -0,0 +1,164 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestFlexInterfaceV1_3.h" +#include "FileResourceLocator.h" +#undef ERROR + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestFlexInterface::TestFlexInterface(std::string& executablePath) : TestBase(executablePath) {} + + bool TestFlexInterface::TestExample() + { + + // Instantiating the factory + auto loaderFactory = XmlScenarioLoaderFactory(_executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc"); + + // Creating the loader + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading + auto openScenario = std::static_pointer_cast(loader->Load(_messageLogger)->GetAdapter(typeid(OpenScenarioImpl).name())); + + auto res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + // Browse through the results + auto fileHeader = openScenario->GetFileHeader(); + auto flexElement = fileHeader->GetOpenScenarioFlexElement(); + + try + { + // Date Time + std::string expectedDateString = "2001-10-26T21:32:52"; + NET_ASAM_OPENSCENARIO::DateTime expectedDate {}; + res = res && Assert(NET_ASAM_OPENSCENARIO::DateTimeParser::ToDateTime(expectedDateString, expectedDate), ASSERT_LOCATION); + res = res && Assert(expectedDate == flexElement->GetDateTimeProperty(OSC_CONSTANTS::ATTRIBUTE__DATE), ASSERT_LOCATION); + + // Unsigned Short + res = res && Assert(flexElement->GetUnsignedShortProperty(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR) == 0, ASSERT_LOCATION); + + // String + res = res && Assert(flexElement->GetStringProperty(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION) == "Sample Scenario - Double Lane Changer", ASSERT_LOCATION); + + // test Enumeration + auto speedActionDynamics = GetSpeedActionDynamics(openScenario, res); + res = res && Assert("step" == speedActionDynamics->GetOpenScenarioFlexElement()->GetEnumerationLiteral(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE), ASSERT_LOCATION); + + // test Unsigned integer + auto eventPtr = GetEvent(openScenario); + res = res && Assert(2 == eventPtr->GetOpenScenarioFlexElement()->GetUnsignedIntProperty(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT), ASSERT_LOCATION); + + // test Double + res = res && Assert(speedActionDynamics->GetOpenScenarioFlexElement()->GetDoubleProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE) == 2.0, ASSERT_LOCATION); + + // testInteger + auto relativeLanePosition = GetRelativeLanePosition(eventPtr); + res = res && Assert(1 == relativeLanePosition->GetOpenScenarioFlexElement()->GetIntProperty(OSC_CONSTANTS::ATTRIBUTE__D_LANE), ASSERT_LOCATION); + + // test Boolean + auto actors = GetActors(openScenario); + res = res && Assert(!actors->GetOpenScenarioFlexElement()->GetBooleanProperty(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES), ASSERT_LOCATION); + + // Test Proxy (Name only) + res = res && Assert(relativeLanePosition->GetOpenScenarioFlexElement()->GetStringProperty(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) == "Ego", ASSERT_LOCATION); + + // testParent + res = res && Assert(std::dynamic_pointer_cast(eventPtr->GetOpenScenarioFlexElement()->GetParentFlexElement().lock()) != nullptr, ASSERT_LOCATION); + + // test type + res = res && Assert(eventPtr->GetOpenScenarioFlexElement()->GetModelType() == "Event", ASSERT_LOCATION); + + // Exceptions + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetDateTimeProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetUnsignedShortProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetStringProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetDoubleProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetBooleanProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetIntProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetUnsignedIntProperty("Test"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetReferencedElement("Test", "Ego"); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetDateTimeProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetUnsignedShortProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetStringProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetDoubleProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetBooleanProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetIntProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetUnsignedIntProperty(""); }); + res = res && AssertException(flexElement, [](NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElm) {flexElm->GetReferencedElement("", "Ego"); }); + + return res; + } + catch(...) + { + return Assert(false, ASSERT_LOCATION); + } + } + + + std::shared_ptr TestFlexInterface::GetSpeedActionDynamics(std::shared_ptr openScenario, bool& res) + { + if (!res) + return nullptr; + auto openScenarioCategory = openScenario->GetOpenScenarioCategory(); + res = res && Assert(openScenarioCategory != nullptr, ASSERT_LOCATION); + auto scenarioDefinition = openScenarioCategory->GetScenarioDefinition(); + res = res && Assert(scenarioDefinition != nullptr, ASSERT_LOCATION); + auto storyboard = scenarioDefinition->GetStoryboard(); + res = res && Assert(storyboard != nullptr, ASSERT_LOCATION); + auto init = storyboard->GetInit(); + res = res && Assert(init != nullptr, ASSERT_LOCATION); + auto actions = init->GetActions(); + res = res && Assert(actions != nullptr, ASSERT_LOCATION); + const auto kPrivatesSize = actions->GetPrivatesSize(); + res = res && Assert(kPrivatesSize == 3, ASSERT_LOCATION); + auto privateAction = actions->GetPrivatesAtIndex(0); + const auto kPrivateActionsSize = privateAction->GetPrivateActionsSize(); + res = res && Assert(kPrivateActionsSize == 2, ASSERT_LOCATION); + auto speedAction = privateAction->GetPrivateActionsAtIndex(0)->GetLongitudinalAction()->GetSpeedAction(); + return speedAction->GetSpeedActionDynamics(); + } + + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr TestFlexInterface::GetEvent(std::shared_ptr openScenario) + { + auto openScenarioCategory = openScenario->GetOpenScenarioCategory(); + auto scenarioDefinition = openScenarioCategory->GetScenarioDefinition(); + auto storyboard = scenarioDefinition->GetStoryboard(); + + return storyboard->GetStoriesAtIndex(0)->GetActsAtIndex(0)->GetManeuverGroupsAtIndex(0)->GetManeuversAtIndex(0)->GetEventsAtIndex(0); + } + + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr TestFlexInterface::GetRelativeLanePosition(std::shared_ptr eventPtr) + { + return eventPtr->GetActions()[1]->GetPrivateAction()->GetRoutingAction()->GetAcquirePositionAction()->GetPosition()->GetRelativeLanePosition(); + } + + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr TestFlexInterface::GetActors(std::shared_ptr openScenario) + { + auto openScenarioCategory = openScenario->GetOpenScenarioCategory(); + auto scenarioDefinition = openScenarioCategory->GetScenarioDefinition(); + auto storyboard = scenarioDefinition->GetStoryboard(); + return storyboard->GetStoriesAtIndex(0)->GetActsAtIndex(0)->GetManeuverGroupsAtIndex(0)->GetActors(); + } + + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.h b/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.h new file mode 100644 index 00000000..2b2bab38 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestFlexInterfaceV1_3.h @@ -0,0 +1,63 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestFlexInterface : public TestBase + { + public: + + TestFlexInterface(std::string& executablePath); + + bool TestExample(); + + private: + + std::shared_ptr GetSpeedActionDynamics(std::shared_ptr openScenario, bool& res); + + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr GetEvent(std::shared_ptr openScenario); + + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr GetRelativeLanePosition(std::shared_ptr eventPtr); + // ReSharper disable once CppMemberFunctionMayBeStatic + std::shared_ptr GetActors(std::shared_ptr openScenario); + + template + // ReSharper disable once CppMemberFunctionMayBeStatic + bool AssertException(NET_ASAM_OPENSCENARIO::IOpenScenarioFlexElement* flexElement, T f) + { + bool exceptionThrown = false; + try + { + f(flexElement); + } + catch (NET_ASAM_OPENSCENARIO::KeyNotSupportedException& e) + { + (void)e; + exceptionThrown = true; + } + + return Assert(exceptionThrown, ASSERT_LOCATION); + } + }; + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestImportsV1_3.cpp b/cpp/applications/openScenarioTester/src/TestImportsV1_3.cpp new file mode 100644 index 00000000..3be73a3c --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestImportsV1_3.cpp @@ -0,0 +1,210 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestImportsV1_3.h" +#include "CatalogHelperV1_3.h" +#include +#include "ScenarioLoaderException.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + double TestImports::epsilon = 0.001; + + std::shared_ptr TestImports::GetVehicleImport(std::shared_ptr openScenario, const std::string scenarioObjectName, const std::string entryName) + { + auto scenarioObjects = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetEntities()->GetScenarioObjects(); + for (auto&& scenarioObject : scenarioObjects) + { + if (scenarioObject->GetName() == scenarioObjectName) + { + auto catalogReference = scenarioObject->GetEntityObject()->GetCatalogReference(); + if (catalogReference != nullptr && catalogReference->GetEntryName() == entryName) + { + return catalogReference; + } + } + } + return nullptr; + } + + TestImports::TestImports(std::string& executablePath) : TestBase(executablePath) {} + + bool TestImports::TestImportSuccess() + { + + try + { + + // ReSharper disable once CppLocalVariableMayBeConst + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::INFO); + // ReSharper disable once CppLocalVariableMayBeConst + auto openScenario = std::dynamic_pointer_cast(ExecuteImportParsing(_executablePath + "/" + kInputDir + "simpleImport/simpleImport.xosc", catalogMessageLogger)); + + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + + // Ego parameterAssignement for maxSpeed + auto catalogReference = GetVehicleImport(openScenario, "Ego", "car_white"); + res = Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + auto ref = catalogReference->GetRef(); + auto vehicleImportEgo = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportEgo != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportEgo->GetPerformance()->GetMaxSpeed() == 69.0, ASSERT_LOCATION); + + catalogReference = GetVehicleImport(openScenario, "OverTaker", "car_red"); + res = res && Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + ref = catalogReference->GetRef(); + auto vehicleImportOvertaker = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportOvertaker != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker->GetPerformance()->GetMaxSpeed() == 70.0, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker != vehicleImportEgo, ASSERT_LOCATION); + + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what(); + return Assert(false, ASSERT_LOCATION); + } + } + + + bool TestImports::TestImportWithParametersSuccess() + { + try + { + // ReSharper disable once CppLocalVariableMayBeConst + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ERROR); + // ReSharper disable once CppLocalVariableMayBeConst + auto openScenario = std::dynamic_pointer_cast(ExecuteImportParsing(_executablePath + "/" + kInputDir + "simpleImportWithParameters/importWithParameters.xosc", catalogMessageLogger)); + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + + // Ego parameterAssignement for maxSpeed + auto catalogReference = GetVehicleImport(openScenario, "Ego", "car_white"); + res = Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + auto ref = catalogReference->GetRef(); + auto vehicleImportEgo = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportEgo != nullptr, ASSERT_LOCATION); + auto temp = vehicleImportEgo->GetPerformance()->GetMaxSpeed(); + res = res && Assert(vehicleImportEgo->GetPerformance()->GetMaxSpeed() == 70.0, ASSERT_LOCATION); + + // Overtaker: Same import, different ParamterAssignements for maxSpeed + catalogReference = GetVehicleImport(openScenario, "OverTaker", "car_white"); + res = res && Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + ref = catalogReference->GetRef(); + auto vehicleImportOvertaker = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportOvertaker != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker->GetPerformance()->GetMaxSpeed() == 31.0, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker != vehicleImportEgo, ASSERT_LOCATION); + + // ThirdEntity: No ParameterAssignements => Default Value for maxSpeed + catalogReference = GetVehicleImport(openScenario, "ThirdEntity", "car_white"); + res = res && Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + ref = catalogReference->GetRef(); + auto vehicleImportThirdVehicle = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportThirdVehicle != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportThirdVehicle->GetPerformance()->GetMaxSpeed() == 60.0, ASSERT_LOCATION); + + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what(); + return Assert(false, ASSERT_LOCATION); + } + } + bool TestImports::TestImportWithExpressionsSuccess() + { + try + { + // ReSharper disable once CppLocalVariableMayBeConst + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ERROR); + // ReSharper disable once CppLocalVariableMayBeConst + auto openScenario = std::dynamic_pointer_cast(ExecuteImportParsing(_executablePath + "/" + kInputDir + "simpleImportWithExpressions/simpleImportWithExpressions.xosc", catalogMessageLogger)); + bool res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + if (!res) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + + // Ego parameterAssignement for maxSpeed + auto catalogReference = GetVehicleImport(openScenario, "Ego", "car_white"); + res = Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + auto ref = catalogReference->GetRef(); + auto vehicleImportEgo = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportEgo != nullptr, ASSERT_LOCATION); + res = res && Assert((vehicleImportEgo->GetPerformance()->GetMaxSpeed() - 70.0)< epsilon, ASSERT_LOCATION); + res = res && Assert((vehicleImportEgo->GetPerformance()->GetMaxAcceleration() - 72.0) < epsilon, ASSERT_LOCATION); + res = res && Assert((vehicleImportEgo->GetPerformance()->GetMaxDeceleration() - 63.0) < epsilon, ASSERT_LOCATION); + + // Overtaker: Same import, different ParamterAssignements for maxSpeed + catalogReference = GetVehicleImport(openScenario, "OverTaker", "car_white"); + res = res && Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + ref = catalogReference->GetRef(); + auto vehicleImportOvertaker = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportOvertaker != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker->GetPerformance()->GetMaxSpeed() == 31.0, ASSERT_LOCATION); + res = res && Assert(vehicleImportOvertaker != vehicleImportEgo, ASSERT_LOCATION); + + // ThirdEntity: No ParameterAssignements => Default Value for maxSpeed + catalogReference = GetVehicleImport(openScenario, "ThirdEntity", "car_white"); + res = res && Assert(catalogReference != nullptr, ASSERT_LOCATION); + res = res && Assert(catalogReference->GetRef() != nullptr, ASSERT_LOCATION); + ref = catalogReference->GetRef(); + auto vehicleImportThirdVehicle = CatalogHelper::AsVehicle(ref); + res = res && Assert(vehicleImportThirdVehicle != nullptr, ASSERT_LOCATION); + res = res && Assert(vehicleImportThirdVehicle->GetPerformance()->GetMaxSpeed() == 60.0, ASSERT_LOCATION); + + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what(); + return Assert(false, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestImportsV1_3.h b/cpp/applications/openScenarioTester/src/TestImportsV1_3.h new file mode 100644 index 00000000..abed3d08 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestImportsV1_3.h @@ -0,0 +1,40 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestImports : public TestBase + { + private: + static std::shared_ptr GetVehicleImport(std::shared_ptr openScenario, const std::string scenarioObjectName, const std::string entryName); + static double epsilon;; + public: + + TestImports(std::string& executablePath); + + bool TestImportSuccess(); + bool TestImportWithExpressionsSuccess(); + + bool TestImportWithParametersSuccess(); + }; + } +} \ No newline at end of file diff --git a/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.cpp b/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.cpp new file mode 100644 index 00000000..2d99c5db --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.cpp @@ -0,0 +1,207 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestInjectedParametersV1_3.h" +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestInjectedParameters::TestInjectedParameters(std::string& executablePath) : TestBase(executablePath) {} + + bool TestInjectedParameters::TestNullInjectedParameters() const + { + try + { + const std::map kEmptyMap; + (void)ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc", kEmptyMap); + return true; + } + catch( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestInjectedParameters::TestEmptyInjectedParameters() const + { + try + { + const std::map kEmptyMap; + (void)ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc", kEmptyMap); + return true; + } + catch( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + + bool TestInjectedParameters::TestInjectionsForSuccess() + { + std::map injectedParamters; + injectedParamters.emplace("testBoolean", "true"); + injectedParamters.emplace("testInteger", "2"); + injectedParamters.emplace("testUnsignedInt", "2"); + injectedParamters.emplace("testString", "injected"); + injectedParamters.emplace("testDateTime", "2018-02-24T10:00:00"); + injectedParamters.emplace("testUnsignedShort", "2"); + injectedParamters.emplace("testDouble", "2.0"); + + try + { + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc", injectedParamters)); + + auto filePath = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetRoadNetwork()->GetLogicFile()->GetFilepath(); + + // testString + auto res = Assert("injected" == filePath, ASSERT_LOCATION); + + // testUnsignedInt + auto eventPtr = GetEvent(openScenario); + res = res && Assert(2 == eventPtr->GetMaximumExecutionCount(), ASSERT_LOCATION); + + // testInteger + res = res && Assert(2 == GetLaneChangeAction(eventPtr)->GetLaneChangeTarget()->GetRelativeTargetLane()->GetValue(), ASSERT_LOCATION); + + // testDateTime + auto date = eventPtr->GetStartTrigger()->GetConditionGroupsAtIndex(0)->GetConditionsAtIndex(0)->GetByValueCondition()->GetTimeOfDayCondition()->GetDateTime(); + res = res && Assert("2018-02-24T10:00:00" == NET_ASAM_OPENSCENARIO::DateTimeParser::ToString(date), ASSERT_LOCATION); + + // testDouble + res = res && Assert(2 == GetLaneChangeAction(eventPtr)->GetLaneChangeActionDynamics()->GetValue(), ASSERT_LOCATION); + + // testBoolean + res = res && Assert(openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard()->GetStoriesAtIndex(0)->GetActsAtIndex(0)->GetManeuverGroupsAtIndex(0)->GetActors()->GetSelectTriggeringEntities(), ASSERT_LOCATION); + + // testUnsignedShort + // cannot be tested because data structures are above the Parameter definitions + + return res; + } + catch( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestInjectedParameters::TestWrongFormats() + { + std::map injectedParamters; + injectedParamters.emplace("testBoolean", "wrongBoolean"); + injectedParamters.emplace("testInteger", "wrongInteger"); + injectedParamters.emplace("testUnsignedInt", "wrongUnsignedIntValue"); + injectedParamters.emplace("testDateTime", "wrongDateTimeValue"); + injectedParamters.emplace("testUnsignedShort", "wrongUnsingedShortValue"); + injectedParamters.emplace("testDouble", "wrongDoubleValue"); + + try + { + ClearMessageLogger(); + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + (void) ExecuteParsing(filename, injectedParamters); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testInteger': Cannot convert 'wrongInteger' to an int. Number format error. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(22, 3, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testUnsignedInt': Cannot convert 'wrongUnsignedIntValue' to an unsignedInteger. Number format error. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(23, 3, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testDateTime': Cannot convert 'wrongDateTimeValue' to a dateTime. Illegal dateTime value. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(25, 3, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testUnsignedShort': Cannot convert 'wrongUnsingedShortValue' to an unsignedShort. Number format error. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(26, 3, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testDouble': Cannot convert 'wrongDoubleValue' to a double. Number format error. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(27, 3, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'testBoolean': Cannot convert 'wrongBoolean' to a boolean. Illegal boolean value. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(21, 3, filename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, _messageLogger), ASSERT_LOCATION); + } + catch( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestInjectedParameters::TestNotDefined() + { + std::map injectedParamters; + injectedParamters.emplace("notDefined", "wrongBoolean"); + + try + { + ClearMessageLogger(); + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + (void) ExecuteParsing(filename, injectedParamters); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'notDefined' must be declared as a global parameter. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(20, 2, filename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, _messageLogger), ASSERT_LOCATION); + } + catch(NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestInjectedParameters::TestNotDefinedWithNoGlobalParameters() + { + std::map injectedParamters; + injectedParamters.emplace("notDefined", "wrongBoolean"); + + try + { + ClearMessageLogger(); + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChanger1_2.xosc"; + (void) ExecuteParsing(filename, injectedParamters); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Injected parameter 'notDefined' must be declared as a global parameter. Injected parameter is ignored.", + NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, NET_ASAM_OPENSCENARIO::Textmarker(21, 2, filename))); + return Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, _messageLogger), ASSERT_LOCATION); + } + catch(NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e ) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + /** + * @param eventPtr + * @return + */ + std::shared_ptr TestInjectedParameters::GetLaneChangeAction(std::shared_ptr eventPtr) + { + return eventPtr->GetActionsAtIndex(0)->GetPrivateAction()->GetLateralAction()->GetLaneChangeAction(); + } + + /** + * @param openScenario + * @return + */ + std::shared_ptr TestInjectedParameters::GetEvent(std::shared_ptr openScenario) + { + return openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetStoryboard()->GetStoriesAtIndex(0)->GetActsAtIndex(0)->GetManeuverGroupsAtIndex(0)->GetManeuversAtIndex(0)->GetEventsAtIndex(0); + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.h b/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.h new file mode 100644 index 00000000..37fa9c03 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestInjectedParametersV1_3.h @@ -0,0 +1,58 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestInjectedParameters : public TestBase + { + public: + + TestInjectedParameters(std::string& executablePath); + + bool TestNullInjectedParameters() const; + + bool TestEmptyInjectedParameters() const; + + + bool TestInjectionsForSuccess(); + + bool TestWrongFormats(); + + bool TestNotDefined(); + + bool TestNotDefinedWithNoGlobalParameters(); + + private: + /** + * @param eventPtr + * @return + */ + std::shared_ptr GetLaneChangeAction(std::shared_ptr eventPtr); + + /** + * @param openScenario + * @return + */ + std::shared_ptr GetEvent(std::shared_ptr openScenario); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.cpp b/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.cpp new file mode 100644 index 00000000..8d07b897 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.cpp @@ -0,0 +1,171 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestParameterValidationV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestParameterValidation::TestParameterValidation(std::string& executablePath) : TestBase(executablePath) {} + + double TestParameterValidation::epsilon = 0.001; + + + + bool TestParameterValidation::TestValidation() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "ALKS_Scenario_4.2_1_FullyBlockingTarget_ParameterValidation.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + bool TestParameterValidation::TestValidationErrors() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "ALKS_Scenario_4.2_1_FullyBlockingTarget_ParameterValidationError.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(7, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(27, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(12, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(32, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(17, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'boolean_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(22, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(37, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(57, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(42, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(62, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(47, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'dateTime_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(52, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(67, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(87, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(72, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(92, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(77, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'double_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(82, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(97, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(117, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(102, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(122, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(107, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'integer_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(112, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(127, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(147, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(132, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(152, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(137, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'string_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(142, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(157, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(177, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(162, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(182, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(167, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedInt_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(172, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_equalTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(187, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_greaterOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(207, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_greaterThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(192, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_lessOrEqual' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(212, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_lessThan' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(197, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'unsignedShort_notEqualTo' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(202, 1, kFilename))); + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + bool TestParameterValidation::TestValidationWrongDataTypes() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "ALKS_Scenario_4.2_1_FullyBlockingTarget_ParameterValidationWrongDataTypes.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_dateTime' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(12, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_boolean' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(7, 1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_double' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(17,1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_integer' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(22,1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_unsignedInt' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(27,1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter validation with value constraint groups for parameter 'wrong_unsignedShort' fail.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(32,1, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_dateTime' cannot be converted to 'dateTime' (wrongDateTime).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(14, 39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_boolean' cannot be converted to 'boolean' (wrongBoolean).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(9, 39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_double' cannot be converted to 'double' (wrongDouble).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(19,39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_integer' cannot be converted to 'int' (wrongInt).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(24,39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_unsignedInt' cannot be converted to 'unsignedInt' (wrongUnsignedInt).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(29,39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value of constraint for parameter 'wrong_unsignedShort' cannot be converted to 'unsignedShort' (wrongUnsignedShort).", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(34,39, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_boolean_paramValue' cannot be converted into type 'boolean' ('wrongBoolean').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(37, 79, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_dateTime_paramValue' cannot be converted into type 'dateTime' ('wrongDateTime').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(42, 81, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_double_paramValue' cannot be converted into type 'double' ('wrongDouble').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(47, 77, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_integer_paramValue' cannot be converted into type 'integer' ('wrongInt').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(52, 79, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_unsignedInt_paramValue' cannot be converted into type 'unsignedInt' ('wrongUnsignedInt').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(57, 87, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Parameter 'wrong_unsignedShort_paramValue' cannot be converted into type 'unsignedShort' ('wrongUnsignedShort').", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(62, 91, kFilename))); + + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.h b/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.h new file mode 100644 index 00000000..26acbf38 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestParameterValidationV1_3.h @@ -0,0 +1,38 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestParameterValidation : public TestBase + { + + private : + static double epsilon; + public: + + TestParameterValidation(std::string& executablePath); + + bool TestValidation(); + bool TestValidationErrors(); + bool TestValidationWrongDataTypes(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.cpp b/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.cpp new file mode 100644 index 00000000..ff800442 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.cpp @@ -0,0 +1,92 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestRangeCheckerV1_3.h" +#include "RangeCheckerHelperV1_3.h" +#include "TreeMessageLogger.h" +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestRangeChecker::TestRangeChecker(std::string& executablePath) : TestBase(executablePath) {} + + bool TestRangeChecker::TestParamsFailure() + { + try + { + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChangerCheckerErrors.xosc"; + auto openScenario = std::dynamic_pointer_cast( ExecuteParsing(filename)); + + auto scenarioChecker = std::make_shared(); + RangeCheckerHelper::AddAllRangeCheckerRules(scenarioChecker); + scenarioChecker->CheckScenarioInFileContext(_messageLogger, openScenario); + + + std::vector messages; + + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (maxDeceleration>=0) is violated (value: -10.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(58, 20, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (maxAcceleration>=0) is violated (value: -2.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(58, 57, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (positionZ>=0) is violated (value: -13.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(60, 22, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (trackWidth>=0) is violated (value: -12.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(60, 38, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (wheelDiameter>0) is violated (value: -12.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(60, 55, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (maxSteering<=PI) is violated (value: 7.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(60, 75, filename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage( + "Range error: Rule (positionX>=0) is violated (value: -2.000000)", + NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(60, 91, filename))); + + auto res = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + + // Now apply the tree validation. + openScenario = std::dynamic_pointer_cast(ExecuteParsing(filename)); + + scenarioChecker = std::make_shared(); + RangeCheckerHelper::AddAllRangeCheckerRules(scenarioChecker); + + const auto kTreeMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR); + scenarioChecker->CheckScenarioInTreeContext(kTreeMessageLogger, openScenario); + + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR).size() == + kTreeMessageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR).size(), ASSERT_LOCATION); + + return res; + + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what(); + return Assert(false, ASSERT_LOCATION); + } + + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.h b/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.h new file mode 100644 index 00000000..b620cda2 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestRangeCheckerV1_3.h @@ -0,0 +1,36 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestRangeChecker : public TestBase + { + + public: + + TestRangeChecker(std::string& executablePath); + + bool TestParamsFailure(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestReaderV1_3.cpp b/cpp/applications/openScenarioTester/src/TestReaderV1_3.cpp new file mode 100644 index 00000000..1684cf77 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestReaderV1_3.cpp @@ -0,0 +1,190 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestReaderV1_3.h" + +#include + +#include "FileResourceLocator.h" + + +#ifdef WIN32 +# define DOT_SLASH "" +#elif defined (__linux__) || defined (__APPLE__) +# include +# define DOT_SLASH "./" +#else +# error "Operating system not supported." +#endif +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + int TestReader::ExecuteSystemCommand( std::string& command ) + { + #ifdef WIN32 + std::wstring wstringCommand; + if (!FileResourceLocator::Utf8ToWstring(command, wstringCommand)) { return -1; } + return _wsystem(wstringCommand.c_str() ); + #elif defined (__linux__) || defined (__APPLE__) + auto ret = system( command.c_str() ); + return WEXITSTATUS( ret ); + #else + # error "Operating system not supported." + #endif + } + + + + TestReader::TestReader( std::string& executablePath ) : TestBase( executablePath ) {} + + bool TestReader::TestImportSuccess() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "simpleImport/simpleImport.xosc"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + return Assert( SUCCESS_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + } + + bool TestReader::TestImportSuccessNonAsciiFile() const + { + std::string command(DOT_SLASH); command.append("OpenScenarioReader"); + command += " -i " + _executablePath + "/" + kInputDir + "simpleImportnonAsciiPathßäöü/simpleImport.xosc"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + return Assert(SUCCESS_RESULT == ExecuteSystemCommand(command), ASSERT_LOCATION); + } + + bool TestReader::TestDirectorySuccess() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -d " + _executablePath + "/" + kInputDir + "goodDirectory"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + return Assert( SUCCESS_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + } + + bool TestReader::TestDirectoryPartlySuccess() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -d " + _executablePath + "/" + kInputDir + "badDirectory"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + return Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + } + + bool TestReader::TestFileNotFound() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " "testFileNotFound"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "Scenario file not found 'testFileNotFound'" == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestDirectoryNotFound() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -d " "testDirectoryNotFound"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "'testDirectoryNotFound' does not exists or is not a directory." == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWithErrors() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "DoubleLaneChangerParamsError1_2.xosc"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "Validation failed with 3 errors and 1 warnings." == GetLine( kResultFileName, 12 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWrongCommandLine() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " Test "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( USAGE_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "OpenScenarioChecker [[{-i |-d } [-p ] [-v1_1|-v1_2]] | -v]" == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWithParamFile() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + command += " -p " + _executablePath + "/" + kInputDir + "params.conf"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "\ttestBoolean\ttrue" == GetLine( kResultFileName, 5 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestDateTime\t2018-02-24T10:00:00" == GetLine( kResultFileName, 6 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestDouble\t2.0" == GetLine( kResultFileName, 7 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestInteger\t2" == GetLine( kResultFileName, 8 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestString\tinjected" == GetLine( kResultFileName, 9 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestUnsignedInt\t2" == GetLine( kResultFileName, 10 ), ASSERT_LOCATION ); + res = res && Assert( "\ttestUnsignedShort\t2" == GetLine( kResultFileName, 11 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWithParamFileSyntaxError() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + command += " -p " + _executablePath + "/" + kInputDir + "paramsSyntaxError.conf"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "Syntax error in parameter file: line 8" == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWithParamFileSyntaxError2() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + command += " -p " + _executablePath + "/" + kInputDir + "paramsSyntaxError2.conf"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "Syntax error in parameter file: line 5" == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + bool TestReader::TestWithParamFileNotFound() const + { + std::string command( DOT_SLASH ); command.append( "OpenScenarioReader" ); + command += " -i " + _executablePath + "/" + kInputDir + "DoubleLaneChangerInjectedParams1_2.xosc"; + command += " -p paramsNotFound.conf"; + command += " -v1_2 "; + command += " > " + _executablePath + "/" + kInputDir + kResultFileName; + auto res = Assert( ERROR_RESULT == ExecuteSystemCommand( command ), ASSERT_LOCATION ); + res = res && Assert( "paramsfile not found" == GetLine( kResultFileName, 4 ), ASSERT_LOCATION ); + return res; + } + + } +} diff --git a/cpp/applications/openScenarioTester/src/TestReaderV1_3.h b/cpp/applications/openScenarioTester/src/TestReaderV1_3.h new file mode 100644 index 00000000..f71841dd --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestReaderV1_3.h @@ -0,0 +1,72 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "TestBaseV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestReader : public TestBase + { + private: + + const std::string kResultFileName = "result.txt"; + + enum RETURN_CODES + { + SUCCESS_RESULT = 0, + ERROR_RESULT, + USAGE_RESULT, + VERSION_RESULT + }; + + static int ExecuteSystemCommand(std::string& command); + + public: + + TestReader(std::string& executablePath); + + bool TestImportSuccess() const; + + bool TestImportSuccessNonAsciiFile() const; + + bool TestDirectorySuccess() const; + + bool TestDirectoryPartlySuccess() const; + + bool TestFileNotFound() const; + + bool TestDirectoryNotFound() const; + + bool TestWithErrors() const; + + bool TestWrongCommandLine() const; + + bool TestWithParamFile() const; + + bool TestWithParamFileSyntaxError() const; + + bool TestWithParamFileSyntaxError2() const; + + bool TestWithParamFileNotFound() const; + + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.cpp b/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.cpp new file mode 100644 index 00000000..f4cec482 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.cpp @@ -0,0 +1,194 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestSimpleDemosV1_3.h" +#include "SimpleMessageLogger.h" +#include "CatalogHelperV1_3.h" +#include "FileResourceLocator.h" +#include "VersionCheckerRuleV1_3.h" +#include "EgoCheckerRuleV1_3.h" + +#include +#include "ScenarioLoaderException.h" +#undef ERROR +namespace NET_ASAM_OPENSCENARIO +{ + + namespace v1_3 + { + TestSimpleDemos::TestSimpleDemos(std::string& executablePath) : TestBase(executablePath) {} + + bool TestSimpleDemos::TestSimpleDemo() const + { + + // Creating a message Logger to pick up the messages + auto messageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + // Instantiating the factory + XmlScenarioLoaderFactory loaderFactory(_executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc"); + + // Creating the loader with a file resource locator (we are reading directly from a file system) + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading the scenario + auto openScenario = std::static_pointer_cast(loader->Load(messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + + // Check for errors + if (!messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR).empty()) + { + // Browse through the results + auto fileHeader = openScenario->GetFileHeader(); + std::cout << "Major Revision :" << fileHeader->GetRevMajor() << std::endl; + std::cout << "Minor Revision :" << fileHeader->GetRevMinor() << std::endl; + } + + return true; + } + + bool TestSimpleDemos::TestImportDemo() const + { + + // Creating a message Logger to pick up the messages + auto messageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + // create another messageLogger for logging the messages that occur from imported files + auto catalogMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + // Instantiating the factory + XmlScenarioImportLoaderFactory loaderFactory(catalogMessageLogger, _executablePath + "/" + kInputDir + "simpleImport/simpleImport.xosc"); + + // Creating the loader with a file resource locator (we are reading directly from a file system) + auto loader = loaderFactory.CreateLoader(std::make_shared()); + + // Loading the scenario + auto openScenario = std::static_pointer_cast(loader->Load(messageLogger)->GetAdapter(typeid(OpenScenarioImpl).name())); + + // Get the list of scenario objects + auto scenarioObjects = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition()->GetEntities()->GetScenarioObjects(); + + for (auto&& scenarioObject : scenarioObjects) + { + // Access the object that is imported from a catalog with the name "Ego" + if (scenarioObject->GetName() == "Ego") + { + // Get the catalog reference + auto catalogReference = scenarioObject->GetEntityObject()->GetCatalogReference(); + + if (catalogReference && catalogReference->GetEntryName() == "car_white") + { + auto catalogRef = catalogReference->GetRef(); + // Now check the type. + if ( CatalogHelper::IsVehicle(catalogRef)) + { + auto vehicle = CatalogHelper::AsVehicle(catalogRef); + // Now you can access the resolved vehicle + auto axles = vehicle->GetAxles(); + // get the additonal axles + const auto kAdditionalAxlesSize = axles->GetAdditionalAxlesSize(); + if ( kAdditionalAxlesSize == 0) + { + std::cout << "Ego has 2 axles (front, rear)\n"; + } + else + { + std::cout << "Ego has " << 2 + kAdditionalAxlesSize << " axles (front, rear and " + << kAdditionalAxlesSize << " addtional axles\n"; + } + } + } + } + } + + return true; + } + + bool TestSimpleDemos::TestCheckerRuleDemo() const + { + try + { + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc")); + + // the root of the tree is available in the IOpenScenario openScenario variable + // Instantiate a checker now + ScenarioCheckerImpl scenarioChecker; + + // The sceanrio checker provided a method for every model type (here IFileHeader) to add + // CheckerRule + scenarioChecker.AddFileHeaderCheckerRule(std::make_shared(1, 0)); + + // Create a message logger to pick up the messages + auto simpleMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + // Now call the checkScenario method to check the tree + scenarioChecker.CheckScenarioInFileContext(simpleMessageLogger, openScenario); + + // Now check the picked up messages + for (auto&& message : simpleMessageLogger->GetMessages()) + { + (void)message; + // do somethong with the messaged that are picked up during the check + } + return true; + + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestSimpleDemos::TestCheckerRuleEgoDemo() const + { + try + { + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(_executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc")); + + // the root of the tree is available in the IOpenScenario openScenario variable + + // Instantiate a checker now + ScenarioCheckerImpl scenarioChecker; + + // The sceanrio checker provided a method for every model type (here IFileHeader) to add + // CheckerRule + scenarioChecker.AddEntitiesCheckerRule(std::make_shared()); + + // Create a message logger to pick up the messages + auto simpleMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::INFO); + + // Now call the checkScenario method to check the tree + scenarioChecker.CheckScenarioInFileContext(simpleMessageLogger, openScenario); + + // Now check the picked up messages + for (auto&& message : simpleMessageLogger->GetMessages()) + { + (void)message; + // do somethong with the messaged that are picked up during the check + } + + return true; + } + catch ( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + }; + +} + diff --git a/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.h b/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.h new file mode 100644 index 00000000..7c509b4e --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestSimpleDemosV1_3.h @@ -0,0 +1,41 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestSimpleDemos : public TestBase + { + + public: + + TestSimpleDemos(std::string& executablePath); + + bool TestSimpleDemo() const; + + bool TestImportDemo() const; + + bool TestCheckerRuleDemo() const; + + bool TestCheckerRuleEgoDemo() const; + }; + } +} + diff --git a/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.cpp b/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.cpp new file mode 100644 index 00000000..32054c4f --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.cpp @@ -0,0 +1,157 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestBaseV1_3.h" +#include "TestVariableValidationV1_3.h" + +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestVariableValidation::TestVariableValidation(std::string& executablePath) : TestBase(executablePath) {} + + double TestVariableValidation::epsilon = 0.001; + + + + bool TestVariableValidation::TestValidation() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerVariables1_2.xosc"; + (void) ExecuteParsing(kFilename); + std::vector messages; + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestVariableValidation::TestValidationWrongDataTypes() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerVariablesWrongDataTypes1_2.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongBoolean' cannot be parsed into 'boolean'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(23, 67, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongDateTime' cannot be parsed into 'dateTime'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(24, 69, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongDouble' cannot be parsed into 'double'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(25, 65, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongInteger' cannot be parsed into 'integer'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(26, 67, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongUnsignedInt' cannot be parsed into 'unsignedInt'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(27, 75, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongUnsignedShort' cannot be parsed into 'unsignedShort'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(28, 79, kFilename))); + + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestVariableValidation::TestVariableNotDefined() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerVariablesNotDefined1_2.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Variable 'notDefined' is not defined.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(147, 36, kFilename))); + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestVariableValidation::TestValidationWrongSetAction() + { + try + { + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerVariablesWrongAction1_2.xosc"; + (void)ExecuteParsing(kFilename); + std::vector messages; + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongBoolean' cannot be parsed into 'boolean'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(157, 35, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongDateTime' cannot be parsed into 'dateTime'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(164, 35, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongDouble' cannot be parsed into 'double'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(171, 35, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongInteger' cannot be parsed into 'integer'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(178, 35, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongUnsignedInt' cannot be parsed into 'unsignedInt'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(185, 35, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Value 'wrongUnsignedShort' cannot be parsed into 'unsignedShort'.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(192, 35, kFilename))); + + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Variable 'booleanTest' must be of numeric type to use a ModifyAction.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(210, 24, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Variable 'dateTimeTest' must be of numeric type to use a ModifyAction.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(221, 24, kFilename))); + messages.push_back(NET_ASAM_OPENSCENARIO::FileContentMessage("Variable 'stringTest' must be of numeric type to use a ModifyAction.", NET_ASAM_OPENSCENARIO::ERROR, NET_ASAM_OPENSCENARIO::Textmarker(232, 24, kFilename))); + + + bool result = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ERROR, _messageLogger), ASSERT_LOCATION); + if (!result) + { + auto filterByErrorLevelLogger = _messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ERROR); + for (auto it = filterByErrorLevelLogger.begin(); it != filterByErrorLevelLogger.end(); ++it) { + std::cout << it->ToString() << "\n"; + } + } + return result; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.h b/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.h new file mode 100644 index 00000000..41edf8d6 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestVariableValidationV1_3.h @@ -0,0 +1,40 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestVariableValidation : public TestBase + { + + private : + static double epsilon; + public: + + TestVariableValidation(std::string& executablePath); + + bool TestValidation(); + bool TestValidationErrors(); + bool TestValidationWrongDataTypes(); + bool TestVariableNotDefined(); + bool TestValidationWrongSetAction(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.cpp b/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.cpp new file mode 100644 index 00000000..67616787 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.cpp @@ -0,0 +1,84 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestVersionCheckerV1_3.h" +#include "VersionCheckerRuleV1_3.h" +#include "ScenarioLoaderException.h" +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + void TestVersionChecker::ApplyCheckerRulesFileContext(std::shared_ptr openScenario, int majorRev, int minorRev) const + { + ScenarioCheckerImpl scenarioChecker; + scenarioChecker.AddFileHeaderCheckerRule(std::make_shared(majorRev, minorRev)); + scenarioChecker.CheckScenarioInFileContext(_messageLogger, openScenario); + } + + void TestVersionChecker::ApplyCheckerRulesTreeContext(std::shared_ptr openScenario, int majorRev, int minorRev, std::shared_ptr messageLogger) const { + ScenarioCheckerImpl scenarioChecker; + scenarioChecker.AddFileHeaderCheckerRule(std::make_shared(majorRev, minorRev)); + scenarioChecker.CheckScenarioInTreeContext(messageLogger, openScenario); + } + + + TestVersionChecker::TestVersionChecker(std::string& executablePath) : TestBase(executablePath) {} + + bool TestVersionChecker::TestSuccess() + { + try + { + std::string filename = _executablePath + "/" + kInputDir + "DoubleLaneChanger1_2.xosc"; + auto openScenario = std::dynamic_pointer_cast(ExecuteParsing(filename)); + auto treeMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING); + + // File Context + ApplyCheckerRulesFileContext(openScenario, 0, 9); + std::vector messages; + auto res = Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, _messageLogger), ASSERT_LOCATION); + + // Tree Context + ApplyCheckerRulesTreeContext(openScenario, 0, 9, treeMessageLogger); + res = res && Assert(treeMessageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR).size()==0, ASSERT_LOCATION); + + // File Context + ApplyCheckerRulesFileContext(openScenario, 1, 0); + auto msg = NET_ASAM_OPENSCENARIO::FileContentMessage("Major revision and minor revision are expected to be 1 and 0", + NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, + NET_ASAM_OPENSCENARIO::Textmarker(20, 2, filename)); + messages.push_back(msg); + + res = res && Assert(AssertMessages(messages, NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING, _messageLogger), ASSERT_LOCATION); + + // Tree Context + treeMessageLogger = std::make_shared(NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING); + ApplyCheckerRulesTreeContext(openScenario, 1, 0, treeMessageLogger); + res = res && Assert(_messageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING)[0].GetMsg() == + treeMessageLogger->GetMessagesFilteredByErrorLevel(NET_ASAM_OPENSCENARIO::ErrorLevel::WARNING)[0].GetMsg(), ASSERT_LOCATION); + + return res; + + } + catch ( NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + (void)e; + return Assert(false, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.h b/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.h new file mode 100644 index 00000000..3de11dda --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestVersionCheckerV1_3.h @@ -0,0 +1,41 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +#include "TreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + class TestVersionChecker : public TestBase + { + private: + void ApplyCheckerRulesFileContext(std::shared_ptr openScenario, int majorRev, int minorRev) const; + + void ApplyCheckerRulesTreeContext(std::shared_ptr openScenario, int majorRev, int minorRev, std::shared_ptr messageLogger) const; + + public: + + TestVersionChecker(std::string& executablePath); + + bool TestSuccess(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.cpp b/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.cpp new file mode 100644 index 00000000..42ded105 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.cpp @@ -0,0 +1,126 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "TestWriterApiV1_3.h" +#include "OpenScenarioXmlExporterV1_3.h" +#include +#include "ScenarioLoaderException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + TestWriterApi::TestWriterApi(std::string& executablePath): TestBase(executablePath) {} + + bool TestWriterApi::TestSimpleSuccess() + { + + try + { + //Load a simple scenario file + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChanger.xosc"; + auto openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + + auto res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //Write out the scenario object + auto exporter = OpenScenarioXmlExporter(); + auto xmlDoc = exporter.CreateXmlDocument(openScenarioImpl); + const std::string kOutputFilename = _executablePath + "/" + kInputDir + "writerApiExports/DoubleLaneChangerGenerated.xosc"; + xmlDoc->SaveFile(kOutputFilename.c_str()); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //ReLoad the generated file and check + openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + + bool TestWriterApi::TestParamsSuccess() + { + + try + { + //Load a simple scenario file + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChangerParams.xosc"; + auto openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + + auto res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //Write out the scenario object + auto exporter = OpenScenarioXmlExporter(); + auto xmlDoc = exporter.CreateXmlDocument(openScenarioImpl); + const std::string kOutputFilename = _executablePath + "/" + kInputDir + "writerApiExports/DoubleLaneChangerParamsGenerated.xosc"; + xmlDoc->SaveFile(kOutputFilename.c_str()); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //ReLoad the generated file and check + openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + + bool TestWriterApi::TestBomFile() + { + + try + { + //Load a simple scenario file + ClearMessageLogger(); + const std::string kFilename = _executablePath + "/" + kInputDir + "DoubleLaneChanger-utf8-BOM.xosc"; + auto openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + + auto res = Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //Write out the scenario object + auto exporter = OpenScenarioXmlExporter(); + auto xmlDoc = exporter.CreateXmlDocument(openScenarioImpl); + const std::string kOutputFilename = _executablePath + "/" + kInputDir + "writerApiExports/DoubleLaneChanger-utf8-BOMGenerated.xosc"; + xmlDoc->SaveFile(kOutputFilename.c_str()); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + //ReLoad the generated file and check + openScenarioImpl = std::dynamic_pointer_cast(ExecuteParsing(kFilename)); + res = res && Assert(_messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(NET_ASAM_OPENSCENARIO::ERROR).empty(), ASSERT_LOCATION); + + return res; + } + catch (NET_ASAM_OPENSCENARIO::ScenarioLoaderException& e) + { + std::cout << e.what() << std::endl; + return Assert(false, ASSERT_LOCATION); + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.h b/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.h new file mode 100644 index 00000000..db5b9b04 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/TestWriterApiV1_3.h @@ -0,0 +1,38 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "TestBaseV1_3.h" +#include + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class TestWriterApi : public TestBase + { + + public: + + TestWriterApi(std::string& executablePath); + + bool TestSimpleSuccess(); + bool TestParamsSuccess(); + bool TestBomFile(); + }; + } +} diff --git a/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.cpp b/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.cpp new file mode 100644 index 00000000..6b80431e --- /dev/null +++ b/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.cpp @@ -0,0 +1,85 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EgoCheckerRuleV1_3.h" +#include "FileContentMessage.h" +#include "ILocator.h" +#include "BaseTreeContext.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + bool EgoCheckerRule::IsEgoDefined(std::shared_ptr object) const + { + bool isEgoDefined = false; + + // We are adding the validation code here + auto scenarioObjects = object->GetScenarioObjects(); + if (object->GetScenarioObjectsSize() != 0) + { + for (auto&& scenarioObject : scenarioObjects) + { + auto name = scenarioObject->GetName(); + for (std::string::iterator it = name.begin(); it != name.end(); ++it) + *it = std::tolower(*it, std::locale()); + if (name == "ego") + { + isEgoDefined = true; + break; + } + } + } + + return isEgoDefined; + } + + + void EgoCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + if (!IsEgoDefined(typedObject)) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + if (locator) + { + auto msg = NET_ASAM_OPENSCENARIO::FileContentMessage("No ego vehicle defined", NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + + } + } + + void EgoCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + if (!IsEgoDefined(typedObject)) + { + //const auto kLocator = std::static_pointer_cast(object->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + //if (kLocator) + //{ + const auto kContext = std::make_shared(object); + NET_ASAM_OPENSCENARIO::TreeContentMessage tcm("No ego vehicle defined", NET_ASAM_OPENSCENARIO::ErrorLevel::ERROR, kContext); + messageLogger->LogMessage(tcm); + //} + + } + } + } +} diff --git a/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.h b/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.h new file mode 100644 index 00000000..9211e2d3 --- /dev/null +++ b/cpp/applications/openScenarioTester/src/helper/EgoCheckerRuleV1_3.h @@ -0,0 +1,46 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "TestBaseV1_3.h" +#include "ICheckerRule.h" +#include "IParserMessageLogger.h" +#include "ApiClassInterfacesV1_3.h" +#include "BaseTreeContext.h" +#undef ERROR + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + + class EgoCheckerRule: public NET_ASAM_OPENSCENARIO::ICheckerRule + { + private: + bool IsEgoDefined(std::shared_ptr object) const; + + public: + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + + }; + } +} diff --git a/cpp/openScenarioLib/CMakeLists.txt b/cpp/openScenarioLib/CMakeLists.txt index 38146138..3884b030 100644 --- a/cpp/openScenarioLib/CMakeLists.txt +++ b/cpp/openScenarioLib/CMakeLists.txt @@ -182,6 +182,42 @@ if (SUPPORT_OSC_1_2) source_group( Headers\\v1_2\\Generated\\XmlParser FILES ${HEADERS_GENERATED_1_2_XMLPARSER} ) source_group( Headers\\v1_2\\Generated\\Export\\Xml FILES ${HEADERS_GENERATED_1_2_XMLEXPORTER} ) endif (SUPPORT_OSC_1_2) + +if (SUPPORT_OSC_1_3) + source_group( Sources\\V1_3\\Catalog FILES ${SOURCES_V1_3_CATALOG}) + source_group( Sources\\V1_3\\Checker FILES ${SOURCES_V1_3_CHECKER}) + source_group( Sources\\V1_3\\Loader FILES ${SOURCES_V1_3_LOADER}) + source_group( Sources\\V1_3\\Expression FILES ${SOURCES_V1_3_EXPRESSION}) + source_group( Sources\\V1_3\\Parameter FILES ${SOURCES_V1_3_PARAMETER}) + source_group( Sources\\V1_3\\Parser FILES ${SOURCES_V1_3_PARSER}) + + source_group( Sources\\v1_3\\Generated\\Api FILES ${SOURCES_GENERATED_1_3_API} ) + source_group( Sources\\v1_3\\Generated\\Checker\\Impl FILES ${SOURCES_GENERATED_1_3_CHECKER_IMPL} ) + source_group( Sources\\v1_3\\Generated\\Checker\\Range FILES ${SOURCES_GENERATED_1_3_CHECKER_RANGE} ) + source_group( Sources\\v1_3\\Generated\\Catalog FILES ${SOURCES_GENERATED_1_3_CATALOG} ) + source_group( Sources\\v1_3\\Generated\\Checker\\Model FILES ${SOURCES_GENERATED_1_3_CHECKER_MODEL} ) + source_group( Sources\\v1_3\\Generated\\Impl FILES ${SOURCES_GENERATED_1_3_IMPL} ) + source_group( Sources\\v1_3\\Generated\\XmlParser FILES ${SOURCES_GENERATED_1_3_XMLPARSER} ) + source_group( Sources\\v1_3\\Generated\\XmlExporter FILES ${SOURCES_GENERATED_1_3_XMLEXPORTER} ) + + source_group( Headers\\v1_3\\Catalog FILES ${HEADERS_CATALOG_1_3}) + source_group( Headers\\v1_3\\Loaders FILES ${HEADERS_LOADER_1_3}) + source_group( Headers\\v1_3\\Expression FILES ${HEADERS_EXPRESSION_1_3}) + source_group( Headers\\v1_3\\Parser FILES ${HEADERS_PARSER_1_3}) + source_group( Headers\\v1_3\\Checker FILES ${HEADERS_CHECKER_1_3}) + + source_group( Headers\\v1_3\\Generated\\Api FILES ${HEADERS_GENERATED_1_3_API} ) + source_group( Headers\\v1_3\\Generated\\Api\\Writer FILES ${HEADERS_GENERATED_1_3_API_WRITER} ) + source_group( Headers\\v1_3\\Generated\\Common FILES ${HEADERS_GENERATED_1_3_COMMON} ) + source_group( Headers\\v1_3\\Generated\\Checker FILES ${HEADERS_GENERATED_1_3_CHECKER} ) + source_group( Headers\\v1_3\\Generated\\Checker\\Model FILES ${HEADERS_GENERATED_1_3_CHECKER_MODEL} ) + source_group( Headers\\v1_3\\Generated\\Checker\\Impl FILES ${HEADERS_GENERATED_1_3_CHECKER_IMPL} ) + source_group( Headers\\v1_3\\Generated\\Checker\\Range FILES ${HEADERS_GENERATED_1_3_CHECKER_RANGE} ) + source_group( Headers\\v1_3\\Generated\\Catalog FILES ${HEADERS_GENERATED_1_3_CATALOG} ) + source_group( Headers\\v1_3\\Generated\\Impl FILES ${HEADERS_GENERATED_1_3_IMPL} ) + source_group( Headers\\v1_3\\Generated\\XmlParser FILES ${HEADERS_GENERATED_1_3_XMLPARSER} ) + source_group( Headers\\v1_3\\Generated\\Export\\Xml FILES ${HEADERS_GENERATED_1_3_XMLEXPORTER} ) +endif (SUPPORT_OSC_1_3) # Groups for header files source_group( Headers FILES ${HEADERS} ) @@ -309,6 +345,30 @@ target_include_directories( ${PROJECT_NAME} ) endif (SUPPORT_OSC_1_2) +if (SUPPORT_OSC_1_3) +target_include_directories( ${PROJECT_NAME} + PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/catalog" + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/checker" + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/loader" + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/parameter" + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/expression" + "${CMAKE_CURRENT_SOURCE_DIR}/src/v1_3/parser" + + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/api" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/api/writer" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/common" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/checker" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/checker/model" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/checker/impl" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/checker/range" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/catalog" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/impl" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/xmlParser" + "${CMAKE_CURRENT_SOURCE_DIR}/generated/v1_3/export/xml" +) +endif (SUPPORT_OSC_1_3) + ################################################################ # Include folders #external files diff --git a/cpp/openScenarioLib/generated/v1_3/api/ApiClassInterfacesV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/ApiClassInterfacesV1_3.h new file mode 100644 index 00000000..9565eeec --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/ApiClassInterfacesV1_3.h @@ -0,0 +1,21067 @@ + +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include "INamedReference.h" +#include "EnumerationsV1_3.h" +#include "OscInterfacesV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + class IAbsoluteSpeed; + class IAbsoluteTargetLane; + class IAbsoluteTargetLaneOffset; + class IAbsoluteTargetSpeed; + class IAccelerationCondition; + class IAcquirePositionAction; + class IAct; + class IAction; + class IActivateControllerAction; + class IActors; + class IAddEntityAction; + class IAngleCondition; + class IAnimationAction; + class IAnimationFile; + class IAnimationState; + class IAnimationType; + class IAppearanceAction; + class IAssignControllerAction; + class IAssignRouteAction; + class IAutomaticGear; + class IAxle; + class IAxles; + class IBoundingBox; + class IBrake; + class IBrakeInput; + class IByEntityCondition; + class IByObjectType; + class IByType; + class IByValueCondition; + class ICatalog; + class ICatalogDefinition; + class ICatalogLocations; + class ICatalogReference; + class ICenter; + class ICentralSwarmObject; + class IClothoid; + class IClothoidSpline; + class IClothoidSplineSegment; + class ICollisionCondition; + class IColor; + class IColorCmyk; + class IColorRgb; + class IComponentAnimation; + class ICondition; + class IConditionGroup; + class IConnectTrailerAction; + class IControlPoint; + class IController; + class IControllerAction; + class IControllerCatalogLocation; + class IControllerDistribution; + class IControllerDistributionEntry; + class ICustomCommandAction; + class ICustomContent; + class IDeleteEntityAction; + class IDeterministic; + class IDeterministicMultiParameterDistribution; + class IDeterministicMultiParameterDistributionType; + class IDeterministicParameterDistribution; + class IDeterministicSingleParameterDistribution; + class IDeterministicSingleParameterDistributionType; + class IDimensions; + class IDirectionOfTravelDistribution; + class IDirectory; + class IDisconnectTrailerAction; + class IDistanceCondition; + class IDistributionDefinition; + class IDistributionRange; + class IDistributionSet; + class IDistributionSetElement; + class IDomeImage; + class IDynamicConstraints; + class IEndOfRoadCondition; + class IEntities; + class IEntityAction; + class IEntityCondition; + class IEntityDistribution; + class IEntityDistributionEntry; + class IEntityObject; + class IEntityRef; + class IEntitySelection; + class IEnvironment; + class IEnvironmentAction; + class IEnvironmentCatalogLocation; + class IEvent; + class IExternalObjectReference; + class IFile; + class IFileHeader; + class IFinalSpeed; + class IFog; + class IFollowTrajectoryAction; + class IGear; + class IGeoPosition; + class IGlobalAction; + class IHistogram; + class IHistogramBin; + class IInRoutePosition; + class IInfrastructureAction; + class IInit; + class IInitActions; + class IKnot; + class ILane; + class ILaneChangeAction; + class ILaneChangeTarget; + class ILaneOffsetAction; + class ILaneOffsetActionDynamics; + class ILaneOffsetTarget; + class ILanePosition; + class ILateralAction; + class ILateralDistanceAction; + class ILicense; + class ILightState; + class ILightStateAction; + class ILightType; + class ILogNormalDistribution; + class ILongitudinalAction; + class ILongitudinalDistanceAction; + class IManeuver; + class IManeuverCatalogLocation; + class IManeuverGroup; + class IManualGear; + class IMiscObject; + class IMiscObjectCatalogLocation; + class IModifyRule; + class IMonitorDeclaration; + class INone; + class INormalDistribution; + class INurbs; + class IObjectController; + class IOffroadCondition; + class IOpenScenario; + class IOpenScenarioCategory; + class IOrientation; + class IOverrideBrakeAction; + class IOverrideClutchAction; + class IOverrideControllerValueAction; + class IOverrideGearAction; + class IOverrideParkingBrakeAction; + class IOverrideSteeringWheelAction; + class IOverrideThrottleAction; + class IParameterAction; + class IParameterAddValueRule; + class IParameterAssignment; + class IParameterCondition; + class IParameterDeclaration; + class IParameterModifyAction; + class IParameterMultiplyByValueRule; + class IParameterSetAction; + class IParameterValueDistribution; + class IParameterValueDistributionDefinition; + class IParameterValueSet; + class IPedestrian; + class IPedestrianAnimation; + class IPedestrianCatalogLocation; + class IPedestrianGesture; + class IPerformance; + class IPhase; + class IPoissonDistribution; + class IPolygon; + class IPolyline; + class IPosition; + class IPositionInLaneCoordinates; + class IPositionInRoadCoordinates; + class IPositionOfCurrentEntity; + class IPrecipitation; + class IPrivate; + class IPrivateAction; + class IProbabilityDistributionSet; + class IProbabilityDistributionSetElement; + class IProperties; + class IProperty; + class IRandomRouteAction; + class IRange; + class IReachPositionCondition; + class IRelativeAngleCondition; + class IRelativeClearanceCondition; + class IRelativeDistanceCondition; + class IRelativeLanePosition; + class IRelativeLaneRange; + class IRelativeObjectPosition; + class IRelativeRoadPosition; + class IRelativeSpeedCondition; + class IRelativeSpeedToMaster; + class IRelativeTargetLane; + class IRelativeTargetLaneOffset; + class IRelativeTargetSpeed; + class IRelativeWorldPosition; + class IRoadCondition; + class IRoadCursor; + class IRoadNetwork; + class IRoadPosition; + class IRoadRange; + class IRoute; + class IRouteCatalogLocation; + class IRoutePosition; + class IRouteRef; + class IRoutingAction; + class IScenarioDefinition; + class IScenarioObject; + class IScenarioObjectTemplate; + class ISelectedEntities; + class ISensorReference; + class ISensorReferenceSet; + class ISetMonitorAction; + class IShape; + class ISimulationTimeCondition; + class ISpeedAction; + class ISpeedActionTarget; + class ISpeedCondition; + class ISpeedProfileAction; + class ISpeedProfileEntry; + class IStandStillCondition; + class ISteadyState; + class IStochastic; + class IStochasticDistribution; + class IStochasticDistributionType; + class IStory; + class IStoryboard; + class IStoryboardElementStateCondition; + class ISun; + class ISynchronizeAction; + class ITargetDistanceSteadyState; + class ITargetTimeSteadyState; + class ITeleportAction; + class ITimeHeadwayCondition; + class ITimeOfDay; + class ITimeOfDayCondition; + class ITimeReference; + class ITimeToCollisionCondition; + class ITimeToCollisionConditionTarget; + class ITiming; + class ITrafficAction; + class ITrafficArea; + class ITrafficAreaAction; + class ITrafficDefinition; + class ITrafficDistribution; + class ITrafficDistributionEntry; + class ITrafficSignalAction; + class ITrafficSignalCondition; + class ITrafficSignalController; + class ITrafficSignalControllerAction; + class ITrafficSignalControllerCondition; + class ITrafficSignalGroupState; + class ITrafficSignalState; + class ITrafficSignalStateAction; + class ITrafficSinkAction; + class ITrafficSourceAction; + class ITrafficStopAction; + class ITrafficSwarmAction; + class ITrailer; + class ITrailerAction; + class ITrailerCoupler; + class ITrailerHitch; + class ITrajectory; + class ITrajectoryCatalogLocation; + class ITrajectoryFollowingMode; + class ITrajectoryPosition; + class ITrajectoryRef; + class ITransitionDynamics; + class ITraveledDistanceCondition; + class ITrigger; + class ITriggeringEntities; + class IUniformDistribution; + class IUsedArea; + class IUserDefinedAction; + class IUserDefinedAnimation; + class IUserDefinedComponent; + class IUserDefinedDistribution; + class IUserDefinedLight; + class IUserDefinedValueCondition; + class IValueConstraint; + class IValueConstraintGroup; + class IValueSetDistribution; + class IVariableAction; + class IVariableAddValueRule; + class IVariableCondition; + class IVariableDeclaration; + class IVariableModifyAction; + class IVariableModifyRule; + class IVariableMultiplyByValueRule; + class IVariableSetAction; + class IVehicle; + class IVehicleCatalogLocation; + class IVehicleCategoryDistribution; + class IVehicleCategoryDistributionEntry; + class IVehicleComponent; + class IVehicleLight; + class IVehicleRoleDistribution; + class IVehicleRoleDistributionEntry; + class IVertex; + class IVisibilityAction; + class IWaypoint; + class IWeather; + class IWind; + class IWorldPosition; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Absolute speed definition. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteSpeed : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAbsoluteSpeed() = default; + + /** + * From OpenSCENARIO class model specification: + * Absolute speed. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return value of model property steadyState + */ + virtual std::shared_ptr GetSteadyState() const + { + return nullptr; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property steadyState is set + * @return true when the property is set + */ + virtual bool IsSetSteadyState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the number (ID) of the target lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetLane : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAbsoluteTargetLane() = default; + + /** + * From OpenSCENARIO class model specification: + * Number (ID) of the target lane the entity will change to. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Lane offset with respect to the entity's current lane's center line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetLaneOffset : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAbsoluteTargetLaneOffset() = default; + + /** + * From OpenSCENARIO class model specification: + * Signed number in meters the vehicle should respect as an offset from the center of the current lane. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Absolute speed defined as a target for a SpeedAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetSpeed : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAbsoluteTargetSpeed() = default; + + /** + * From OpenSCENARIO class model specification: + * Target speed the vehicle should change to. Unit: [m/s]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Compares the entity's acceleration to a reference value. The logical operator used for comparison is defined by the rule + * attribute (less, greater, equal). If direction is used, only the projection to that direction is used in the comparison. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAccelerationCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAccelerationCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Direction of the acceleration (if not given, the total acceleration is considered). + * + * @return value of model property direction + */ + virtual DirectionalDimension GetDirection() const + { + return DirectionalDimension(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Acceleration value. Unit: [m/s²]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property direction is set + * @return true when the property is set + */ + virtual bool IsSetDirection() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls the entity to acquire a target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAcquirePositionAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAcquirePositionAction() = default; + + /** + * From OpenSCENARIO class model specification: + * A position to acquire. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A container for maneuver groups. An Act can be only executed once, whereby the included maneuver groups can be executed + * several times depending on the maximum execution count within the maneuver groups. New executions are only allowed to + * start when all contained maneuver groups are either in the complete or standby state and the start trigger evaluates to + * true. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAct : public virtual IOpenScenarioModelElement, public IStoryboardElement + { + public: + virtual ~IAct() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of this act. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * A list of maneuver groups representing the act. + * + * @return value of model property maneuverGroups + */ + virtual std::vector> GetManeuverGroups() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that starts the act. If no trigger is defined, the act starts when the Storyboard enters runningState. + * + * @return value of model property startTrigger + */ + virtual std::shared_ptr GetStartTrigger() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that stops the act. + * + * @return value of model property stopTrigger + */ + virtual std::shared_ptr GetStopTrigger() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetManeuverGroupsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetManeuverGroupsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property maneuverGroups is set + * @return true when the property is set + */ + virtual bool IsSetManeuverGroups() const = 0; + /** + * Retrieves whether property startTrigger is set + * @return true when the property is set + */ + virtual bool IsSetStartTrigger() const = 0; + /** + * Retrieves whether property stopTrigger is set + * @return true when the property is set + */ + virtual bool IsSetStopTrigger() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * An action serves to create or modify all dynamic elements of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAction : public virtual IOpenScenarioModelElement, public IStoryboardElement + { + public: + virtual ~IAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of this action. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The GlobalAction to be executed when the enclosing Action is started. + * + * @return value of model property globalAction + */ + virtual std::shared_ptr GetGlobalAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The UserDefinedAction to be executed when the enclosing Action is started. + * + * @return value of model property userDefinedAction + */ + virtual std::shared_ptr GetUserDefinedAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The PrivateAction to be executed when the enclosing Action is started. + * + * @return value of model property privateAction + */ + virtual std::shared_ptr GetPrivateAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property globalAction is set + * @return true when the property is set + */ + virtual bool IsSetGlobalAction() const = 0; + /** + * Retrieves whether property userDefinedAction is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedAction() const = 0; + /** + * Retrieves whether property privateAction is set + * @return true when the property is set + */ + virtual bool IsSetPrivateAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action activates or deactivates a user-defined controller which must be assigned to the specified entity. A + * controller cannot be activated in a domain in which it is not defined. + +Note: Although it is allowed to omit the + * objectControllerRef attribute for the sake of a backward compatibility if only a single user-defined controller is + * assigned to the concerned Entity, it is considered unmeaningful in case of multiple controllers are assigned. This is + * expected to be addressed in one of the follow-up major versions, where the attribute shall be defined as mandatory to + * exclude an ambiguity in specifying the reference controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActivateControllerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IActivateControllerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * In animation domain: Activate or deactivate an animation. If not specified: No change for controlling the animation + * domain is applied. + * + * @return value of model property animation + */ + virtual bool GetAnimation() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to a controller assigned to the entity. + * + * @return value of model property controllerRef + */ + virtual std::shared_ptr> GetControllerRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * In lateral domain: Activate or deactivate controller defined (e.g. automated, autonomous) behavior. If not specified: No + * change for controlling the lateral domain is applied. + * + * @return value of model property lateral + */ + virtual bool GetLateral() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * In lighting domain: Activate or deactivate lights. If not specified: No change for controlling the lighting domain is + * applied. + * + * @return value of model property lighting + */ + virtual bool GetLighting() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * In longitudinal domain: Activate or deactivate autonomous behavior. If not specified: No change for controlling the + * longitudinal domain is applied. + * + * @return value of model property longitudinal + */ + virtual bool GetLongitudinal() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to an object controller which is assigned to the entity. + * + * @return value of model property objectControllerRef + */ + virtual std::shared_ptr> GetObjectControllerRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property animation is set + * @return true when the property is set + */ + virtual bool IsSetAnimation() const = 0; + /** + * Retrieves whether property controllerRef is set + * @return true when the property is set + */ + virtual bool IsSetControllerRef() const = 0; + /** + * Retrieves whether property lateral is set + * @return true when the property is set + */ + virtual bool IsSetLateral() const = 0; + /** + * Retrieves whether property lighting is set + * @return true when the property is set + */ + virtual bool IsSetLighting() const = 0; + /** + * Retrieves whether property longitudinal is set + * @return true when the property is set + */ + virtual bool IsSetLongitudinal() const = 0; + /** + * Retrieves whether property objectControllerRef is set + * @return true when the property is set + */ + virtual bool IsSetObjectControllerRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A set of entities representing the actors in a maneuver group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActors : public virtual IOpenScenarioModelElement + { + public: + virtual ~IActors() = default; + + /** + * From OpenSCENARIO class model specification: + * Indicates whether the triggering entities are considered actors. + * + * @return value of model property selectTriggeringEntities + */ + virtual bool GetSelectTriggeringEntities() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * A list of entities this actor is referencing. + * + * @return value of model property entityRefs + */ + virtual std::vector> GetEntityRefs() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntityRefsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntityRefsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property selectTriggeringEntities is set + * @return true when the property is set + */ + virtual bool IsSetSelectTriggeringEntities() const = 0; + /** + * Retrieves whether property entityRefs is set + * @return true when the property is set + */ + virtual bool IsSetEntityRefs() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Adds an entity to the scenario, at a predefined position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAddEntityAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAddEntityAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Adds an entity at the specified position. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Checks if a triggering entity has reached a given angle in a specific angular coordinate, within some user-specified + * angle tolerance. + +The angle can be measured in the global world coordinate system or in s-t coordinates like road, lane + * or trajectory coordinates. In case of s-t coordinates, the orientation is measured at the local s-coordinate of the + * triggering entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAngleCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAngleCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * The angle value that will be compared to the triggering entity's orientation. Unit: [rad]. Range: [-pi..pi]. + * + * @return value of model property angle + */ + virtual double GetAngle() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Tolerance around the given angle value. Unit: [rad]. Range: [0..pi]. + * + * @return value of model property angleTolerance + */ + virtual double GetAngleTolerance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The angular coordinate to be used for the condition. + * + * @return value of model property angleType + */ + virtual AngleType GetAngleType() const + { + return AngleType(); + } + + /** + * From OpenSCENARIO class model specification: + * Define which coordinate system is used to measure the angle of the triggering entity. Note that using the value entity + * would always result in measuring an angle of zero. Default: world. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + + /** + * Retrieves whether property angle is set + * @return true when the property is set + */ + virtual bool IsSetAngle() const = 0; + /** + * Retrieves whether property angleTolerance is set + * @return true when the property is set + */ + virtual bool IsSetAngleTolerance() const = 0; + /** + * Retrieves whether property angleType is set + * @return true when the property is set + */ + virtual bool IsSetAngleType() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the transition of a current component state to the target component state or more complex + * animations like pedestrian motions and gestures as well as animations with a referenced file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAnimationAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Duration of an animation. Default if omitted: depending on the animation itself and the implementation of the simulator. + * Unit: [s]. + * + * @return value of model property animationDuration + */ + virtual double GetAnimationDuration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * If set to true, the animation will be looped. Default if omitted: false. + * + * @return value of model property loop + */ + virtual bool GetLoop() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to the type of animation that will be addressed in this AnimationAction. + * + * @return value of model property animationType + */ + virtual std::shared_ptr GetAnimationType() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * AnimationState after execution of the AnimationAction. Only required for AnimationType componentAnimation. + * + * @return value of model property animationState + */ + virtual std::shared_ptr GetAnimationState() const + { + return nullptr; + } + + + /** + * Retrieves whether property animationDuration is set + * @return true when the property is set + */ + virtual bool IsSetAnimationDuration() const = 0; + /** + * Retrieves whether property loop is set + * @return true when the property is set + */ + virtual bool IsSetLoop() const = 0; + /** + * Retrieves whether property animationType is set + * @return true when the property is set + */ + virtual bool IsSetAnimationType() const = 0; + /** + * Retrieves whether property animationState is set + * @return true when the property is set + */ + virtual bool IsSetAnimationState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Reference to a file which contains an animation / motion definition (e.g. an fbx file containing a motion from motion + * capturing). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationFile : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAnimationFile() = default; + + /** + * From OpenSCENARIO class model specification: + * Time offset from beginning of animation. Unit: [s]. Range: [0..inf[. Default, if omitted is 0 (start from beginning of + * animation). + * + * @return value of model property timeOffset + */ + virtual double GetTimeOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Filepath of the animation / motion file. + * + * @return value of model property file + */ + virtual std::shared_ptr GetFile() const + { + return nullptr; + } + + + /** + * Retrieves whether property timeOffset is set + * @return true when the property is set + */ + virtual bool IsSetTimeOffset() const = 0; + /** + * Retrieves whether property file is set + * @return true when the property is set + */ + virtual bool IsSetFile() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the animation state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationState : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAnimationState() = default; + + /** + * From OpenSCENARIO class model specification: + * The goal state of a component after the AnimationStateAction is executed (rotation: 0% -> lower limiting angle / 100% + * -> upper limiting angle; translation: 0% -> lower limiting position on movement axis / 100% -> upper limiting + * position on movement axis). Range: [0..1]. + * + * @return value of model property state + */ + virtual double GetState() const + { + return 0; + } + + + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the type of the animation. A conflicting animation will override a currently active animation. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAnimationType() = default; + + /** + * From OpenSCENARIO class model specification: + * Animation of a component along or around one axis. Field animationState in AnimationAction is required. + * + * @return value of model property componentAnimation + */ + virtual std::shared_ptr GetComponentAnimation() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of a pedestrian's motion and gestures. + * + * @return value of model property pedestrianAnimation + */ + virtual std::shared_ptr GetPedestrianAnimation() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to a file which contains an animation / motion definition. + * + * @return value of model property animationFile + */ + virtual std::shared_ptr GetAnimationFile() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The animation type is not covered by the above options and is therefore user defined. + * + * @return value of model property userDefinedAnimation + */ + virtual std::shared_ptr GetUserDefinedAnimation() const + { + return nullptr; + } + + + /** + * Retrieves whether property componentAnimation is set + * @return true when the property is set + */ + virtual bool IsSetComponentAnimation() const = 0; + /** + * Retrieves whether property pedestrianAnimation is set + * @return true when the property is set + */ + virtual bool IsSetPedestrianAnimation() const = 0; + /** + * Retrieves whether property animationFile is set + * @return true when the property is set + */ + virtual bool IsSetAnimationFile() const = 0; + /** + * Retrieves whether property userDefinedAnimation is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedAnimation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Actions defining the behaviour of an entity without moving it in the world, e.g. turning on a light or opening a door. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAppearanceAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAppearanceAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines a target light state for a certain light. + * + * @return value of model property lightStateAction + */ + virtual std::shared_ptr GetLightStateAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines an animation based on the animation type. + * + * @return value of model property animationAction + */ + virtual std::shared_ptr GetAnimationAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property lightStateAction is set + * @return true when the property is set + */ + virtual bool IsSetLightStateAction() const = 0; + /** + * Retrieves whether property animationAction is set + * @return true when the property is set + */ + virtual bool IsSetAnimationAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action assigns an object controller to the given entity defined in the enclosing PrivateAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAssignControllerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAssignControllerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated the animation domain. False: the assigned animation controller gets + * deactivated. If not specified: No change for controlling the animation domain is applied. + * + * @return value of model property activateAnimation + */ + virtual bool GetActivateAnimation() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated for the lateral dimension. False: the assigned controller gets deactivated + * for the lateral dimension. If not specified: No change for controlling the lateral dimension is applied. + * + * @return value of model property activateLateral + */ + virtual bool GetActivateLateral() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated the lighting domain. False: the assigned lighting controller gets + * deactivated. If not specified: No change for controlling the lighting domain is applied. + * + * @return value of model property activateLighting + */ + virtual bool GetActivateLighting() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated for the longitudinal dimension. False: the assigned controller gets + * deactivated for the longitudinal dimension. If not specified: No change for controlling the longitudinal dimension is + * applied. + * + * @return value of model property activateLongitudinal + */ + virtual bool GetActivateLongitudinal() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to a given entity. + * + * @return value of model property controller + */ + virtual std::shared_ptr GetController() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Uses a CatalogReference to assign a controller to a given entity. CatalogReference must point to a Controller type. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Specifies the object controller to be assigned. + * + * @return value of model property objectController + */ + virtual std::shared_ptr GetObjectController() const + { + return nullptr; + } + + + /** + * Retrieves whether property activateAnimation is set + * @return true when the property is set + */ + virtual bool IsSetActivateAnimation() const = 0; + /** + * Retrieves whether property activateLateral is set + * @return true when the property is set + */ + virtual bool IsSetActivateLateral() const = 0; + /** + * Retrieves whether property activateLighting is set + * @return true when the property is set + */ + virtual bool IsSetActivateLighting() const = 0; + /** + * Retrieves whether property activateLongitudinal is set + * @return true when the property is set + */ + virtual bool IsSetActivateLongitudinal() const = 0; + /** + * Retrieves whether property controller is set + * @return true when the property is set + */ + virtual bool IsSetController() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + /** + * Retrieves whether property objectController is set + * @return true when the property is set + */ + virtual bool IsSetObjectController() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls an entity to follow a route using waypoints on the road network. The corresponding route can be instantiated + * from a catalog type, or defined within this declaration. This action does not override any action that controls either + * lateral or longitudinal domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAssignRouteAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAssignRouteAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The route definition. + * + * @return value of model property route + */ + virtual std::shared_ptr GetRoute() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A reference to the route definition in a catalog. The reference must point to a route. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property route is set + * @return true when the property is set + */ + virtual bool IsSetRoute() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Automatic gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAutomaticGear : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAutomaticGear() = default; + + /** + * From OpenSCENARIO class model specification: + * Gear type. + * + * @return value of model property gear + */ + virtual AutomaticGearType GetGear() const + { + return AutomaticGearType(); + } + + + /** + * Retrieves whether property gear is set + * @return true when the property is set + */ + virtual bool IsSetGear() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The definition of vehicle axle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAxle : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAxle() = default; + + /** + * From OpenSCENARIO class model specification: + * Maximum steering angle which can be performed by the wheels on this axle. Unit: [rad]. Range: [0..PI], symmetrical. + * + * @return value of model property maxSteering + */ + virtual double GetMaxSteering() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Longitudinal position of the axle with respect to the vehicles reference point. Unit: [m]. Range: [0..inf[. + * + * @return value of model property positionX + */ + virtual double GetPositionX() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Z-position of the axle with respect to the vehicles reference point. Usually this is half of wheel diameter. Unit: [m]. + * Range: [0..inf[. + * + * @return value of model property positionZ + */ + virtual double GetPositionZ() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Distance of the wheels center lines at zero steering. Unit: [m]. Range: [0..inf[. + * + * @return value of model property trackWidth + */ + virtual double GetTrackWidth() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Diameter of the wheels on this axle. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property wheelDiameter + */ + virtual double GetWheelDiameter() const + { + return 0; + } + + + /** + * Retrieves whether property maxSteering is set + * @return true when the property is set + */ + virtual bool IsSetMaxSteering() const = 0; + /** + * Retrieves whether property positionX is set + * @return true when the property is set + */ + virtual bool IsSetPositionX() const = 0; + /** + * Retrieves whether property positionZ is set + * @return true when the property is set + */ + virtual bool IsSetPositionZ() const = 0; + /** + * Retrieves whether property trackWidth is set + * @return true when the property is set + */ + virtual bool IsSetTrackWidth() const = 0; + /** + * Retrieves whether property wheelDiameter is set + * @return true when the property is set + */ + virtual bool IsSetWheelDiameter() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A set of the axles of a vehicle. A vehicle must have a front axle and a rear axle except for trailers which may also + * only have a rear axle. It might have additional axles. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAxles : public virtual IOpenScenarioModelElement + { + public: + virtual ~IAxles() = default; + + /** + * From OpenSCENARIO class model specification: + * Front axle. + * + * @return value of model property frontAxle + */ + virtual std::shared_ptr GetFrontAxle() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Rear axle. + * + * @return value of model property rearAxle + */ + virtual std::shared_ptr GetRearAxle() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A list of optional additional axles. + * + * @return value of model property additionalAxles + */ + virtual std::vector> GetAdditionalAxles() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetAdditionalAxlesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetAdditionalAxlesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property frontAxle is set + * @return true when the property is set + */ + virtual bool IsSetFrontAxle() const = 0; + /** + * Retrieves whether property rearAxle is set + * @return true when the property is set + */ + virtual bool IsSetRearAxle() const = 0; + /** + * Retrieves whether property additionalAxles is set + * @return true when the property is set + */ + virtual bool IsSetAdditionalAxles() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines geometric properties of the entities as a simplified three dimensional bounding box. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBoundingBox : public virtual IOpenScenarioModelElement + { + public: + virtual ~IBoundingBox() = default; + + /** + * From OpenSCENARIO class model specification: + * Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of + * the entity (e.g. the vehicle coordinate system). + * + * @return value of model property center + */ + virtual std::shared_ptr GetCenter() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Width, length and height of the bounding box. + * + * @return value of model property dimensions + */ + virtual std::shared_ptr GetDimensions() const + { + return nullptr; + } + + + /** + * Retrieves whether property center is set + * @return true when the property is set + */ + virtual bool IsSetCenter() const = 0; + /** + * Retrieves whether property dimensions is set + * @return true when the property is set + */ + virtual bool IsSetDimensions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a brake input + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBrake : public virtual IOpenScenarioModelElement + { + public: + virtual ~IBrake() = default; + + /** + * From OpenSCENARIO class model specification: + * Rate of the change. Unit: [%/s] if used by as BrakePercent, [N/s] if used as BrakeForce. + * + * @return value of model property maxRate + */ + virtual double GetMaxRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Wanted value of the brake. Unit: [%] if used by as BrakePercent, [N] if used as BrakeForce. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property maxRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxRate() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * An action serves to create or modify all dynamic elements of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBrakeInput : public virtual IOpenScenarioModelElement + { + public: + virtual ~IBrakeInput() = default; + + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Percent + * + * @return value of model property brakePercent + */ + virtual std::shared_ptr GetBrakePercent() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Force + * + * @return value of model property brakeForce + */ + virtual std::shared_ptr GetBrakeForce() const + { + return nullptr; + } + + + /** + * Retrieves whether property brakePercent is set + * @return true when the property is set + */ + virtual bool IsSetBrakePercent() const = 0; + /** + * Retrieves whether property brakeForce is set + * @return true when the property is set + */ + virtual bool IsSetBrakeForce() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Conditions referring an entity need to know which entity shall trigger the condition. TriggeringEntities is a collection + * of entities whose states are used to verify the given condition. An additional attribute needs to specify if one of the + * entities is enough for the condition to become true, or if all of them are required. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByEntityCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IByEntityCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * A list of entities triggering this condition. + * + * @return value of model property triggeringEntities + */ + virtual std::shared_ptr GetTriggeringEntities() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The condition which is related to the triggering entities. + * + * @return value of model property entityCondition + */ + virtual std::shared_ptr GetEntityCondition() const + { + return nullptr; + } + + + /** + * Retrieves whether property triggeringEntities is set + * @return true when the property is set + */ + virtual bool IsSetTriggeringEntities() const = 0; + /** + * Retrieves whether property entityCondition is set + * @return true when the property is set + */ + virtual bool IsSetEntityCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an object type to select entities. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByObjectType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IByObjectType() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the type. + * + * @return value of model property type + */ + virtual ObjectType GetType() const + { + return ObjectType(); + } + + + /** + * Retrieves whether property type is set + * @return true when the property is set + */ + virtual bool IsSetType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A definition of a type, e. g. to be used to define members in an entity selection. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IByType() = default; + + /** + * From OpenSCENARIO class model specification: + * If a scenario object's entity object is of this type, it is part of the entity selection. + * + * @return value of model property objectType + */ + virtual ObjectType GetObjectType() const + { + return ObjectType(); + } + + + /** + * Retrieves whether property objectType is set + * @return true when the property is set + */ + virtual bool IsSetObjectType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Conditions referring a runtime value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByValueCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IByValueCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * A current parameter value is compared to a reference value. + * + * @return value of model property parameterCondition + */ + virtual std::shared_ptr GetParameterCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The current time of day is compared to a reference value. + * + * @return value of model property timeOfDayCondition + */ + virtual std::shared_ptr GetTimeOfDayCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The current simulation time is compared to a reference value. + * + * @return value of model property simulationTimeCondition + */ + virtual std::shared_ptr GetSimulationTimeCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced StoryboardElement terminates according to the given rule. + * + * @return value of model property storyboardElementStateCondition + */ + virtual std::shared_ptr GetStoryboardElementStateCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The current value of an externally defined named value is compared to a reference value (less, greater, equal). + * + * @return value of model property userDefinedValueCondition + */ + virtual std::shared_ptr GetUserDefinedValueCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal reaches the indicated state. + * + * @return value of model property trafficSignalCondition + */ + virtual std::shared_ptr GetTrafficSignalCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal controller reaches the indicated state. + * + * @return value of model property trafficSignalControllerCondition + */ + virtual std::shared_ptr GetTrafficSignalControllerCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A current variable value is compared to a reference value. + * + * @return value of model property variableCondition + */ + virtual std::shared_ptr GetVariableCondition() const + { + return nullptr; + } + + + /** + * Retrieves whether property parameterCondition is set + * @return true when the property is set + */ + virtual bool IsSetParameterCondition() const = 0; + /** + * Retrieves whether property timeOfDayCondition is set + * @return true when the property is set + */ + virtual bool IsSetTimeOfDayCondition() const = 0; + /** + * Retrieves whether property simulationTimeCondition is set + * @return true when the property is set + */ + virtual bool IsSetSimulationTimeCondition() const = 0; + /** + * Retrieves whether property storyboardElementStateCondition is set + * @return true when the property is set + */ + virtual bool IsSetStoryboardElementStateCondition() const = 0; + /** + * Retrieves whether property userDefinedValueCondition is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedValueCondition() const = 0; + /** + * Retrieves whether property trafficSignalCondition is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalCondition() const = 0; + /** + * Retrieves whether property trafficSignalControllerCondition is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalControllerCondition() const = 0; + /** + * Retrieves whether property variableCondition is set + * @return true when the property is set + */ + virtual bool IsSetVariableCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A catalog may be used to make certain OpenSCENARIO elements reusable. In a catalog parameterizable types are maintained + * and can be referenced to create runtime instances of those types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalog : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICatalog() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the catalog. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * A list of vehicle types that can be reused in a scenario. + * + * @return value of model property vehicles + */ + virtual std::vector> GetVehicles() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of controller types that can be reused in a scenario. + * + * @return value of model property controllers + */ + virtual std::vector> GetControllers() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of pedestrian types that can be reused in a scenario. + * + * @return value of model property pedestrians + */ + virtual std::vector> GetPedestrians() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of miscellaneous object type that that can be reused in a scenario. + * + * @return value of model property miscObjects + */ + virtual std::vector> GetMiscObjects() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of environment types that can be reused in a scenario. + * + * @return value of model property environments + */ + virtual std::vector> GetEnvironments() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of maneuver types that can be reused in a scenario. + * + * @return value of model property maneuvers + */ + virtual std::vector> GetManeuvers() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of trajectory types that can be reused in a scenario. + * + * @return value of model property trajectories + */ + virtual std::vector> GetTrajectories() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of route types that can be reused in a scenario. + * + * @return value of model property routes + */ + virtual std::vector> GetRoutes() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetVehiclesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetVehiclesAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetControllersSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetControllersAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPedestriansSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPedestriansAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetMiscObjectsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetMiscObjectsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEnvironmentsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEnvironmentsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetManeuversSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetManeuversAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetTrajectoriesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetTrajectoriesAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetRoutesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetRoutesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property vehicles is set + * @return true when the property is set + */ + virtual bool IsSetVehicles() const = 0; + /** + * Retrieves whether property controllers is set + * @return true when the property is set + */ + virtual bool IsSetControllers() const = 0; + /** + * Retrieves whether property pedestrians is set + * @return true when the property is set + */ + virtual bool IsSetPedestrians() const = 0; + /** + * Retrieves whether property miscObjects is set + * @return true when the property is set + */ + virtual bool IsSetMiscObjects() const = 0; + /** + * Retrieves whether property environments is set + * @return true when the property is set + */ + virtual bool IsSetEnvironments() const = 0; + /** + * Retrieves whether property maneuvers is set + * @return true when the property is set + */ + virtual bool IsSetManeuvers() const = 0; + /** + * Retrieves whether property trajectories is set + * @return true when the property is set + */ + virtual bool IsSetTrajectories() const = 0; + /** + * Retrieves whether property routes is set + * @return true when the property is set + */ + virtual bool IsSetRoutes() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A marker stating that the OpenSCENARIO file is a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogDefinition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICatalogDefinition() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return value of model property catalog + */ + virtual std::shared_ptr GetCatalog() const + { + return nullptr; + } + + + /** + * Retrieves whether property catalog is set + * @return true when the property is set + */ + virtual bool IsSetCatalog() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Set of catalogs which are referenced in a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogLocations : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICatalogLocations() = default; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on vehicle types. + * + * @return value of model property vehicleCatalog + */ + virtual std::shared_ptr GetVehicleCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on controller types. + * + * @return value of model property controllerCatalog + */ + virtual std::shared_ptr GetControllerCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on pedestrian types. + * + * @return value of model property pedestrianCatalog + */ + virtual std::shared_ptr GetPedestrianCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on miscellaneous object types. + * + * @return value of model property miscObjectCatalog + */ + virtual std::shared_ptr GetMiscObjectCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on environment types. + * + * @return value of model property environmentCatalog + */ + virtual std::shared_ptr GetEnvironmentCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on maneuver types. + * + * @return value of model property maneuverCatalog + */ + virtual std::shared_ptr GetManeuverCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on trajectory types. + * + * @return value of model property trajectoryCatalog + */ + virtual std::shared_ptr GetTrajectoryCatalog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on route types. + * + * @return value of model property routeCatalog + */ + virtual std::shared_ptr GetRouteCatalog() const + { + return nullptr; + } + + + /** + * Retrieves whether property vehicleCatalog is set + * @return true when the property is set + */ + virtual bool IsSetVehicleCatalog() const = 0; + /** + * Retrieves whether property controllerCatalog is set + * @return true when the property is set + */ + virtual bool IsSetControllerCatalog() const = 0; + /** + * Retrieves whether property pedestrianCatalog is set + * @return true when the property is set + */ + virtual bool IsSetPedestrianCatalog() const = 0; + /** + * Retrieves whether property miscObjectCatalog is set + * @return true when the property is set + */ + virtual bool IsSetMiscObjectCatalog() const = 0; + /** + * Retrieves whether property environmentCatalog is set + * @return true when the property is set + */ + virtual bool IsSetEnvironmentCatalog() const = 0; + /** + * Retrieves whether property maneuverCatalog is set + * @return true when the property is set + */ + virtual bool IsSetManeuverCatalog() const = 0; + /** + * Retrieves whether property trajectoryCatalog is set + * @return true when the property is set + */ + virtual bool IsSetTrajectoryCatalog() const = 0; + /** + * Retrieves whether property routeCatalog is set + * @return true when the property is set + */ + virtual bool IsSetRouteCatalog() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A reference to type in a catalog. It is used when importing the type in a scenario. Furthermore, it hands over + * additional parameter values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogReference : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICatalogReference() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the catalog. + * + * @return value of model property catalogName + */ + virtual std::string GetCatalogName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of catalog entry. + * + * @return value of model property entryName + */ + virtual std::string GetEntryName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * List of parameter assignments for instantiation. + * + * @return value of model property parameterAssignments + */ + virtual std::vector> GetParameterAssignments() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * The resolved reference to a catalog element (out of the catalogName and entryName). Transient means, that it is not + * mapped to the schema. + * + * @return value of model property ref + */ + virtual std::shared_ptr GetRef() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterAssignmentsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterAssignmentsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property catalogName is set + * @return true when the property is set + */ + virtual bool IsSetCatalogName() const = 0; + /** + * Retrieves whether property entryName is set + * @return true when the property is set + */ + virtual bool IsSetEntryName() const = 0; + /** + * Retrieves whether property parameterAssignments is set + * @return true when the property is set + */ + virtual bool IsSetParameterAssignments() const = 0; + /** + * Retrieves whether property ref is set + * @return true when the property is set + */ + virtual bool IsSetRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of + * the entity (e.g. the vehicle coordinate system). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICenter : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICenter() = default; + + /** + * From OpenSCENARIO class model specification: + * Center offset in x direction. + * + * @return value of model property x + */ + virtual double GetX() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Center offset in y direction. + * + * @return value of model property y + */ + virtual double GetY() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Center offset in z direction. + * + * @return value of model property z + */ + virtual double GetZ() const + { + return 0; + } + + + /** + * Retrieves whether property x is set + * @return true when the property is set + */ + virtual bool IsSetX() const = 0; + /** + * Retrieves whether property y is set + * @return true when the property is set + */ + virtual bool IsSetY() const = 0; + /** + * Retrieves whether property z is set + * @return true when the property is set + */ + virtual bool IsSetZ() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The entity that represents the center of a swarm. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICentralSwarmObject : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICentralSwarmObject() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the central entity the swarm traffic is created around. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A shape of the trajectory of an entity. A clothoid is a curve whose curvature changes linearly with its curve length. If + * curvaturePrime is 0, then the resulting trajectory is a circular arc. If curvaturePrime is 0 and additionally curvature + * is 0, then the resulting trajectory is a line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoid : public virtual IOpenScenarioModelElement + { + public: + virtual ~IClothoid() = default; + + /** + * From OpenSCENARIO class model specification: + * Start curvature of clothoid. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvature + */ + virtual double GetCurvature() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Rate of change of the curvature of the clothoid. Unit: [1/s]. Range: [0..inf[. + * + * @return value of model property curvatureDot + */ + virtual double GetCurvatureDot() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Rate of change of the curvature of the clothoid. Unit: [1/m²]. Range: ]-inf..inf[. + * + * @return value of model property curvaturePrime + */ + virtual double GetCurvaturePrime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Length of clothoid. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property length + */ + virtual double GetLength() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the start of the clothoid. Unit: [s]. Range: [0..inf[. + * + * @return value of model property startTime + */ + virtual double GetStartTime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the end of the clothoid. Unit: [s]. Range: ]0..inf[. + * + * @return value of model property stopTime + */ + virtual double GetStopTime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Start position of a clothoid. If in the start position for an orientation dimension no value is provided, then a default + * of 0 is assumed. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property curvature is set + * @return true when the property is set + */ + virtual bool IsSetCurvature() const = 0; + /** + * Retrieves whether property curvatureDot is set + * @return true when the property is set + */ + virtual bool IsSetCurvatureDot() const = 0; + /** + * Retrieves whether property curvaturePrime is set + * @return true when the property is set + */ + virtual bool IsSetCurvaturePrime() const = 0; + /** + * Retrieves whether property length is set + * @return true when the property is set + */ + virtual bool IsSetLength() const = 0; + /** + * Retrieves whether property startTime is set + * @return true when the property is set + */ + virtual bool IsSetStartTime() const = 0; + /** + * Retrieves whether property stopTime is set + * @return true when the property is set + */ + virtual bool IsSetStopTime() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A shape specification which consists of one or multiple concatenated clothoids (clothoid spline). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoidSpline : public virtual IOpenScenarioModelElement + { + public: + virtual ~IClothoidSpline() = default; + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the end of the clothoid spline curve. Required if timeStart in ClothoidSplineSegment is + * specified. Unit: [s]. Range: ].timeStart..inf[. + * + * @return value of model property timeEnd + */ + virtual double GetTimeEnd() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Clothoid spline segments. + * + * @return value of model property segments + */ + virtual std::vector> GetSegments() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetSegmentsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetSegmentsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property timeEnd is set + * @return true when the property is set + */ + virtual bool IsSetTimeEnd() const = 0; + /** + * Retrieves whether property segments is set + * @return true when the property is set + */ + virtual bool IsSetSegments() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * One segment of a clothoid spline. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoidSplineSegment : public virtual IOpenScenarioModelElement + { + public: + virtual ~IClothoidSplineSegment() = default; + + /** + * From OpenSCENARIO class model specification: + * End curvature of the clothoid segment. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvatureEnd + */ + virtual double GetCurvatureEnd() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Start curvature of the clothoid segment. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvatureStart + */ + virtual double GetCurvatureStart() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional heading offset of the clothoid segment relative to end of the previous segment or to positionStart if present. + * A missing value is interpreted as 0. Unit: [rad]. Range: ]-pi..pi[. + * + * @return value of model property hOffset + */ + virtual double GetHOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Length of the clothoid segment. The length is measured in 2D. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property length + */ + virtual double GetLength() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the start of the clothoid segment. Unit: [s]. Range: [0..inf[. + * + * @return value of model property timeStart + */ + virtual double GetTimeStart() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional start position of the clothoid segment. If omitted for the first segment, then the current position of the + * entity, which follows this trajectory is used as start position. If omitted for subsequent segments, then the end + * position of the previous segment shall be used as start position. If only the heading component of the position is + * omitted than the heading of the end position of the previous segment shall be used. + * + * @return value of model property positionStart + */ + virtual std::shared_ptr GetPositionStart() const + { + return nullptr; + } + + + /** + * Retrieves whether property curvatureEnd is set + * @return true when the property is set + */ + virtual bool IsSetCurvatureEnd() const = 0; + /** + * Retrieves whether property curvatureStart is set + * @return true when the property is set + */ + virtual bool IsSetCurvatureStart() const = 0; + /** + * Retrieves whether property hOffset is set + * @return true when the property is set + */ + virtual bool IsSetHOffset() const = 0; + /** + * Retrieves whether property length is set + * @return true when the property is set + */ + virtual bool IsSetLength() const = 0; + /** + * Retrieves whether property timeStart is set + * @return true when the property is set + */ + virtual bool IsSetTimeStart() const = 0; + /** + * Retrieves whether property positionStart is set + * @return true when the property is set + */ + virtual bool IsSetPositionStart() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Condition becomes true when the triggering entity/entities collide with another given entity or any entity of a specific + * type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICollisionCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICollisionCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of a specific entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr GetEntityRef() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Entities of this type can trigger the condition when collide. + * + * @return value of model property byType + */ + virtual std::shared_ptr GetByType() const + { + return nullptr; + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property byType is set + * @return true when the property is set + */ + virtual bool IsSetByType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Color description with a semantic color value and an optional detailed value for visualization. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColor : public virtual IOpenScenarioModelElement + { + public: + virtual ~IColor() = default; + + /** + * From OpenSCENARIO class model specification: + * Semantic value of the color. + * + * @return value of model property colorType + */ + virtual ColorType GetColorType() const + { + return ColorType(); + } + + /** + * From OpenSCENARIO class model specification: + * Color description in RGB schema. + * + * @return value of model property colorRgb + */ + virtual std::shared_ptr GetColorRgb() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Color description in CMYK schema. + * + * @return value of model property colorCmyk + */ + virtual std::shared_ptr GetColorCmyk() const + { + return nullptr; + } + + + /** + * Retrieves whether property colorType is set + * @return true when the property is set + */ + virtual bool IsSetColorType() const = 0; + /** + * Retrieves whether property colorRgb is set + * @return true when the property is set + */ + virtual bool IsSetColorRgb() const = 0; + /** + * Retrieves whether property colorCmyk is set + * @return true when the property is set + */ + virtual bool IsSetColorCmyk() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Color description in CMYK schema. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColorCmyk : public virtual IOpenScenarioModelElement + { + public: + virtual ~IColorCmyk() = default; + + /** + * From OpenSCENARIO class model specification: + * Cyan component of the color. Range: [0..1]. + * + * @return value of model property cyan + */ + virtual double GetCyan() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Black component of the color. Range: [0..1]. + * + * @return value of model property key + */ + virtual double GetKey() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Magenta component of the color. Range: [0..1]. + * + * @return value of model property magenta + */ + virtual double GetMagenta() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Yellow component of the color. Range: [0..1]. + * + * @return value of model property yellow + */ + virtual double GetYellow() const + { + return 0; + } + + + /** + * Retrieves whether property cyan is set + * @return true when the property is set + */ + virtual bool IsSetCyan() const = 0; + /** + * Retrieves whether property key is set + * @return true when the property is set + */ + virtual bool IsSetKey() const = 0; + /** + * Retrieves whether property magenta is set + * @return true when the property is set + */ + virtual bool IsSetMagenta() const = 0; + /** + * Retrieves whether property yellow is set + * @return true when the property is set + */ + virtual bool IsSetYellow() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Color description in RGB schema. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColorRgb : public virtual IOpenScenarioModelElement + { + public: + virtual ~IColorRgb() = default; + + /** + * From OpenSCENARIO class model specification: + * Blue component of the color. Range: [0..1]. + * + * @return value of model property blue + */ + virtual double GetBlue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Green component of the color. Range: [0..1]. + * + * @return value of model property green + */ + virtual double GetGreen() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Red component of the color. Range: [0..1]. + * + * @return value of model property red + */ + virtual double GetRed() const + { + return 0; + } + + + /** + * Retrieves whether property blue is set + * @return true when the property is set + */ + virtual bool IsSetBlue() const = 0; + /** + * Retrieves whether property green is set + * @return true when the property is set + */ + virtual bool IsSetGreen() const = 0; + /** + * Retrieves whether property red is set + * @return true when the property is set + */ + virtual bool IsSetRed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an animation of a component along or around one axis. Field animationState in AnimationAction is required. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IComponentAnimation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IComponentAnimation() = default; + + /** + * From OpenSCENARIO class model specification: + * Available components attached to a vehicle. + * + * @return value of model property vehicleComponent + */ + virtual std::shared_ptr GetVehicleComponent() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The component type is not covered by the above options and is therefore user defined. + * + * @return value of model property userDefinedComponent + */ + virtual std::shared_ptr GetUserDefinedComponent() const + { + return nullptr; + } + + + /** + * Retrieves whether property vehicleComponent is set + * @return true when the property is set + */ + virtual bool IsSetVehicleComponent() const = 0; + /** + * Retrieves whether property userDefinedComponent is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedComponent() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A condition represents a set of logical expressions that evaluate the relationship of values provided by the user. These + * values may be entity states, scenario properties, scenario states or external signals. Conditions are the main + * components in triggers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Specifies the edge when the condition is evaluated to true (rising, falling, risingOrFalling, none). + * + * @return value of model property conditionEdge + */ + virtual ConditionEdge GetConditionEdge() const + { + return ConditionEdge(); + } + + /** + * From OpenSCENARIO class model specification: + * Time elapsed after the edge condition is verified, until the condition returns true to the scenario. Unit: [s]. Range: + * [0..inf[. + * + * @return value of model property delay + */ + virtual double GetDelay() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the condition. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * A condition that refers to an entity. + * + * @return value of model property byEntityCondition + */ + virtual std::shared_ptr GetByEntityCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A condition that refers to a runtime value. + * + * @return value of model property byValueCondition + */ + virtual std::shared_ptr GetByValueCondition() const + { + return nullptr; + } + + + /** + * Retrieves whether property conditionEdge is set + * @return true when the property is set + */ + virtual bool IsSetConditionEdge() const = 0; + /** + * Retrieves whether property delay is set + * @return true when the property is set + */ + virtual bool IsSetDelay() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property byEntityCondition is set + * @return true when the property is set + */ + virtual bool IsSetByEntityCondition() const = 0; + /** + * Retrieves whether property byValueCondition is set + * @return true when the property is set + */ + virtual bool IsSetByValueCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A condition group is an association of conditions that is assessed during simulation time and signals true when all + * associated conditions are evaluated to true. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IConditionGroup : public virtual IOpenScenarioModelElement + { + public: + virtual ~IConditionGroup() = default; + + /** + * From OpenSCENARIO class model specification: + * A associated list of conditions. + * + * @return value of model property conditions + */ + virtual std::vector> GetConditions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetConditionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetConditionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property conditions is set + * @return true when the property is set + */ + virtual bool IsSetConditions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Connect trailer to entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IConnectTrailerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IConnectTrailerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the trailer to connect. + * + * @return value of model property trailerRef + */ + virtual std::shared_ptr> GetTrailerRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property trailerRef is set + * @return true when the property is set + */ + virtual bool IsSetTrailerRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specification of one control point of a NURBS trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControlPoint : public virtual IOpenScenarioModelElement + { + public: + virtual ~IControlPoint() = default; + + /** + * From OpenSCENARIO class model specification: + * Optional specification of the time dimension of the control point. Unit: [s]. Range: [0..inf[. + * + * @return value of model property time + */ + virtual double GetTime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional weight specification of the control point. If unspecified, all control points will be equal weighted. Range: + * ]-inf..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Position of the control point. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property time is set + * @return true when the property is set + */ + virtual bool IsSetTime() const = 0; + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a controller type and parameters for the controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IController : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IController() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines what domain the controller acts on (Default: movement) + * + * @return value of model property controllerType + */ + virtual ControllerType GetControllerType() const + { + return ControllerType(); + } + + /** + * From OpenSCENARIO class model specification: + * Name of the controller type. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Properties of the controller. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property controllerType is set + * @return true when the property is set + */ + virtual bool IsSetControllerType() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Action that either assigns a new controller, overrides an existing one or activates a controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IControllerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Assign a controller to an entity. + * + * @return value of model property assignControllerAction + */ + virtual std::shared_ptr GetAssignControllerAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Override values for throttle, brake, clutch, parking brake, steering wheel or gear. + * + * @return value of model property overrideControllerValueAction + */ + virtual std::shared_ptr GetOverrideControllerValueAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Activate/ deactivate a controller on the reference entity/entities. Replaces the deprecated element in PrivateAction in + * 1.1. + * + * @return value of model property activateControllerAction + */ + virtual std::shared_ptr GetActivateControllerAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property assignControllerAction is set + * @return true when the property is set + */ + virtual bool IsSetAssignControllerAction() const = 0; + /** + * Retrieves whether property overrideControllerValueAction is set + * @return true when the property is set + */ + virtual bool IsSetOverrideControllerValueAction() const = 0; + /** + * Retrieves whether property activateControllerAction is set + * @return true when the property is set + */ + virtual bool IsSetActivateControllerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up controller catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IControllerCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalog files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a distribution which controller should be used in a traffic. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IControllerDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * The weights of controllers of a specific type in a traffic. + * + * @return value of model property controllerDistributionEntries + */ + virtual std::vector> GetControllerDistributionEntries() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetControllerDistributionEntriesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetControllerDistributionEntriesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property controllerDistributionEntries is set + * @return true when the property is set + */ + virtual bool IsSetControllerDistributionEntries() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines that weight in a controller distribution, for the given controller type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerDistributionEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~IControllerDistributionEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The weight of the entry. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The specified controller type. + * + * @return value of model property controller + */ + virtual std::shared_ptr GetController() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A controller type import from a catalog. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + /** + * Retrieves whether property controller is set + * @return true when the property is set + */ + virtual bool IsSetController() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Used to activate a custom action native to the specific user environment. By using this action, the executability of the + * scenario will be dependent on a specific user environment. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICustomCommandAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICustomCommandAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The command that is defined as a contract between the simulation environment provider and the author of a scenario. + * + * @return value of model property content + */ + virtual std::string GetContent() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Type that is defined as a contract between the simulation environment provider and the author of a scenario. + * + * @return value of model property type + */ + virtual std::string GetType() const + { + return ""; + } + + + /** + * Retrieves whether property content is set + * @return true when the property is set + */ + virtual bool IsSetContent() const = 0; + /** + * Retrieves whether property type is set + * @return true when the property is set + */ + virtual bool IsSetType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICustomContent : public virtual IOpenScenarioModelElement + { + public: + virtual ~ICustomContent() = default; + + /** + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property content + */ + virtual std::string GetContent() const + { + return ""; + } + + + /** + * Retrieves whether property content is set + * @return true when the property is set + */ + virtual bool IsSetContent() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Deletes an entity at runtime from the simulation (The entity reference is defined in the enclosing GlobalAction). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeleteEntityAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeleteEntityAction() = default; + + + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Top level container containing all deterministic distribution elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministic : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministic() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines deterministic parameter distributions. + * + * @return value of model property deterministicParameterDistributions + */ + virtual std::vector> GetDeterministicParameterDistributions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetDeterministicParameterDistributionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetDeterministicParameterDistributionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property deterministicParameterDistributions is set + * @return true when the property is set + */ + virtual bool IsSetDeterministicParameterDistributions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for a deterministic distribution which is applied to multiple parameters. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicMultiParameterDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministicMultiParameterDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic multi-parameter distribution. + * + * @return value of model property deterministicMultiParameterDistributionType + */ + virtual std::shared_ptr GetDeterministicMultiParameterDistributionType() const + { + return nullptr; + } + + + /** + * Retrieves whether property deterministicMultiParameterDistributionType is set + * @return true when the property is set + */ + virtual bool IsSetDeterministicMultiParameterDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A deterministic distribution type which can be applied to multiple parameters. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicMultiParameterDistributionType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministicMultiParameterDistributionType() = default; + + /** + * From OpenSCENARIO class model specification: + * Deterministic multi-parameter distribution, where one or multiple sets of parameter values can be defined. + * + * @return value of model property valueSetDistribution + */ + virtual std::shared_ptr GetValueSetDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property valueSetDistribution is set + * @return true when the property is set + */ + virtual bool IsSetValueSetDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Either a DeterministicMultiParameterDistribution or a DeterministicSingleParameterDistribution + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicParameterDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministicParameterDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * A deterministic multi-parameter distribution. + * + * @return value of model property deterministicMultiParameterDistribution + */ + virtual std::shared_ptr GetDeterministicMultiParameterDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A deterministic single-parameter distribution. + * + * @return value of model property deterministicSingleParameterDistribution + */ + virtual std::shared_ptr GetDeterministicSingleParameterDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property deterministicMultiParameterDistribution is set + * @return true when the property is set + */ + virtual bool IsSetDeterministicMultiParameterDistribution() const = 0; + /** + * Retrieves whether property deterministicSingleParameterDistribution is set + * @return true when the property is set + */ + virtual bool IsSetDeterministicSingleParameterDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for a deterministic distribution which is applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicSingleParameterDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministicSingleParameterDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the parameter name these distribution values should be applied to. + * + * @return value of model property parameterName + */ + virtual std::string GetParameterName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic single-parameter distribution. + * + * @return value of model property deterministicSingleParameterDistributionType + */ + virtual std::shared_ptr GetDeterministicSingleParameterDistributionType() const + { + return nullptr; + } + + + /** + * Retrieves whether property parameterName is set + * @return true when the property is set + */ + virtual bool IsSetParameterName() const = 0; + /** + * Retrieves whether property deterministicSingleParameterDistributionType is set + * @return true when the property is set + */ + virtual bool IsSetDeterministicSingleParameterDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A deterministic distribution type which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicSingleParameterDistributionType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDeterministicSingleParameterDistributionType() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines a set of values which can be applied to a parameter. + * + * @return value of model property distributionSet + */ + virtual std::shared_ptr GetDistributionSet() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a range of values which can be applied to a parameter. + * + * @return value of model property distributionRange + */ + virtual std::shared_ptr GetDistributionRange() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a user defined deterministic distribution. + * + * @return value of model property userDefinedDistribution + */ + virtual std::shared_ptr GetUserDefinedDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property distributionSet is set + * @return true when the property is set + */ + virtual bool IsSetDistributionSet() const = 0; + /** + * Retrieves whether property distributionRange is set + * @return true when the property is set + */ + virtual bool IsSetDistributionRange() const = 0; + /** + * Retrieves whether property userDefinedDistribution is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Dimensions for a three dimensional box. Width, length and height are the absolute extensions in the (y,x,z) coordinate + * system of the entity's local coordinate system. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDimensions : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDimensions() = default; + + /** + * From OpenSCENARIO class model specification: + * Height of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property height + */ + virtual double GetHeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Length of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property length + */ + virtual double GetLength() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Width of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property width + */ + virtual double GetWidth() const + { + return 0; + } + + + /** + * Retrieves whether property height is set + * @return true when the property is set + */ + virtual bool IsSetHeight() const = 0; + /** + * Retrieves whether property length is set + * @return true when the property is set + */ + virtual bool IsSetLength() const = 0; + /** + * Retrieves whether property width is set + * @return true when the property is set + */ + virtual bool IsSetWidth() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a distribution, which direction of travel of the swarm traffic relative to the central object should be used. + * Represents the weight of a given direction of travel. The relative probability for the occurence of this direction of + * travel is defined by the weight devided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDirectionOfTravelDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDirectionOfTravelDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * The weight of vehicles moving in the opposite direction as the central object. Range: [0..inf[. + * + * @return value of model property opposite + */ + virtual double GetOpposite() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The weight of vehicles moving in the same direction as the central object. Range: [0..inf[. + * + * @return value of model property same + */ + virtual double GetSame() const + { + return 0; + } + + + /** + * Retrieves whether property opposite is set + * @return true when the property is set + */ + virtual bool IsSetOpposite() const = 0; + /** + * Retrieves whether property same is set + * @return true when the property is set + */ + virtual bool IsSetSame() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specifies the path to a directory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDirectory : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDirectory() = default; + + /** + * From OpenSCENARIO class model specification: + * File system path, e.g. path=/home/simulation/. + * + * @return value of model property path + */ + virtual std::string GetPath() const + { + return ""; + } + + + /** + * Retrieves whether property path is set + * @return true when the property is set + */ + virtual bool IsSetPath() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Disconnect any trailer from entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDisconnectTrailerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDisconnectTrailerAction() = default; + + + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The current distance between an entity and a position is compared to a given distance (less, greater, equal). Several + * additional parameters like free space etc. can be defined. The property "alongRoute" is deprecated. If + * "coordinateSystem" or "relativeDistanceType" are set, "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistanceCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDistanceCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. + * + * @return value of model property alongRoute + */ + virtual bool GetAlongRoute() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * True: distance is measured between closest bounding box points. False: reference point distance is used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set, "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual RelativeDistanceType GetRelativeDistanceType() const + { + return RelativeDistanceType(); + } + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual RoutingAlgorithm GetRoutingAlgorithm() const + { + return RoutingAlgorithm(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * The distance value. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The given position the distance is related to. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property alongRoute is set + * @return true when the property is set + */ + virtual bool IsSetAlongRoute() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property relativeDistanceType is set + * @return true when the property is set + */ + virtual bool IsSetRelativeDistanceType() const = 0; + /** + * Retrieves whether property routingAlgorithm is set + * @return true when the property is set + */ + virtual bool IsSetRoutingAlgorithm() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates whether the content defines a deterministic or stochastic parameter distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionDefinition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDistributionDefinition() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines a deterministic distribution for multiple parameters. + * + * @return value of model property deterministic + */ + virtual std::shared_ptr GetDeterministic() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a stochastic distribution for multiple parameters. + * + * @return value of model property stochastic + */ + virtual std::shared_ptr GetStochastic() const + { + return nullptr; + } + + + /** + * Retrieves whether property deterministic is set + * @return true when the property is set + */ + virtual bool IsSetDeterministic() const = 0; + /** + * Retrieves whether property stochastic is set + * @return true when the property is set + */ + virtual bool IsSetStochastic() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A range of values used for a deterministic distribution. The range starts with lower limit, Each additional value is + * defined by adding the step value to the previous value until the value is greater than upper limit. Upper limit can be + * part of the range. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionRange : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDistributionRange() = default; + + /** + * From OpenSCENARIO class model specification: + * The steps between the lower limit and upper limit. + * + * @return value of model property stepWidth + */ + virtual double GetStepWidth() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the upper limit and lower limit in range. + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property stepWidth is set + * @return true when the property is set + */ + virtual bool IsSetStepWidth() const = 0; + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A set of possible values which can occur in a deterministic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionSet : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDistributionSet() = default; + + /** + * From OpenSCENARIO class model specification: + * Possible values in the deterministic distribution. + * + * @return value of model property elements + */ + virtual std::vector> GetElements() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetElementsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetElementsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property elements is set + * @return true when the property is set + */ + virtual bool IsSetElements() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates an element for a deterministic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionSetElement : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDistributionSetElement() = default; + + /** + * From OpenSCENARIO class model specification: + * A possible value in a deterministic distribution. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Image reference to represent the sky and optionally the lighting if the image also contains lighting information. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDomeImage : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDomeImage() = default; + + /** + * From OpenSCENARIO class model specification: + * Offset to north / y-axis of world coordinate system (counter-clockwise). Unit: [rad]. Range: [0..2*PI]. 0 means the left + * and right borders of the image are aligned with the y-axis of the world coordinate system. Default if omitted: 0. + * + * @return value of model property azimuthOffset + */ + virtual double GetAzimuthOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Filepath to the dome file. + * + * @return value of model property domeFile + */ + virtual std::shared_ptr GetDomeFile() const + { + return nullptr; + } + + + /** + * Retrieves whether property azimuthOffset is set + * @return true when the property is set + */ + virtual bool IsSetAzimuthOffset() const = 0; + /** + * Retrieves whether property domeFile is set + * @return true when the property is set + */ + virtual bool IsSetDomeFile() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Constraints that are limiting the acceleration, the deceleration and the speed. Used in lateral or longitudinal actions. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDynamicConstraints : public virtual IOpenScenarioModelElement + { + public: + virtual ~IDynamicConstraints() = default; + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration the distance controller is allowed to use for keeping the distance. Missing value is interpreted as + * 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxAcceleration + */ + virtual double GetMaxAcceleration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration rate the distance controller is allowed to use for keeping the distance. Missing value is + * interpreted as 'inf'. Unit: [m/s³]. Range: [0..inf[. + * + * @return value of model property maxAccelerationRate + */ + virtual double GetMaxAccelerationRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration the distance controller is allowed to use for keeping the distance. Missing value is interpreted as + * 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxDeceleration + */ + virtual double GetMaxDeceleration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration rate the distance controller is allowed to use for keeping the distance. Missing value is + * interpreted as 'inf'. Unit: [m/s³]. Range: [0..inf[. + * + * @return value of model property maxDecelerationRate + */ + virtual double GetMaxDecelerationRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum speed the distance controller is allowed to use for keeping the distance. Missing value is interpreted as 'inf'. + * Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property maxSpeed + */ + virtual double GetMaxSpeed() const + { + return 0; + } + + + /** + * Retrieves whether property maxAcceleration is set + * @return true when the property is set + */ + virtual bool IsSetMaxAcceleration() const = 0; + /** + * Retrieves whether property maxAccelerationRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxAccelerationRate() const = 0; + /** + * Retrieves whether property maxDeceleration is set + * @return true when the property is set + */ + virtual bool IsSetMaxDeceleration() const = 0; + /** + * Retrieves whether property maxDecelerationRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxDecelerationRate() const = 0; + /** + * Retrieves whether property maxSpeed is set + * @return true when the property is set + */ + virtual bool IsSetMaxSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Condition becomes true after the triggering entity/entities has reached the end of a road network for a given amount of + * time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEndOfRoadCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEndOfRoadCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Amount of time at end of road. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual double GetDuration() const + { + return 0; + } + + + /** + * Retrieves whether property duration is set + * @return true when the property is set + */ + virtual bool IsSetDuration() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of entities (scenario objects or entity selections) in a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntities : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntities() = default; + + /** + * From OpenSCENARIO class model specification: + * A list of scenario object definitions that pairs an entity object and a controller. + * + * @return value of model property scenarioObjects + */ + virtual std::vector> GetScenarioObjects() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of entity selection definitions. + * + * @return value of model property entitySelections + */ + virtual std::vector> GetEntitySelections() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetScenarioObjectsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetScenarioObjectsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntitySelectionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntitySelectionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property scenarioObjects is set + * @return true when the property is set + */ + virtual bool IsSetScenarioObjects() const = 0; + /** + * Retrieves whether property entitySelections is set + * @return true when the property is set + */ + virtual bool IsSetEntitySelections() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an action that adds or deletes a referred entity. +Entities to be added or deleted must be defined in the + * Entities section. +An entity can only exist in one copy. Adding an already active entity will have no effect, neither + * will deleting an already inactive entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Action that adds the reference entity to the scenario. + * + * @return value of model property addEntityAction + */ + virtual std::shared_ptr GetAddEntityAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Action that deletes the reference entity from the scenario. + * + * @return value of model property deleteEntityAction + */ + virtual std::shared_ptr GetDeleteEntityAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property addEntityAction is set + * @return true when the property is set + */ + virtual bool IsSetAddEntityAction() const = 0; + /** + * Retrieves whether property deleteEntityAction is set + * @return true when the property is set + */ + virtual bool IsSetDeleteEntityAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a specific condition on an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has reached the end of the road. + * + * @return value of model property endOfRoadCondition + */ + virtual std::shared_ptr GetEndOfRoadCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity was involved in a collision. + * + * @return value of model property collisionCondition + */ + virtual std::shared_ptr GetCollisionCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has left the road. + * + * @return value of model property offroadCondition + */ + virtual std::shared_ptr GetOffroadCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the time headway between two entities. + * + * @return value of model property timeHeadwayCondition + */ + virtual std::shared_ptr GetTimeHeadwayCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the time to collision between two entities. + * + * @return value of model property timeToCollisionCondition + */ + virtual std::shared_ptr GetTimeToCollisionCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the current acceleration of an entity. + * + * @return value of model property accelerationCondition + */ + virtual std::shared_ptr GetAccelerationCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has not moved. + * + * @return value of model property standStillCondition + */ + virtual std::shared_ptr GetStandStillCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the current speed of the referenced entities. + * + * @return value of model property speedCondition + */ + virtual std::shared_ptr GetSpeedCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative speed between two entity. + * + * @return value of model property relativeSpeedCondition + */ + virtual std::shared_ptr GetRelativeSpeedCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the total traveled distance of the reference entity since the start of the scenario. + * + * @return value of model property traveledDistanceCondition + */ + virtual std::shared_ptr GetTraveledDistanceCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity has reached a given position within a given uncertainty. + * + * @return value of model property reachPositionCondition + */ + virtual std::shared_ptr GetReachPositionCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the distance between two entities or an entity and a position. + * + * @return value of model property distanceCondition + */ + virtual std::shared_ptr GetDistanceCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative distance between two entities. + * + * @return value of model property relativeDistanceCondition + */ + virtual std::shared_ptr GetRelativeDistanceCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative clearance of an entity. + * + * @return value of model property relativeClearanceCondition + */ + virtual std::shared_ptr GetRelativeClearanceCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity. + * + * @return value of model property angleCondition + */ + virtual std::shared_ptr GetAngleCondition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity relative to a reference entity. + * + * @return value of model property relativeAngleCondition + */ + virtual std::shared_ptr GetRelativeAngleCondition() const + { + return nullptr; + } + + + /** + * Retrieves whether property endOfRoadCondition is set + * @return true when the property is set + */ + virtual bool IsSetEndOfRoadCondition() const = 0; + /** + * Retrieves whether property collisionCondition is set + * @return true when the property is set + */ + virtual bool IsSetCollisionCondition() const = 0; + /** + * Retrieves whether property offroadCondition is set + * @return true when the property is set + */ + virtual bool IsSetOffroadCondition() const = 0; + /** + * Retrieves whether property timeHeadwayCondition is set + * @return true when the property is set + */ + virtual bool IsSetTimeHeadwayCondition() const = 0; + /** + * Retrieves whether property timeToCollisionCondition is set + * @return true when the property is set + */ + virtual bool IsSetTimeToCollisionCondition() const = 0; + /** + * Retrieves whether property accelerationCondition is set + * @return true when the property is set + */ + virtual bool IsSetAccelerationCondition() const = 0; + /** + * Retrieves whether property standStillCondition is set + * @return true when the property is set + */ + virtual bool IsSetStandStillCondition() const = 0; + /** + * Retrieves whether property speedCondition is set + * @return true when the property is set + */ + virtual bool IsSetSpeedCondition() const = 0; + /** + * Retrieves whether property relativeSpeedCondition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeSpeedCondition() const = 0; + /** + * Retrieves whether property traveledDistanceCondition is set + * @return true when the property is set + */ + virtual bool IsSetTraveledDistanceCondition() const = 0; + /** + * Retrieves whether property reachPositionCondition is set + * @return true when the property is set + */ + virtual bool IsSetReachPositionCondition() const = 0; + /** + * Retrieves whether property distanceCondition is set + * @return true when the property is set + */ + virtual bool IsSetDistanceCondition() const = 0; + /** + * Retrieves whether property relativeDistanceCondition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeDistanceCondition() const = 0; + /** + * Retrieves whether property relativeClearanceCondition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeClearanceCondition() const = 0; + /** + * Retrieves whether property angleCondition is set + * @return true when the property is set + */ + virtual bool IsSetAngleCondition() const = 0; + /** + * Retrieves whether property relativeAngleCondition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeAngleCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * An entity group within a traffic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted specific vehicle/pedestrian entity profiles as part of an entity group. + * + * @return value of model property entityDistributionEntry + */ + virtual std::vector> GetEntityDistributionEntry() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntityDistributionEntrySize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntityDistributionEntryAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property entityDistributionEntry is set + * @return true when the property is set + */ + virtual bool IsSetEntityDistributionEntry() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines one weighted specific vehicle/pedestrian entity profile as part of an entity group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityDistributionEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityDistributionEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The weight of this entity profile within the entity group. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The entity profile that shall appear in the entity group. + * + * @return value of model property scenarioObjectTemplate + */ + virtual std::shared_ptr GetScenarioObjectTemplate() const + { + return nullptr; + } + + + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + /** + * Retrieves whether property scenarioObjectTemplate is set + * @return true when the property is set + */ + virtual bool IsSetScenarioObjectTemplate() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A vehicle type, pedestrian type or miscellaneous object type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityObject : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityObject() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type MiscObject, Vehicle or Pedestrian. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Vehicle definition. + * + * @return value of model property vehicle + */ + virtual std::shared_ptr GetVehicle() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Pedestrian definition. + * + * @return value of model property pedestrian + */ + virtual std::shared_ptr GetPedestrian() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of a MiscObject. + * + * @return value of model property miscObject + */ + virtual std::shared_ptr GetMiscObject() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * An reference to an external object that is defined outside of a scenario or catalog (e.g. in the road network) + * + * @return value of model property externalObjectReference + */ + virtual std::shared_ptr GetExternalObjectReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + /** + * Retrieves whether property vehicle is set + * @return true when the property is set + */ + virtual bool IsSetVehicle() const = 0; + /** + * Retrieves whether property pedestrian is set + * @return true when the property is set + */ + virtual bool IsSetPedestrian() const = 0; + /** + * Retrieves whether property miscObject is set + * @return true when the property is set + */ + virtual bool IsSetMiscObject() const = 0; + /** + * Retrieves whether property externalObjectReference is set + * @return true when the property is set + */ + virtual bool IsSetExternalObjectReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Unambiguous reference to an entity represented as its name. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityRef : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEntityRef() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Grouping of scenario objects by name and/or type. An instance of EntitySelection is considered also an instance of + * Entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntitySelection : public virtual IOpenScenarioModelElement, public IEntity + { + public: + virtual ~IEntitySelection() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the entity selection. By this name, a selection can be referenced as an entity. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Selected entities as members of the entity selection. + * + * @return value of model property members + */ + virtual std::shared_ptr GetMembers() const + { + return nullptr; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property members is set + * @return true when the property is set + */ + virtual bool IsSetMembers() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the environment conditions of a scenario, e.g. time of day, weather and road condition. If one of the conditions + * is missing it means that it doesn't change. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironment : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IEnvironment() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the environment. If used in catalog name is required. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Time of the day during the simulation. + * + * @return value of model property timeOfDay + */ + virtual std::shared_ptr GetTimeOfDay() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Weather conditions during the simulation. + * + * @return value of model property weather + */ + virtual std::shared_ptr GetWeather() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Road conditions during the simulation. + * + * @return value of model property roadCondition + */ + virtual std::shared_ptr GetRoadCondition() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property timeOfDay is set + * @return true when the property is set + */ + virtual bool IsSetTimeOfDay() const = 0; + /** + * Retrieves whether property weather is set + * @return true when the property is set + */ + virtual bool IsSetWeather() const = 0; + /** + * Retrieves whether property roadCondition is set + * @return true when the property is set + */ + virtual bool IsSetRoadCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Setting weather state, road conditions, and time of the day. An environment can be defined or an environment type from a + * catalog can be used to instantiate an environment. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironmentAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEnvironmentAction() = default; + + /** + * From OpenSCENARIO class model specification: + * New environment definition. + * + * @return value of model property environment + */ + virtual std::shared_ptr GetEnvironment() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type Environment. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property environment is set + * @return true when the property is set + */ + virtual bool IsSetEnvironment() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up environment catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironmentCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IEnvironmentCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for Actions. Its priority settings determine how to interact with other events within the same scope + * (maneuver). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEvent : public virtual IOpenScenarioModelElement, public IStoryboardElement + { + public: + virtual ~IEvent() = default; + + /** + * From OpenSCENARIO class model specification: + * Maximum number of executions. Default value is 1. Range: [1..inf[. + * + * @return value of model property maximumExecutionCount + */ + virtual uint32_t GetMaximumExecutionCount() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the event. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Priority of each event. + * + * @return value of model property priority + */ + virtual Priority GetPriority() const + { + return Priority(); + } + + /** + * From OpenSCENARIO class model specification: + * List of actions in an event. + * + * @return value of model property actions + */ + virtual std::vector> GetActions() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Actions are executed as soon as the start trigger fires. This point in time represents the start of the event. If this + * optional field is missing, the event starts as soon as the start trigger of the enclosing act starts. + * + * @return value of model property startTrigger + */ + virtual std::shared_ptr GetStartTrigger() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetActionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetActionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property maximumExecutionCount is set + * @return true when the property is set + */ + virtual bool IsSetMaximumExecutionCount() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property priority is set + * @return true when the property is set + */ + virtual bool IsSetPriority() const = 0; + /** + * Retrieves whether property actions is set + * @return true when the property is set + */ + virtual bool IsSetActions() const = 0; + /** + * Retrieves whether property startTrigger is set + * @return true when the property is set + */ + virtual bool IsSetStartTrigger() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Reference to an external object that is defined beyond OpenSCENARIO files and catalogs, i.e. in the road network (= + * road object or traffic signal). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IExternalObjectReference : public virtual IOpenScenarioModelElement + { + public: + virtual ~IExternalObjectReference() = default; + + /** + * From OpenSCENARIO class model specification: + * Unique identifier of the referenced external object in the road network. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * File on the file system, including its file path. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFile : public virtual IOpenScenarioModelElement + { + public: + virtual ~IFile() = default; + + /** + * From OpenSCENARIO class model specification: + * Filepath e.g. filepath=/home/simulator/customDriverSpecification.xml. + * + * @return value of model property filepath + */ + virtual std::string GetFilepath() const + { + return ""; + } + + + /** + * Retrieves whether property filepath is set + * @return true when the property is set + */ + virtual bool IsSetFilepath() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * File header used in OpenSCENARIO files, e.g. scenario file or catalog files. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFileHeader : public virtual IOpenScenarioModelElement + { + public: + virtual ~IFileHeader() = default; + + /** + * From OpenSCENARIO class model specification: + * Author of the scenario or the catalog. + * + * @return value of model property author + */ + virtual std::string GetAuthor() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * User specific date and time recommended: YYYY-MM-DDThh:mm:ss. + * + * @return value of model property date + */ + virtual DateTime GetDate() const + { + return {}; + } + + /** + * From OpenSCENARIO class model specification: + * User specific description. + * + * @return value of model property description + */ + virtual std::string GetDescription() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Major OpenSCENARIO revision, this file conforms to Range: [0..inf[. + * + * @return value of model property revMajor + */ + virtual uint16_t GetRevMajor() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Minor OpenSCENARIO revision, this file conforms to Range: [0..inf[. + * + * @return value of model property revMinor + */ + virtual uint16_t GetRevMinor() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Licensing information. + * + * @return value of model property license + */ + virtual std::shared_ptr GetLicense() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Additional custom information about the scenario. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + + /** + * Retrieves whether property author is set + * @return true when the property is set + */ + virtual bool IsSetAuthor() const = 0; + /** + * Retrieves whether property date is set + * @return true when the property is set + */ + virtual bool IsSetDate() const = 0; + /** + * Retrieves whether property description is set + * @return true when the property is set + */ + virtual bool IsSetDescription() const = 0; + /** + * Retrieves whether property revMajor is set + * @return true when the property is set + */ + virtual bool IsSetRevMajor() const = 0; + /** + * Retrieves whether property revMinor is set + * @return true when the property is set + */ + virtual bool IsSetRevMinor() const = 0; + /** + * Retrieves whether property license is set + * @return true when the property is set + */ + virtual bool IsSetLicense() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Final speed definition for a SynchronizeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFinalSpeed : public virtual IOpenScenarioModelElement + { + public: + virtual ~IFinalSpeed() = default; + + /** + * From OpenSCENARIO class model specification: + * The absolute speed a synchronized entity should have at its target position. + * + * @return value of model property absoluteSpeed + */ + virtual std::shared_ptr GetAbsoluteSpeed() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The speed a synchronized entity should have relative to its master entity at its target position. + * + * @return value of model property relativeSpeedToMaster + */ + virtual std::shared_ptr GetRelativeSpeedToMaster() const + { + return nullptr; + } + + + /** + * Retrieves whether property absoluteSpeed is set + * @return true when the property is set + */ + virtual bool IsSetAbsoluteSpeed() const = 0; + /** + * Retrieves whether property relativeSpeedToMaster is set + * @return true when the property is set + */ + virtual bool IsSetRelativeSpeedToMaster() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines fog at simulation runtime. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFog : public virtual IOpenScenarioModelElement + { + public: + virtual ~IFog() = default; + + /** + * From OpenSCENARIO class model specification: + * Unit: [m]. Range: [0..inf[. + * + * @return value of model property visualRange + */ + virtual double GetVisualRange() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Dimensions and center of fog in fixed coordinates. + * + * @return value of model property boundingBox + */ + virtual std::shared_ptr GetBoundingBox() const + { + return nullptr; + } + + + /** + * Retrieves whether property visualRange is set + * @return true when the property is set + */ + virtual bool IsSetVisualRange() const = 0; + /** + * Retrieves whether property boundingBox is set + * @return true when the property is set + */ + virtual bool IsSetBoundingBox() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls an entity to follow a trajectory using vertices, timings (optionally) and a corresponding interpolation + * strategy. The trajectory can be instantiated from a catalog type, or defined within this declaration. Use trajectoryRef + * to define a trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFollowTrajectoryAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~IFollowTrajectoryAction() = default; + + /** + * From OpenSCENARIO class model specification: + * An offset into the trajectory. This has the effect of logically truncating the trajectory, so the resulting new + * trajectory starts at that distance offset. Where a timing TimeReference fields is provided, the time that would be + * taken to reach this point is deducted from all calculated waypoint time values. Unit: [m]. Range: [0..arclength of the + * trajectory]. + * + * @return value of model property initialDistanceOffset + */ + virtual double GetInitialDistanceOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Trajectory definition. Must not be used when catalogReference or trajectoryRef is set. + * + * @return value of model property trajectory + */ + virtual std::shared_ptr GetTrajectory() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A reference to the trajectory type in a catalog. Must not be used when trajectory or trajectoryRef is set. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines if time information provided within the trajectory should be considered. If so, it may be used as either + * absolute or relative time along the trajectory in order to define longitudinal velocity of the actor. Moreover, a time + * offset or time scaling may be applied. + * + * @return value of model property timeReference + */ + virtual std::shared_ptr GetTimeReference() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The mode how to follow the given trajectory. + * + * @return value of model property trajectoryFollowingMode + */ + virtual std::shared_ptr GetTrajectoryFollowingMode() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory to be followed. + * + * @return value of model property trajectoryRef + */ + virtual std::shared_ptr GetTrajectoryRef() const + { + return nullptr; + } + + + /** + * Retrieves whether property initialDistanceOffset is set + * @return true when the property is set + */ + virtual bool IsSetInitialDistanceOffset() const = 0; + /** + * Retrieves whether property trajectory is set + * @return true when the property is set + */ + virtual bool IsSetTrajectory() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + /** + * Retrieves whether property timeReference is set + * @return true when the property is set + */ + virtual bool IsSetTimeReference() const = 0; + /** + * Retrieves whether property trajectoryFollowingMode is set + * @return true when the property is set + */ + virtual bool IsSetTrajectoryFollowingMode() const = 0; + /** + * Retrieves whether property trajectoryRef is set + * @return true when the property is set + */ + virtual bool IsSetTrajectoryRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGear : public virtual IOpenScenarioModelElement + { + public: + virtual ~IGear() = default; + + /** + * From OpenSCENARIO class model specification: + * Manual gear description. + * + * @return value of model property manualGear + */ + virtual std::shared_ptr GetManualGear() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Automatic gear description. + * + * @return value of model property automaticGear + */ + virtual std::shared_ptr GetAutomaticGear() const + { + return nullptr; + } + + + /** + * Retrieves whether property manualGear is set + * @return true when the property is set + */ + virtual bool IsSetManualGear() const = 0; + /** + * Retrieves whether property automaticGear is set + * @return true when the property is set + */ + virtual bool IsSetAutomaticGear() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of the spherical geographic coordinates (angular Longitude and Latitude) derived from the + * geodetic datum specified in the respective road network definition file (external to the ASAM OpenSCENARIO). Optionally, + * the orientation of the position can be specified. +In the general case, the altitude of the target position above a + * conventional reference level (e.g., the mean sea level on the Earth) is determined by the surface of the underlying + * road, which is derived from the Longitude/Latitude-coordinates of the position. However, optionally, the altitude of the + * target position with respect to the road surface can be specified. +The orientation of the road in the inertial + * (X,Y,Z)-coordinate system, in turn, is specified in the respective road network definition file too. +The transformation + * of angular geographic coordinates into the flat (X,Y)-projection in the World coordinate system is entrusted to a + * simulation environment. However, if the target position would be outside the road boundaries, the Z-coordinate of the + * position is undefined by the OpenSCENARIO standard. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGeoPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IGeoPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Altitude is the Earth gravity-related vertical distance along the z-axis above the road surface, specified horizontally + * by its Longitude/Latitude coordinates and vertically by the verticalRoadSelection attribute. When calculating the road + * surface, it is accounted for an elevation of the road, an entire road super-elevation, or, in more complex cases, a road + * lateral shape profile that are specified in the road network definition (external to the OpenSCENARIO). Missing value is + * interpreted as altitude=0. Unit: [m]. Range: [0..inf[. + * + * @return value of model property altitude + */ + virtual double GetAltitude() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Height above a reference surface (e.g. sea level, earth surface). Unit: [m]. If the value is omitted, height is + * interpreted as 0. + * + * @return value of model property height + */ + virtual double GetHeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The latitude of a point on earth's surface is the angle between the equatorial plane and the straight line that passes + * through that point and through the center of the earth. Unit: [rad]. Range: [-PI..PI]. + * + * @return value of model property latitude + */ + virtual double GetLatitude() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The latitude of a point on earth's surface is the angle between the equatorial plane and the straight line that passes + * through that point and through the center of the earth. Unit: [°]. Range: [-90..90]. Missing value is interpreted + * as 0. + * + * @return value of model property latitudeDeg + */ + virtual double GetLatitudeDeg() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The longitude of a point on earth's surface is the angle east or west of a reference meridian to another meridian that + * passes through that point. Unit: [rad]. Range: [-PI/2..PI/2]. + * + * @return value of model property longitude + */ + virtual double GetLongitude() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The longitude of a point on earth's surface is the angle east or west of a reference meridian to another meridian that + * passes through that point. Unit: [°]. Range: [-180..180]. Missing value is interpreted as 0. + * + * @return value of model property longitudeDeg + */ + virtual double GetLongitudeDeg() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Selection of a road for determining the correct z-value of the position if multiple roads are located at the specified + * lat/lon coordinate. Value 0 is interpreted as the top-most road. The value decreases by one for every road below. If + * several roads are located on the same z-value (e.g. junctions), they are treated interchangeably with the same value + * (e.g. junction at top with two roads = value 0, next road below has value -1). Default if omitted: 0. Range: ]-inf, 0]. + * + * @return value of model property verticalRoadSelection + */ + virtual int GetVerticalRoadSelection() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * In the case of altitude=0, the Pitch and Roll angles are determined by the underlying road surface at the target + * position and therefore undefined by the OpenSCENARIO standard. +The absolute reference context refers to the orientation + * with respect to the World coordinate system, which is assumed to be the projected coordinate system based on the + * spherical geographic coordinate system. +The relative reference context refers to the orientation with respect to the + * reference (s,t)-coordinate system of the lane on the road underlying the target position. The Heading angle at the + * target position on the (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis + * at the target position is built parallel to the tangent to the reference lane s-axis on the reference road. The Heading + * is counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property altitude is set + * @return true when the property is set + */ + virtual bool IsSetAltitude() const = 0; + /** + * Retrieves whether property height is set + * @return true when the property is set + */ + virtual bool IsSetHeight() const = 0; + /** + * Retrieves whether property latitude is set + * @return true when the property is set + */ + virtual bool IsSetLatitude() const = 0; + /** + * Retrieves whether property latitudeDeg is set + * @return true when the property is set + */ + virtual bool IsSetLatitudeDeg() const = 0; + /** + * Retrieves whether property longitude is set + * @return true when the property is set + */ + virtual bool IsSetLongitude() const = 0; + /** + * Retrieves whether property longitudeDeg is set + * @return true when the property is set + */ + virtual bool IsSetLongitudeDeg() const = 0; + /** + * Retrieves whether property verticalRoadSelection is set + * @return true when the property is set + */ + virtual bool IsSetVerticalRoadSelection() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Actions that does not explicitly target an entity’s state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGlobalAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IGlobalAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Sets the weather state, road conditions, and time of the day. + * + * @return value of model property environmentAction + */ + virtual std::shared_ptr GetEnvironmentAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Removing or adding entities. + * + * @return value of model property entityAction + */ + virtual std::shared_ptr GetEntityAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying traffic signals. + * + * @return value of model property infrastructureAction + */ + virtual std::shared_ptr GetInfrastructureAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Set the value of a monitor based on the scenario execution. + * + * @return value of model property setMonitorAction + */ + virtual std::shared_ptr GetSetMonitorAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of parameters. + * + * @return value of model property parameterAction + */ + virtual std::shared_ptr GetParameterAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Populating ambient traffic. + * + * @return value of model property trafficAction + */ + virtual std::shared_ptr GetTrafficAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of variables. + * + * @return value of model property variableAction + */ + virtual std::shared_ptr GetVariableAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property environmentAction is set + * @return true when the property is set + */ + virtual bool IsSetEnvironmentAction() const = 0; + /** + * Retrieves whether property entityAction is set + * @return true when the property is set + */ + virtual bool IsSetEntityAction() const = 0; + /** + * Retrieves whether property infrastructureAction is set + * @return true when the property is set + */ + virtual bool IsSetInfrastructureAction() const = 0; + /** + * Retrieves whether property setMonitorAction is set + * @return true when the property is set + */ + virtual bool IsSetSetMonitorAction() const = 0; + /** + * Retrieves whether property parameterAction is set + * @return true when the property is set + */ + virtual bool IsSetParameterAction() const = 0; + /** + * Retrieves whether property trafficAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficAction() const = 0; + /** + * Retrieves whether property variableAction is set + * @return true when the property is set + */ + virtual bool IsSetVariableAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Histogram which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IHistogram : public virtual IOpenScenarioModelElement + { + public: + virtual ~IHistogram() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines all the available bins in the histogram. Ranges of bins must not overlap. + * + * @return value of model property bins + */ + virtual std::vector> GetBins() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetBinsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetBinsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property bins is set + * @return true when the property is set + */ + virtual bool IsSetBins() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A bin in a histogram. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IHistogramBin : public virtual IOpenScenarioModelElement + { + public: + virtual ~IHistogramBin() = default; + + /** + * From OpenSCENARIO class model specification: + * This is used to define a probability for a value to end up in a specific interval represented by range. Instead of a + * probability a defined count or weight has to be defined. The probability can be calculated by the (1/sum(all weights + * from histogram bins)) * weight. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the range or interval of the bin in a histogram. + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the current position in a given route, either through a position in the lane coordinate system, a position in a + * road coordinate system or through the current position of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInRoutePosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IInRoutePosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The position is defined through the current position of a given entity. + * + * @return value of model property fromCurrentEntity + */ + virtual std::shared_ptr GetFromCurrentEntity() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Route position in road coordinate system. + * + * @return value of model property fromRoadCoordinates + */ + virtual std::shared_ptr GetFromRoadCoordinates() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Route position in lane coordinate system. + * + * @return value of model property fromLaneCoordinates + */ + virtual std::shared_ptr GetFromLaneCoordinates() const + { + return nullptr; + } + + + /** + * Retrieves whether property fromCurrentEntity is set + * @return true when the property is set + */ + virtual bool IsSetFromCurrentEntity() const = 0; + /** + * Retrieves whether property fromRoadCoordinates is set + * @return true when the property is set + */ + virtual bool IsSetFromRoadCoordinates() const = 0; + /** + * Retrieves whether property fromLaneCoordinates is set + * @return true when the property is set + */ + virtual bool IsSetFromLaneCoordinates() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an action which changes a state of a traffic signal or a traffic signal controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInfrastructureAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IInfrastructureAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Set or override a signals state or a signal controllers state from a road network. + * + * @return value of model property trafficSignalAction + */ + virtual std::shared_ptr GetTrafficSignalAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property trafficSignalAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the actions which are executed during the initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInit : public virtual IOpenScenarioModelElement + { + public: + virtual ~IInit() = default; + + /** + * From OpenSCENARIO class model specification: + * A list of actions initially executed when the enclosing storyboard starts. + * + * @return value of model property actions + */ + virtual std::shared_ptr GetActions() const + { + return nullptr; + } + + + /** + * Retrieves whether property actions is set + * @return true when the property is set + */ + virtual bool IsSetActions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A list of action instances (GlobalAction, UserDefinedAction, PrivateAction instances) which are executed during the + * initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInitActions : public virtual IOpenScenarioModelElement + { + public: + virtual ~IInitActions() = default; + + /** + * From OpenSCENARIO class model specification: + * An optional list of global actions. + * + * @return value of model property globalActions + */ + virtual std::vector> GetGlobalActions() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * An optional list of user defined actions. + * + * @return value of model property userDefinedActions + */ + virtual std::vector> GetUserDefinedActions() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * An optional list of private actions. + * + * @return value of model property privates + */ + virtual std::vector> GetPrivates() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetGlobalActionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetGlobalActionsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetUserDefinedActionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetUserDefinedActionsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPrivatesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPrivatesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property globalActions is set + * @return true when the property is set + */ + virtual bool IsSetGlobalActions() const = 0; + /** + * Retrieves whether property userDefinedActions is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedActions() const = 0; + /** + * Retrieves whether property privates is set + * @return true when the property is set + */ + virtual bool IsSetPrivates() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specification of one value of the knot vector of a NURBS trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IKnot : public virtual IOpenScenarioModelElement + { + public: + virtual ~IKnot() = default; + + /** + * From OpenSCENARIO class model specification: + * Knot vector value. Range: ]-inf..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specifies a lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILane : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILane() = default; + + /** + * From OpenSCENARIO class model specification: + * The local ID of the target lane at the specified s coordinate taken from the respective road network definition file. + * + * @return value of model property id + */ + virtual int GetId() const + { + return 0; + } + + + /** + * Retrieves whether property id is set + * @return true when the property is set + */ + virtual bool IsSetId() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the transition between an entity's current lane and its target lane. The target lane may be given + * in absolute or relative terms. The dynamics of the transition may be given either by providing the time or the distance + * required for performing the transition. Time and distance are measured between the start position and the end position + * of the action. The transition starts at the current lane position, including the current lane offset and ends at the + * target lane position, optionally including a targetLaneOffset. If no targetLaneOffset is specified, it shall be zero + * after completing the action, so that any previous offset is not taken into account. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneChangeAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ILaneChangeAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Lane offset to be reached at the target lane; the action will end there. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property targetLaneOffset + */ + virtual double GetTargetLaneOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Shape/time of lane change action. + * + * @return value of model property laneChangeActionDynamics + */ + virtual std::shared_ptr GetLaneChangeActionDynamics() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Target lane of lane change action. + * + * @return value of model property laneChangeTarget + */ + virtual std::shared_ptr GetLaneChangeTarget() const + { + return nullptr; + } + + + /** + * Retrieves whether property targetLaneOffset is set + * @return true when the property is set + */ + virtual bool IsSetTargetLaneOffset() const = 0; + /** + * Retrieves whether property laneChangeActionDynamics is set + * @return true when the property is set + */ + virtual bool IsSetLaneChangeActionDynamics() const = 0; + /** + * Retrieves whether property laneChangeTarget is set + * @return true when the property is set + */ + virtual bool IsSetLaneChangeTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the target lane of the LaneChangeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneChangeTarget : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILaneChangeTarget() = default; + + /** + * From OpenSCENARIO class model specification: + * Lane change direction relative to entity's lane. + * + * @return value of model property relativeTargetLane + */ + virtual std::shared_ptr GetRelativeTargetLane() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Lane change target lane number. + * + * @return value of model property absoluteTargetLane + */ + virtual std::shared_ptr GetAbsoluteTargetLane() const + { + return nullptr; + } + + + /** + * Retrieves whether property relativeTargetLane is set + * @return true when the property is set + */ + virtual bool IsSetRelativeTargetLane() const = 0; + /** + * Retrieves whether property absoluteTargetLane is set + * @return true when the property is set + */ + virtual bool IsSetAbsoluteTargetLane() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the transition to a defined lane offset of an entity. The lane offset will be kept if the action + * is set as continuous. The lane offset may be given in absolute or relative terms. The dynamics are specified by + * providing the maxLateralAcc used to keep the lane offset. Lane offset keeping starts immediately at start of the action + * and ends after the given duration. Different shapes can be used for the initial transition. Step defines an immediate + * transition, i.e. a jump from the current lane offset to the target lane offset. Usage of time and distance does not make + * any sense in combination with step; linear will result in a linear movement between the start and target lane offset; + * cubic and sinusoidal will result in smooth transitions (basically s-shaped) between start and end state. A smooth + * transition is only given with cubic and sinusoidal shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ILaneOffsetAction() = default; + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target lane-offset is reached. If true it does not end but has to be stopped. + * + * @return value of model property continuous + */ + virtual bool GetContinuous() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Parameters defining the dynamics of the LaneOffsetAction. + * + * @return value of model property laneOffsetActionDynamics + */ + virtual std::shared_ptr GetLaneOffsetActionDynamics() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Parameters indicating if the lane offset is defined relative to another entity or absolute to the current lane's center + * line. + * + * @return value of model property laneOffsetTarget + */ + virtual std::shared_ptr GetLaneOffsetTarget() const + { + return nullptr; + } + + + /** + * Retrieves whether property continuous is set + * @return true when the property is set + */ + virtual bool IsSetContinuous() const = 0; + /** + * Retrieves whether property laneOffsetActionDynamics is set + * @return true when the property is set + */ + virtual bool IsSetLaneOffsetActionDynamics() const = 0; + /** + * Retrieves whether property laneOffsetTarget is set + * @return true when the property is set + */ + virtual bool IsSetLaneOffsetTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines shape and lateral acceleration which are used to do the lane offset action. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetActionDynamics : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILaneOffsetActionDynamics() = default; + + /** + * From OpenSCENARIO class model specification: + * Geometrical shape of the LaneOffsetAction's dynamics. + * + * @return value of model property dynamicsShape + */ + virtual DynamicsShape GetDynamicsShape() const + { + return DynamicsShape(); + } + + /** + * From OpenSCENARIO class model specification: + * Maximum lateral acceleration used to initially reach and afterwards keep the lane offset. Missing value is interpreted + * as 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxLateralAcc + */ + virtual double GetMaxLateralAcc() const + { + return 0; + } + + + /** + * Retrieves whether property dynamicsShape is set + * @return true when the property is set + */ + virtual bool IsSetDynamicsShape() const = 0; + /** + * Retrieves whether property maxLateralAcc is set + * @return true when the property is set + */ + virtual bool IsSetMaxLateralAcc() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the target lane offset of the LaneOffsetAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetTarget : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILaneOffsetTarget() = default; + + /** + * From OpenSCENARIO class model specification: + * Relative reference to the lane position of a specific entity. + * + * @return value of model property relativeTargetLaneOffset + */ + virtual std::shared_ptr GetRelativeTargetLaneOffset() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Absolute reference to the current lane's center line. + * + * @return value of model property absoluteTargetLaneOffset + */ + virtual std::shared_ptr GetAbsoluteTargetLaneOffset() const + { + return nullptr; + } + + + /** + * Retrieves whether property relativeTargetLaneOffset is set + * @return true when the property is set + */ + virtual bool IsSetRelativeTargetLaneOffset() const = 0; + /** + * Retrieves whether property absoluteTargetLaneOffset is set + * @return true when the property is set + */ + virtual bool IsSetAbsoluteTargetLaneOffset() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of the road segment (roadId), the lane (laneId) of the road, the distance (s) along the road's + * reference line, and the lateral offset to the lane's center line along the lane center line's t-axis. Orientation is + * optional. +The s-coordinate and the offset should be specified so that the target position is within a road defined by + * roadId taken from the respective road network definition file (external to the ASAM OpenSCENARIO). If the target + * position would be outside the road boundaries, the z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILanePosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILanePosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The ID of the target lane belonging to the target road (taken from the respective road network definition file). + * + * @return value of model property laneId + */ + virtual std::string GetLaneId() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The lateral offset to the center line of the target lane (along the t-axis of the target lane center line). Missing + * value is interpreted as 0. The positive value means the offset is applied in the direction of the t-axis being imagined + * at the target s-position. Unit: [m]. + * + * @return value of model property offset + */ + virtual double GetOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual std::string GetRoadId() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property s + */ + virtual double GetS() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target lane that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the lane s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property laneId is set + * @return true when the property is set + */ + virtual bool IsSetLaneId() const = 0; + /** + * Retrieves whether property offset is set + * @return true when the property is set + */ + virtual bool IsSetOffset() const = 0; + /** + * Retrieves whether property roadId is set + * @return true when the property is set + */ + virtual bool IsSetRoadId() const = 0; + /** + * Retrieves whether property s is set + * @return true when the property is set + */ + virtual bool IsSetS() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls the lateral behavior of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILateralAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILateralAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Action defining a lane change. + * + * @return value of model property laneChangeAction + */ + virtual std::shared_ptr GetLaneChangeAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined lane offset. + * + * @return value of model property laneOffsetAction + */ + virtual std::shared_ptr GetLaneOffsetAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a lateral distance to a referenced entity. + * + * @return value of model property lateralDistanceAction + */ + virtual std::shared_ptr GetLateralDistanceAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property laneChangeAction is set + * @return true when the property is set + */ + virtual bool IsSetLaneChangeAction() const = 0; + /** + * Retrieves whether property laneOffsetAction is set + * @return true when the property is set + */ + virtual bool IsSetLaneOffsetAction() const = 0; + /** + * Retrieves whether property lateralDistanceAction is set + * @return true when the property is set + */ + virtual bool IsSetLateralDistanceAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes a continuously kept lateral distance of an entity with respect to a reference entity. The distance + * can be maintained by using a controller, requiring limiting values for lateral acceleration, lateral deceleration and + * lateral speed. Without this limiting parameters lateral distance is kept rigid. Distance measurement could either be + * calculated from the distance between the entities' reference points or from the free space between the entities' + * bounding boxes. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILateralDistanceAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ILateralDistanceAction() = default; + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target distance is reached. If true it does not end and can only be stopped. + * + * @return value of model property continuous + */ + virtual bool GetContinuous() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If "entity", the coordinate system is interpreted as the actor's local coordinate system. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * The displacement in which the distance or time gap applies. Where omitted, 'any' is assumed. + * + * @return value of model property displacement + */ + virtual LateralDisplacement GetDisplacement() const + { + return LateralDisplacement(); + } + + /** + * From OpenSCENARIO class model specification: + * Lateral distance value. Missing value is interpreted as 0. Unit: [m]. Range: [0..inf[. + * + * @return value of model property distance + */ + virtual double GetDistance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity the lateral distance shall be kept to. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * True: Lateral distance is measured using the distance between closest bounding box points. False: Reference point + * distance is used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if omitted) or limited maxAcceleration/maxDeceleration/maxSpeed to the + * action. + * + * @return value of model property dynamicConstraints + */ + virtual std::shared_ptr GetDynamicConstraints() const + { + return nullptr; + } + + + /** + * Retrieves whether property continuous is set + * @return true when the property is set + */ + virtual bool IsSetContinuous() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property displacement is set + * @return true when the property is set + */ + virtual bool IsSetDisplacement() const = 0; + /** + * Retrieves whether property distance is set + * @return true when the property is set + */ + virtual bool IsSetDistance() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property dynamicConstraints is set + * @return true when the property is set + */ + virtual bool IsSetDynamicConstraints() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Licensing information about the OpenSCENARIO file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILicense : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILicense() = default; + + /** + * From OpenSCENARIO class model specification: + * The full license text. + * + * @return value of model property text + */ + virtual std::string GetText() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The full name of the license. Informational only. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Link to an URL where the full license text can be found. + * + * @return value of model property resource + */ + virtual std::string GetResource() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The identifier of the license from the SPDX + * license list. Can also be an SPDX License Expression, which is also applicable to custom licenses + * (LicenseRef-...). + * + * @return value of model property spdxId + */ + virtual std::string GetSpdxId() const + { + return ""; + } + + + /** + * Retrieves whether property text is set + * @return true when the property is set + */ + virtual bool IsSetText() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property resource is set + * @return true when the property is set + */ + virtual bool IsSetResource() const = 0; + /** + * Retrieves whether property spdxId is set + * @return true when the property is set + */ + virtual bool IsSetSpdxId() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the light state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILightState() = default; + + /** + * From OpenSCENARIO class model specification: + * When mode is set to flashing (e.g. hazard lights of a parking car), this attribute describes the duration of the 'off' + * phase of the flashing. Unit: [s]. Default: 0.5s. + * + * @return value of model property flashingOffDuration + */ + virtual double GetFlashingOffDuration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * When mode is set to flashing (e.g. hazard lights of a parking car), this attribute describes the duration of the 'on' + * phase of the flashing. Unit: [s]. Default: 0.5s. + * + * @return value of model property flashingOnDuration + */ + virtual double GetFlashingOnDuration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Luminous intensity of the light. Unit: [cd]. + * + * @return value of model property luminousIntensity + */ + virtual double GetLuminousIntensity() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Indication if a light should be switched on, off or flashing. + * + * @return value of model property mode + */ + virtual LightMode GetMode() const + { + return LightMode(); + } + + /** + * From OpenSCENARIO class model specification: + * Color of the light. + * + * @return value of model property color + */ + virtual std::shared_ptr GetColor() const + { + return nullptr; + } + + + /** + * Retrieves whether property flashingOffDuration is set + * @return true when the property is set + */ + virtual bool IsSetFlashingOffDuration() const = 0; + /** + * Retrieves whether property flashingOnDuration is set + * @return true when the property is set + */ + virtual bool IsSetFlashingOnDuration() const = 0; + /** + * Retrieves whether property luminousIntensity is set + * @return true when the property is set + */ + virtual bool IsSetLuminousIntensity() const = 0; + /** + * Retrieves whether property mode is set + * @return true when the property is set + */ + virtual bool IsSetMode() const = 0; + /** + * Retrieves whether property color is set + * @return true when the property is set + */ + virtual bool IsSetColor() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the transition of a current light state to the target light state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightStateAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILightStateAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Time to transition from current lightState to given new lightState (default: transitionTime = 0). Unit: [s]. + * + * @return value of model property transitionTime + */ + virtual double GetTransitionTime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to a certain light of a entity that will be addressed in this LightStateAction. + * + * @return value of model property lightType + */ + virtual std::shared_ptr GetLightType() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * LightState after execution of the LightStateAction. + * + * @return value of model property lightState + */ + virtual std::shared_ptr GetLightState() const + { + return nullptr; + } + + + /** + * Retrieves whether property transitionTime is set + * @return true when the property is set + */ + virtual bool IsSetTransitionTime() const = 0; + /** + * Retrieves whether property lightType is set + * @return true when the property is set + */ + virtual bool IsSetLightType() const = 0; + /** + * Retrieves whether property lightState is set + * @return true when the property is set + */ + virtual bool IsSetLightState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of light types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightType : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILightType() = default; + + /** + * From OpenSCENARIO class model specification: + * Available lights attached to a vehicle. + * + * @return value of model property vehicleLight + */ + virtual std::shared_ptr GetVehicleLight() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Light type cannot be handled be the above options and is therefore user defined. + * + * @return value of model property userDefinedLight + */ + virtual std::shared_ptr GetUserDefinedLight() const + { + return nullptr; + } + + + /** + * Retrieves whether property vehicleLight is set + * @return true when the property is set + */ + virtual bool IsSetVehicleLight() const = 0; + /** + * Retrieves whether property userDefinedLight is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedLight() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a log normal distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILogNormalDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILogNormalDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value (mean) for a log normal distribution. Range: ]-inf; inf[ + * + * @return value of model property expectedValue + */ + virtual double GetExpectedValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the variance for a log normal distribution (square of standard deviation). Range: ]0; inf[ + * + * @return value of model property variance + */ + virtual double GetVariance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the log normal distribution regarding the definition space. Lower limit must be > 0. Assumed + * range if omitted: ]0; inf[ + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property expectedValue is set + * @return true when the property is set + */ + virtual bool IsSetExpectedValue() const = 0; + /** + * Retrieves whether property variance is set + * @return true when the property is set + */ + virtual bool IsSetVariance() const = 0; + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls the longitudinal behavior of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILongitudinalAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ILongitudinalAction() = default; + + /** + * From OpenSCENARIO class model specification: + * This action describes the transition between the current speed of an entity and its target speed. + * + * @return value of model property speedAction + */ + virtual std::shared_ptr GetSpeedAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined longitudinal distance to a referenced entity. + * + * @return value of model property longitudinalDistanceAction + */ + virtual std::shared_ptr GetLongitudinalDistanceAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This action describes the change of speed in terms of a series of speed targets over time. + * + * @return value of model property speedProfileAction + */ + virtual std::shared_ptr GetSpeedProfileAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property speedAction is set + * @return true when the property is set + */ + virtual bool IsSetSpeedAction() const = 0; + /** + * Retrieves whether property longitudinalDistanceAction is set + * @return true when the property is set + */ + virtual bool IsSetLongitudinalDistanceAction() const = 0; + /** + * Retrieves whether property speedProfileAction is set + * @return true when the property is set + */ + virtual bool IsSetSpeedProfileAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action activates a controller for the longitudinal behavior of an entity in a way that a given distance or time gap + * to the reference entity is maintained. +The target position may be either on the same road segment where the reference + * entity is positioned or on a connecting road. In the latter case for coordinate systems lane and road, the distance or + * time gap is calculated along the road reference line / lane centerline of the connecting road. It is assumed that the + * reference line of the road / lane centerline of the reference entity continues seamlessly on the connecting road (even + * if its shape changes). It is assumed that the target position relates to the routing of the reference entity. Otherwise, + * the calculation of the target position cannot be interpreted within the OpenSCENARIO standard. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILongitudinalDistanceAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ILongitudinalDistanceAction() = default; + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target distance is reached. If true it does not end and can only be stopped. + * + * @return value of model property continuous + */ + virtual bool GetContinuous() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If "entity", the coordinate system is interpreted as the actor's local coordinate system. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * The displacement in which the distance or time gap applies. Where omitted, 'trailingReferencedEntity' is assumed. + * + * @return value of model property displacement + */ + virtual LongitudinalDisplacement GetDisplacement() const + { + return LongitudinalDisplacement(); + } + + /** + * From OpenSCENARIO class model specification: + * Distance value, not to be used together with timeGap attribute. Unit: [m]. Range: [0..inf[. + * + * @return value of model property distance + */ + virtual double GetDistance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity the distance shall be kept to. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * True: Distance is measured using the distance between closest bounding box points False: Reference point distance is + * used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Time gap value, not to be used together with distance attribute. Unit: [s]. Range: [0..inf[. + * + * @return value of model property timeGap + */ + virtual double GetTimeGap() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if ommitted) or limited maxAcceleration/maxDeceleration/maxSpeed to + * the action. + * + * @return value of model property dynamicConstraints + */ + virtual std::shared_ptr GetDynamicConstraints() const + { + return nullptr; + } + + + /** + * Retrieves whether property continuous is set + * @return true when the property is set + */ + virtual bool IsSetContinuous() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property displacement is set + * @return true when the property is set + */ + virtual bool IsSetDisplacement() const = 0; + /** + * Retrieves whether property distance is set + * @return true when the property is set + */ + virtual bool IsSetDistance() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property timeGap is set + * @return true when the property is set + */ + virtual bool IsSetTimeGap() const = 0; + /** + * Retrieves whether property dynamicConstraints is set + * @return true when the property is set + */ + virtual bool IsSetDynamicConstraints() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A container for Events. Can be stored in a maneuver catalog. Allows declaration of parameters within its scope. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuver : public virtual IOpenScenarioModelElement, public IStoryboardElement, public ICatalogElement + { + public: + virtual ~IManeuver() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the maneuver. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * List of events that are comprised by the maneuver. + * + * @return value of model property events + */ + virtual std::vector> GetEvents() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEventsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEventsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property events is set + * @return true when the property is set + */ + virtual bool IsSetEvents() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up maneuver catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuverCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IManeuverCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Grouping element connecting a set of actors to a set maneuvers. Multiple maneuver groups can run independently in + * parallel. Maneuvers can be defined or instantiated from a maneuver type in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuverGroup : public virtual IOpenScenarioModelElement, public IStoryboardElement + { + public: + virtual ~IManeuverGroup() = default; + + /** + * From OpenSCENARIO class model specification: + * Number of allowed executions of the maneuver group. Default value is 1. Range: [1..inf[. + * + * @return value of model property maximumExecutionCount + */ + virtual uint32_t GetMaximumExecutionCount() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the maneuver group. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Actors of the maneuver group. + * + * @return value of model property actors + */ + virtual std::shared_ptr GetActors() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Each element of this list of must reference a maneuver type in a catalog. + * + * @return value of model property catalogReferences + */ + virtual std::vector> GetCatalogReferences() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Maneuver type definitions. + * + * @return value of model property maneuvers + */ + virtual std::vector> GetManeuvers() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetCatalogReferencesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetCatalogReferencesAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetManeuversSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetManeuversAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property maximumExecutionCount is set + * @return true when the property is set + */ + virtual bool IsSetMaximumExecutionCount() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property actors is set + * @return true when the property is set + */ + virtual bool IsSetActors() const = 0; + /** + * Retrieves whether property catalogReferences is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReferences() const = 0; + /** + * Retrieves whether property maneuvers is set + * @return true when the property is set + */ + virtual bool IsSetManeuvers() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Manual gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManualGear : public virtual IOpenScenarioModelElement + { + public: + virtual ~IManualGear() = default; + + /** + * From OpenSCENARIO class model specification: + * Gear number. Negative values are indicating reverse gears. Zero is neutral gear. + * + * @return value of model property number + */ + virtual int GetNumber() const + { + return 0; + } + + + /** + * Retrieves whether property number is set + * @return true when the property is set + */ + virtual bool IsSetNumber() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a miscellaneous object type. A miscellaneous object has no controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMiscObject : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IMiscObject() = default; + + /** + * From OpenSCENARIO class model specification: + * Mass of the miscellaneous object. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual double GetMass() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Categorization of the miscellaneous object. + * + * @return value of model property miscObjectCategory + */ + virtual MiscObjectCategory GetMiscObjectCategory() const + { + return MiscObjectCategory(); + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the miscellaneous object as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual std::string GetModel3d() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the miscellaneous object type. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Bounding box definition for the miscellaneous object. + * + * @return value of model property boundingBox + */ + virtual std::shared_ptr GetBoundingBox() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Properties of the miscellaneous object. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property mass is set + * @return true when the property is set + */ + virtual bool IsSetMass() const = 0; + /** + * Retrieves whether property miscObjectCategory is set + * @return true when the property is set + */ + virtual bool IsSetMiscObjectCategory() const = 0; + /** + * Retrieves whether property model3d is set + * @return true when the property is set + */ + virtual bool IsSetModel3d() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property boundingBox is set + * @return true when the property is set + */ + virtual bool IsSetBoundingBox() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up miscellaneous object catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMiscObjectCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IMiscObjectCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Enclosing type for either adding a value to a parameter or multiply the parameter by a value. Has to be match the + * parameter type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IModifyRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IModifyRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Adding a value to a parameter. + * + * @return value of model property addValue + */ + virtual std::shared_ptr GetAddValue() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Multiply a parameter by a value. + * + * @return value of model property multiplyByValue + */ + virtual std::shared_ptr GetMultiplyByValue() const + { + return nullptr; + } + + + /** + * Retrieves whether property addValue is set + * @return true when the property is set + */ + virtual bool IsSetAddValue() const = 0; + /** + * Retrieves whether property multiplyByValue is set + * @return true when the property is set + */ + virtual bool IsSetMultiplyByValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Declaration of a monitor that keeps track of the scenario execution. Monitors are of type Boolean and can be initialized + * as true or false and set during the scenario execution using the SetMonitorAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMonitorDeclaration : public virtual IOpenScenarioModelElement + { + public: + virtual ~IMonitorDeclaration() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the monitor. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Initialisation value of the monitor. + * + * @return value of model property value + */ + virtual bool GetValue() const + { + return false; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Empty container, indicating unused controlling behavior or dynamics limitations for specific axis. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INone : public virtual IOpenScenarioModelElement + { + public: + virtual ~INone() = default; + + + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Normal distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INormalDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~INormalDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value (mean) for a normal distribution. + * + * @return value of model property expectedValue + */ + virtual double GetExpectedValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the variance for a normal distribution.(Square of standard deviation). + * + * @return value of model property variance + */ + virtual double GetVariance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the normal distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property expectedValue is set + * @return true when the property is set + */ + virtual bool IsSetExpectedValue() const = 0; + /** + * Retrieves whether property variance is set + * @return true when the property is set + */ + virtual bool IsSetVariance() const = 0; + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Non-uniform rational b-spline (NURBS) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INurbs : public virtual IOpenScenarioModelElement + { + public: + virtual ~INurbs() = default; + + /** + * From OpenSCENARIO class model specification: + * Order of the NURBS trajectory. This is the order of the curve, not the degree of the polynomials, which will be one less + * than the order of the curve. Range: [2..inf[. + * + * @return value of model property order + */ + virtual uint32_t GetOrder() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Control point vector of the NURBS trajectory. The number of control points must be greater or equal to the order of the + * curve. It's an ordered list, therefore the first control point determines the start of the trajectory and the last + * control point determines the end of the trajectory. + * + * @return value of model property controlPoints + */ + virtual std::vector> GetControlPoints() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Knot vector of the NURBS trajectory. Knot values must be given in ascending order. The number of knot vector values must + * be equal to the number of control points plus the order of the curve. + * + * @return value of model property knots + */ + virtual std::vector> GetKnots() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetControlPointsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetControlPointsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetKnotsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetKnotsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property order is set + * @return true when the property is set + */ + virtual bool IsSetOrder() const = 0; + /** + * Retrieves whether property controlPoints is set + * @return true when the property is set + */ + virtual bool IsSetControlPoints() const = 0; + /** + * Retrieves whether property knots is set + * @return true when the property is set + */ + virtual bool IsSetKnots() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a controller for a scenario object. Either an inline definition or a catalog reference to a controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IObjectController : public virtual IOpenScenarioModelElement + { + public: + virtual ~IObjectController() = default; + + /** + * From OpenSCENARIO class model specification: + * Identifier of the ObjectController. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Catalog reference to a controller. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Controller type definition. + * + * @return value of model property controller + */ + virtual std::shared_ptr GetController() const + { + return nullptr; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + /** + * Retrieves whether property controller is set + * @return true when the property is set + */ + virtual bool IsSetController() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Checks if an entity is of the road. The logical expression returns true after the entity has been offroad for a specific + * duration. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOffroadCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOffroadCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Amount of time of driving offroad. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual double GetDuration() const + { + return 0; + } + + + /** + * Retrieves whether property duration is set + * @return true when the property is set + */ + virtual bool IsSetDuration() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Top level container for scenarios or catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOpenScenario : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOpenScenario() = default; + + /** + * From OpenSCENARIO class model specification: + * Header information for the scenario or the catalog. + * + * @return value of model property fileHeader + */ + virtual std::shared_ptr GetFileHeader() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Category (catalog or scenario) of the OpenSCENARIO description. + * + * @return value of model property openScenarioCategory + */ + virtual std::shared_ptr GetOpenScenarioCategory() const + { + return nullptr; + } + + + /** + * Retrieves whether property fileHeader is set + * @return true when the property is set + */ + virtual bool IsSetFileHeader() const = 0; + /** + * Retrieves whether property openScenarioCategory is set + * @return true when the property is set + */ + virtual bool IsSetOpenScenarioCategory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates if the following content defines a scenario or a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOpenScenarioCategory : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOpenScenarioCategory() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of a scenario. + * + * @return value of model property scenarioDefinition + */ + virtual std::shared_ptr GetScenarioDefinition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return value of model property catalogDefinition + */ + virtual std::shared_ptr GetCatalogDefinition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return value of model property parameterValueDistributionDefinition + */ + virtual std::shared_ptr GetParameterValueDistributionDefinition() const + { + return nullptr; + } + + + /** + * Retrieves whether property scenarioDefinition is set + * @return true when the property is set + */ + virtual bool IsSetScenarioDefinition() const = 0; + /** + * Retrieves whether property catalogDefinition is set + * @return true when the property is set + */ + virtual bool IsSetCatalogDefinition() const = 0; + /** + * Retrieves whether property parameterValueDistributionDefinition is set + * @return true when the property is set + */ + virtual bool IsSetParameterValueDistributionDefinition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Orientation is defined in terms of the Heading/Pitch/Roll orientation angles in the Cartesian coordinate system and + * considered in the absolute or relative reference context. +The absolute reference context refers to the orientation with + * respect to the World coordinate system. +If more than one orientation angle are specified at the same time, rotations are + * applied in the order: about Z-axis (Heading), then Y-axis (Pitch), then X-axis (Roll), assumed the positive rotation to + * be counter-clockwise. Heading=Pitch=Roll=0 means the orientation is aligned with coordinate axes (no rotation). +The + * relative reference context refers to the orientation with respect to a reference coordinate system. In the case of + * referencing to the road- or lane coordinate system, Pitch and Roll angles are determined by a surface tilt of an + * underlying road and therefore cannot be meaningfully interpreted within the OpenSCENARIO standard. As well, the + * Heading=0 means the Heading is aligned with the direction of the reference lane or road s-axis. In other cases, + * Heading=Pitch=Roll=0 means the orientation is identical to the reference orientation. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOrientation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOrientation() = default; + + /** + * From OpenSCENARIO class model specification: + * Heading angle. Missing h value is interpreted as 0. Unit: [rad]. + * + * @return value of model property h + */ + virtual double GetH() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Pitch angle. Missing p value is interpreted as 0. Unit: [rad]. + * + * @return value of model property p + */ + virtual double GetP() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Roll angle. Missing r value is interpreted as 0. Unit: [rad]. + * + * @return value of model property r + */ + virtual double GetR() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative or absolute definition. Missing type value is interpreted as relative. + * + * @return value of model property type + */ + virtual ReferenceContext GetType() const + { + return ReferenceContext(); + } + + + /** + * Retrieves whether property h is set + * @return true when the property is set + */ + virtual bool IsSetH() const = 0; + /** + * Retrieves whether property p is set + * @return true when the property is set + */ + virtual bool IsSetP() const = 0; + /** + * Retrieves whether property r is set + * @return true when the property is set + */ + virtual bool IsSetR() const = 0; + /** + * Retrieves whether property type is set + * @return true when the property is set + */ + virtual bool IsSetType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the brake of a vehicle, when overriding a brake value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideBrakeAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideBrakeAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Brake pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the brake pedal. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Input for the brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return value of model property brakeInput + */ + virtual std::shared_ptr GetBrakeInput() const + { + return nullptr; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property brakeInput is set + * @return true when the property is set + */ + virtual bool IsSetBrakeInput() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the clutch of a vehicle, when overriding a clutch value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideClutchAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideClutchAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new clutch position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual double GetMaxRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Clutch pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the clutch pedal. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property maxRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxRate() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Overrides entity controller values. Mostly suited for motor vehicles. +It is assumed that a respective user-defined + * Controller is assigned to the entity, defined in the "movement" domain, and activated. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideControllerValueAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideControllerValueAction() = default; + + /** + * From OpenSCENARIO class model specification: + * New value for throttle pedal position or unset value. + * + * @return value of model property throttle + */ + virtual std::shared_ptr GetThrottle() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * New value for brake position or unset value. + * + * @return value of model property brake + */ + virtual std::shared_ptr GetBrake() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * New value for clutch position or unset value. + * + * @return value of model property clutch + */ + virtual std::shared_ptr GetClutch() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * New value for parking brake position or unset value. + * + * @return value of model property parkingBrake + */ + virtual std::shared_ptr GetParkingBrake() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * New value for steering wheel position or unset value. + * + * @return value of model property steeringWheel + */ + virtual std::shared_ptr GetSteeringWheel() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * New value for gear position or unset value. + * + * @return value of model property gear + */ + virtual std::shared_ptr GetGear() const + { + return nullptr; + } + + + /** + * Retrieves whether property throttle is set + * @return true when the property is set + */ + virtual bool IsSetThrottle() const = 0; + /** + * Retrieves whether property brake is set + * @return true when the property is set + */ + virtual bool IsSetBrake() const = 0; + /** + * Retrieves whether property clutch is set + * @return true when the property is set + */ + virtual bool IsSetClutch() const = 0; + /** + * Retrieves whether property parkingBrake is set + * @return true when the property is set + */ + virtual bool IsSetParkingBrake() const = 0; + /** + * Retrieves whether property steeringWheel is set + * @return true when the property is set + */ + virtual bool IsSetSteeringWheel() const = 0; + /** + * Retrieves whether property gear is set + * @return true when the property is set + */ + virtual bool IsSetGear() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the gear of a vehicle, when overriding a gear value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideGearAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideGearAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Gear number. + * + * @return value of model property number + */ + virtual double GetNumber() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Gear description. + * + * @return value of model property gear + */ + virtual std::shared_ptr GetGear() const + { + return nullptr; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property number is set + * @return true when the property is set + */ + virtual bool IsSetNumber() const = 0; + /** + * Retrieves whether property gear is set + * @return true when the property is set + */ + virtual bool IsSetGear() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the parking brake of a vehicle, when overriding a parking brake value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideParkingBrakeAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideParkingBrakeAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Parking brake value. Unit: [%]. Range: [0..1]. The value 1 represent the maximum parking brake state. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Input for the parking brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return value of model property brakeInput + */ + virtual std::shared_ptr GetBrakeInput() const + { + return nullptr; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property brakeInput is set + * @return true when the property is set + */ + virtual bool IsSetBrakeInput() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the steering wheel of a vehicle, when overriding a steering wheel angle in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideSteeringWheelAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideSteeringWheelAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new steering wheel position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual double GetMaxRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The maximum torque that can be applied to acquire/keep an angle. Unit: [Nm]. + * + * @return value of model property maxTorque + */ + virtual double GetMaxTorque() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Steering wheel angle. Unit: [rad]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property maxRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxRate() const = 0; + /** + * Retrieves whether property maxTorque is set + * @return true when the property is set + */ + virtual bool IsSetMaxTorque() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the state of the throttle of a vehicle, when overriding a throttle value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideThrottleAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IOverrideThrottleAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual bool GetActive() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new throttle position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual double GetMaxRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Throttle pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the throttle pedal. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property active is set + * @return true when the property is set + */ + virtual bool IsSetActive() const = 0; + /** + * Retrieves whether property maxRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxRate() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Set or modify a named parameter. (Be aware of the data type). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter. + * + * @return value of model property parameterRef + */ + virtual std::shared_ptr> GetParameterRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * New value for the parameter. + * + * @return value of model property setAction + */ + virtual std::shared_ptr GetSetAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the parameter (Add value or multiply by value). + * + * @return value of model property modifyAction + */ + virtual std::shared_ptr GetModifyAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property parameterRef is set + * @return true when the property is set + */ + virtual bool IsSetParameterRef() const = 0; + /** + * Retrieves whether property setAction is set + * @return true when the property is set + */ + virtual bool IsSetSetAction() const = 0; + /** + * Retrieves whether property modifyAction is set + * @return true when the property is set + */ + virtual bool IsSetModifyAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an addition of a value to a parameter as part of a ModifyRule. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterAddValueRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterAddValueRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Add value to existing parameter. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Assignment of a value to a named parameter. It is either used when importing types of vehicles, controllers etc. from a + * catalog during startup of a simulator. It is also used when generating concrete scenarios from logical scenarios with + * ParameterValueSets during runtime of a scenario generator. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterAssignment : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterAssignment() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter that must be declared in the catalog (when used in CatalogReference) or in the global + * ParameterDeclaration of the scenario (when used in ParameterValueSet). + * + * @return value of model property parameterRef + */ + virtual std::shared_ptr> GetParameterRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter that is handed over to the parametrizable type. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property parameterRef is set + * @return true when the property is set + */ + virtual bool IsSetParameterRef() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Compares a named parameter's value to a reference value. The logical operator used for comparison is defined by the rule + * attribute Less and greater operator will only be supported if the value given as string can unambiguously be converted + * into a scalar value (e.g. value=5, value=16.667). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter that must be defined. + * + * @return value of model property parameterRef + */ + virtual std::shared_ptr> GetParameterRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property parameterRef is set + * @return true when the property is set + */ + virtual bool IsSetParameterRef() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Declaration of a typed parameter with a name and a default value. It is used for creating variations of the same + * scenario by using the ParameterValueDistributionDefinition in an additional file. +There are two options for applying + * ParameterValueDistributions: + +* Pre-startup: Copy the scenario file and change/override the default value +* On startup: + * Keep the scenario file but on startup of the OSC Director inject parameter values e.g. through the command line. + +The + * value of a parameter cannot change after startup during runtime. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterDeclaration : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterDeclaration() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Type of the parameter. + * + * @return value of model property parameterType + */ + virtual ParameterType GetParameterType() const + { + return ParameterType(); + } + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter as its default value. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Defines zero or more constraint groups to the parameter value. Multiple constraint groups are combined by an OR. That + * means at least one constraint group has to evaluate to true to get the simulation started. If none of the constraint + * groups is satisfied the scenario should not be evaluated. + * + * @return value of model property constraintGroups + */ + virtual std::vector> GetConstraintGroups() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetConstraintGroupsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetConstraintGroupsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterType is set + * @return true when the property is set + */ + virtual bool IsSetParameterType() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property constraintGroups is set + * @return true when the property is set + */ + virtual bool IsSetConstraintGroups() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Modify a global parameter according to given rules. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterModifyAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterModifyAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a parameter or multiply a parameter by a value. Has to match the parameter type. + * + * @return value of model property rule + */ + virtual std::shared_ptr GetRule() const + { + return nullptr; + } + + + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Multiply a parameter by a value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterMultiplyByValueRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterMultiplyByValueRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Multiply existing parameter by the value (be aware of the parameter data type). + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Setting a parameter to a given value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterSetAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterSetAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The new value for the parameter. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The ParameterValueDistribution represents the top level container of a parameter distribution file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterValueDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the scenario file which shall be linked to the parameter distribution file. + * + * @return value of model property scenarioFile + */ + virtual std::shared_ptr GetScenarioFile() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines distributions of the parameter which can be deterministic or stochastic + * + * @return value of model property distributionDefinition + */ + virtual std::shared_ptr GetDistributionDefinition() const + { + return nullptr; + } + + + /** + * Retrieves whether property scenarioFile is set + * @return true when the property is set + */ + virtual bool IsSetScenarioFile() const = 0; + /** + * Retrieves whether property distributionDefinition is set + * @return true when the property is set + */ + virtual bool IsSetDistributionDefinition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A marker stating that the OpenSCENARIO file is a parameter value distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueDistributionDefinition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterValueDistributionDefinition() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return value of model property parameterValueDistribution + */ + virtual std::shared_ptr GetParameterValueDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property parameterValueDistribution is set + * @return true when the property is set + */ + virtual bool IsSetParameterValueDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Set of parameter values that have to be assigned for a single concrete scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueSet : public virtual IOpenScenarioModelElement + { + public: + virtual ~IParameterValueSet() = default; + + /** + * From OpenSCENARIO class model specification: + * Assignment of a value to a named parameter. + * + * @return value of model property parameterAssignments + */ + virtual std::vector> GetParameterAssignments() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterAssignmentsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterAssignmentsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property parameterAssignments is set + * @return true when the property is set + */ + virtual bool IsSetParameterAssignments() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a pedestrian type in a scenario or in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrian : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IPedestrian() = default; + + /** + * From OpenSCENARIO class model specification: + * The mass of a pedestrian. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual double GetMass() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the pedestrian. + * + * @return value of model property model + */ + virtual std::string GetModel() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the pedestrian as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual std::string GetModel3d() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the pedestrian type. Required when used in catalog. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Category type of pedestrian. + * + * @return value of model property pedestrianCategory + */ + virtual PedestrianCategory GetPedestrianCategory() const + { + return PedestrianCategory(); + } + + /** + * From OpenSCENARIO class model specification: + * Role of the pedestrian (police, civil,...). The default pedestrian role if not specified is None. + * + * @return value of model property role + */ + virtual Role GetRole() const + { + return Role(); + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Bounding box of the pedestrian. + * + * @return value of model property boundingBox + */ + virtual std::shared_ptr GetBoundingBox() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Properties of the pedestrian. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property mass is set + * @return true when the property is set + */ + virtual bool IsSetMass() const = 0; + /** + * Retrieves whether property model is set + * @return true when the property is set + */ + virtual bool IsSetModel() const = 0; + /** + * Retrieves whether property model3d is set + * @return true when the property is set + */ + virtual bool IsSetModel3d() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property pedestrianCategory is set + * @return true when the property is set + */ + virtual bool IsSetPedestrianCategory() const = 0; + /** + * Retrieves whether property role is set + * @return true when the property is set + */ + virtual bool IsSetRole() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property boundingBox is set + * @return true when the property is set + */ + virtual bool IsSetBoundingBox() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a pedestrian's motion and gestures. A motion will override a currently active motion. A conflicting gesture will + * override currently active gestures. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianAnimation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPedestrianAnimation() = default; + + /** + * From OpenSCENARIO class model specification: + * Motion of a pedestrian. + * + * @return value of model property motion + */ + virtual PedestrianMotionType GetMotion() const + { + return PedestrianMotionType(); + } + + /** + * From OpenSCENARIO class model specification: + * User defined pedestrian animation. + * + * @return value of model property userDefinedPedestrianAnimation + */ + virtual std::string GetUserDefinedPedestrianAnimation() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Gestures of a pedestrian. + * + * @return value of model property gestures + */ + virtual std::vector> GetGestures() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetGesturesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetGesturesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property motion is set + * @return true when the property is set + */ + virtual bool IsSetMotion() const = 0; + /** + * Retrieves whether property userDefinedPedestrianAnimation is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedPedestrianAnimation() const = 0; + /** + * Retrieves whether property gestures is set + * @return true when the property is set + */ + virtual bool IsSetGestures() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up pedestrian catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPedestrianCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * File path for the pedestrian catalog files. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a pedestrian's gesture. A conflicting gesture will override currently active gestures. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianGesture : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPedestrianGesture() = default; + + /** + * From OpenSCENARIO class model specification: + * Specific gesture of a pedestrian. + * + * @return value of model property gesture + */ + virtual PedestrianGestureType GetGesture() const + { + return PedestrianGestureType(); + } + + + /** + * Retrieves whether property gesture is set + * @return true when the property is set + */ + virtual bool IsSetGesture() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for Performance values of a vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPerformance : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPerformance() = default; + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration of the vehicle. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxAcceleration + */ + virtual double GetMaxAcceleration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration rate of the vehicle. Unit: [m/s³]. Range: [0..inf[. If omitted then infinity is assumed. + * + * @return value of model property maxAccelerationRate + */ + virtual double GetMaxAccelerationRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration of the vehicle. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxDeceleration + */ + virtual double GetMaxDeceleration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration rate of the vehicle. Unit: [m/s³]. Range: [0..inf[. If omitted then infinity is assumed. + * + * @return value of model property maxDecelerationRate + */ + virtual double GetMaxDecelerationRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Maximum speed of the vehicle. Unit: [m/s]. + * + * @return value of model property maxSpeed + */ + virtual double GetMaxSpeed() const + { + return 0; + } + + + /** + * Retrieves whether property maxAcceleration is set + * @return true when the property is set + */ + virtual bool IsSetMaxAcceleration() const = 0; + /** + * Retrieves whether property maxAccelerationRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxAccelerationRate() const = 0; + /** + * Retrieves whether property maxDeceleration is set + * @return true when the property is set + */ + virtual bool IsSetMaxDeceleration() const = 0; + /** + * Retrieves whether property maxDecelerationRate is set + * @return true when the property is set + */ + virtual bool IsSetMaxDecelerationRate() const = 0; + /** + * Retrieves whether property maxSpeed is set + * @return true when the property is set + */ + virtual bool IsSetMaxSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Phase of a TrafficSignalController. A TrafficSignalController has sequential semantic phases, forming the signal cycle. + * Each semantic phase can have multiple TrafficSignalStates or one TrafficSignalGroupState (mutually exclusive). When + * TrafficSignalStates are used to model the observable states of a traffic signal individually, exactly one + * TrafficSignalState has to be defined for every traffic signal controlled by this TrafficSignalController. The semantic + * phase information like go, attention, stop, etc. is set in Phase attribute name and the observable state like the visual + * information "off;off;on" in trafficSignalStates or trafficSignalGroupState. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPhase : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPhase() = default; + + /** + * From OpenSCENARIO class model specification: + * Duration of the phase. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual double GetDuration() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Semantic information about the phase. Typical values are: off, stop, attention, stop_attention, go, go_exclusive + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Each phase can have multiple TrafficSignalStates to provide the observable state for all traffic signals individually + * that are controlled by the controller. One for each TrafficSignal. E.g. name="go" (trafficSignal1:"off;off;on", + * trafficSignal2:"off;off;on"). + * + * @return value of model property trafficSignalStates + */ + virtual std::vector> GetTrafficSignalStates() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Each phase can have one TrafficSignalGroupState to provide the observable state for all traffic signals that are + * controlled by the controller if they share the same state. E.g. name="go" ("off;off;on"). + * + * @return value of model property trafficSignalGroupState + */ + virtual std::shared_ptr GetTrafficSignalGroupState() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetTrafficSignalStatesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetTrafficSignalStatesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property duration is set + * @return true when the property is set + */ + virtual bool IsSetDuration() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property trafficSignalStates is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalStates() const = 0; + /** + * Retrieves whether property trafficSignalGroupState is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalGroupState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Poisson distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPoissonDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPoissonDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value for a poisson distribution. + * + * @return value of model property expectedValue + */ + virtual double GetExpectedValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and the upper limit of the poisson distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property expectedValue is set + * @return true when the property is set + */ + virtual bool IsSetExpectedValue() const = 0; + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an area by a polygon. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPolygon : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPolygon() = default; + + /** + * From OpenSCENARIO class model specification: + * A minimum of 3 positions must be provided to form a polygon. + * + * @return value of model property positions + */ + virtual std::vector> GetPositions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPositionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPositionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property positions is set + * @return true when the property is set + */ + virtual bool IsSetPositions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Polygonal chain (polyline) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPolyline : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPolyline() = default; + + /** + * From OpenSCENARIO class model specification: + * Ordered chain of vertices of the polygonal chain. + * + * @return value of model property vertices + */ + virtual std::vector> GetVertices() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetVerticesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetVerticesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property vertices is set + * @return true when the property is set + */ + virtual bool IsSetVertices() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for position types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Position that uses global coordinates. + * + * @return value of model property worldPosition + */ + virtual std::shared_ptr GetWorldPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity, expressed in world coordinates. + * + * @return value of model property relativeWorldPosition + */ + virtual std::shared_ptr GetRelativeWorldPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity. + * + * @return value of model property relativeObjectPosition + */ + virtual std::shared_ptr GetRelativeObjectPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position in road coordinates (t,s) applied to a given road. + * + * @return value of model property roadPosition + */ + virtual std::shared_ptr GetRoadPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position relative to an entity's road position (ds, dt). + * + * @return value of model property relativeRoadPosition + */ + virtual std::shared_ptr GetRelativeRoadPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a lane (lane ID) and the s coordinate of a given road. + * + * @return value of model property lanePosition + */ + virtual std::shared_ptr GetLanePosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position that is determined relative to the lane coordinates of a given entity. (Relative lane and relative s to this + * entity). + * + * @return value of model property relativeLanePosition + */ + virtual std::shared_ptr GetRelativeLanePosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given route. + * + * @return value of model property routePosition + */ + virtual std::shared_ptr GetRoutePosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position that uses geo coordinates + * + * @return value of model property geoPosition + */ + virtual std::shared_ptr GetGeoPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given trajectory. + * + * @return value of model property trajectoryPosition + */ + virtual std::shared_ptr GetTrajectoryPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property worldPosition is set + * @return true when the property is set + */ + virtual bool IsSetWorldPosition() const = 0; + /** + * Retrieves whether property relativeWorldPosition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeWorldPosition() const = 0; + /** + * Retrieves whether property relativeObjectPosition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeObjectPosition() const = 0; + /** + * Retrieves whether property roadPosition is set + * @return true when the property is set + */ + virtual bool IsSetRoadPosition() const = 0; + /** + * Retrieves whether property relativeRoadPosition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeRoadPosition() const = 0; + /** + * Retrieves whether property lanePosition is set + * @return true when the property is set + */ + virtual bool IsSetLanePosition() const = 0; + /** + * Retrieves whether property relativeLanePosition is set + * @return true when the property is set + */ + virtual bool IsSetRelativeLanePosition() const = 0; + /** + * Retrieves whether property routePosition is set + * @return true when the property is set + */ + virtual bool IsSetRoutePosition() const = 0; + /** + * Retrieves whether property geoPosition is set + * @return true when the property is set + */ + virtual bool IsSetGeoPosition() const = 0; + /** + * Retrieves whether property trajectoryPosition is set + * @return true when the property is set + */ + virtual bool IsSetTrajectoryPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a coordinate along a lane with a given s coordinate and lane ID. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionInLaneCoordinates : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPositionInLaneCoordinates() = default; + + /** + * From OpenSCENARIO class model specification: + * Lane ID of the actual position. + * + * @return value of model property laneId + */ + virtual std::string GetLaneId() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Lateral offset (relative to the lane centerline) of the actual position. If omitted, the lane offset is interpreted as + * 0. Unit: [m]. + * + * @return value of model property laneOffset + */ + virtual double GetLaneOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Position in s coordinates along the reference line of the route. Unit: [m]. Range: [0..inf[. + * + * @return value of model property pathS + */ + virtual double GetPathS() const + { + return 0; + } + + + /** + * Retrieves whether property laneId is set + * @return true when the property is set + */ + virtual bool IsSetLaneId() const = 0; + /** + * Retrieves whether property laneOffset is set + * @return true when the property is set + */ + virtual bool IsSetLaneOffset() const = 0; + /** + * Retrieves whether property pathS is set + * @return true when the property is set + */ + virtual bool IsSetPathS() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of distance along a route (pathS) and lateral offset from the route's reference line (t) at + * that point. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionInRoadCoordinates : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPositionInRoadCoordinates() = default; + + /** + * From OpenSCENARIO class model specification: + * Position in s coordinates along the reference line of the route. + * + * @return value of model property pathS + */ + virtual double GetPathS() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Position in t coordinates orthogonal to the reference line of the route. + * + * @return value of model property t + */ + virtual double GetT() const + { + return 0; + } + + + /** + * Retrieves whether property pathS is set + * @return true when the property is set + */ + virtual bool IsSetPathS() const = 0; + /** + * Retrieves whether property t is set + * @return true when the property is set + */ + virtual bool IsSetT() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Reference to the current Entity. The position in a route is defined through the position of this entity (used in + * RoutePosition). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionOfCurrentEntity : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPositionOfCurrentEntity() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference to an entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a precipitation by type and value of a weather. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrecipitation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPrecipitation() = default; + + /** + * From OpenSCENARIO class model specification: + * The intensity of the precipitation. Range: [0..1]. + * + * @return value of model property intensity + */ + virtual double GetIntensity() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The intensity of the precipitation (valid for all precipitation types). Unit: [mm/h]. Range: [0..inf[. + * + * @return value of model property precipitationIntensity + */ + virtual double GetPrecipitationIntensity() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Type of the precipitation. + * + * @return value of model property precipitationType + */ + virtual PrecipitationType GetPrecipitationType() const + { + return PrecipitationType(); + } + + + /** + * Retrieves whether property intensity is set + * @return true when the property is set + */ + virtual bool IsSetIntensity() const = 0; + /** + * Retrieves whether property precipitationIntensity is set + * @return true when the property is set + */ + virtual bool IsSetPrecipitationIntensity() const = 0; + /** + * Retrieves whether property precipitationType is set + * @return true when the property is set + */ + virtual bool IsSetPrecipitationType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for private actions assigned to one specific entity and used in the initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrivate : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPrivate() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * List of private actions to be executed when the enclosing container gets triggered. + * + * @return value of model property privateActions + */ + virtual std::vector> GetPrivateActions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPrivateActionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPrivateActionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property privateActions is set + * @return true when the property is set + */ + virtual bool IsSetPrivateActions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Actions applied to one or multiple entities. Either the entities are referenced in the actors of the enclosing maneuver + * group or the single entity is referenced in the enclosing Private instance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrivateAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IPrivateAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Applies longitudinal control behavior on the reference entity/entities. Either a SpeedAction, LongitudinalDistanceAction + * or a SpeedProfileAction. + * + * @return value of model property longitudinalAction + */ + virtual std::shared_ptr GetLongitudinalAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Applies lateral control behavior on the reference entity/entities. Either a LaneChangeAction, LaneOffsetAction or a + * LateralDistanceAction. + * + * @return value of model property lateralAction + */ + virtual std::shared_ptr GetLateralAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Sets visibility attributes on the reference entity/entities. + * + * @return value of model property visibilityAction + */ + virtual std::shared_ptr GetVisibilityAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Synchronizes the reference entity/entities with a master entity. A target position is provided for the entity and for + * the master entity to be reached at the same time. + * + * @return value of model property synchronizeAction + */ + virtual std::shared_ptr GetSynchronizeAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Activates/ deactivates a controller on the reference entity/entities. + * + * @return value of model property activateControllerAction + */ + virtual std::shared_ptr GetActivateControllerAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to the reference entity/entities. + * + * @return value of model property controllerAction + */ + virtual std::shared_ptr GetControllerAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Assigns a position to the reference entity/entities. + * + * @return value of model property teleportAction + */ + virtual std::shared_ptr GetTeleportAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Applies an AssignRouteAction, a FollowTrajectoryAction or an AcquirePositionAction to the reference entity/entities. + * + * @return value of model property routingAction + */ + virtual std::shared_ptr GetRoutingAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the behaviour of an entity without moving it in the world, e.g. turning on a light or opening a door. + * + * @return value of model property appearanceAction + */ + virtual std::shared_ptr GetAppearanceAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Connect or disconnect trailer. + * + * @return value of model property trailerAction + */ + virtual std::shared_ptr GetTrailerAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property longitudinalAction is set + * @return true when the property is set + */ + virtual bool IsSetLongitudinalAction() const = 0; + /** + * Retrieves whether property lateralAction is set + * @return true when the property is set + */ + virtual bool IsSetLateralAction() const = 0; + /** + * Retrieves whether property visibilityAction is set + * @return true when the property is set + */ + virtual bool IsSetVisibilityAction() const = 0; + /** + * Retrieves whether property synchronizeAction is set + * @return true when the property is set + */ + virtual bool IsSetSynchronizeAction() const = 0; + /** + * Retrieves whether property activateControllerAction is set + * @return true when the property is set + */ + virtual bool IsSetActivateControllerAction() const = 0; + /** + * Retrieves whether property controllerAction is set + * @return true when the property is set + */ + virtual bool IsSetControllerAction() const = 0; + /** + * Retrieves whether property teleportAction is set + * @return true when the property is set + */ + virtual bool IsSetTeleportAction() const = 0; + /** + * Retrieves whether property routingAction is set + * @return true when the property is set + */ + virtual bool IsSetRoutingAction() const = 0; + /** + * Retrieves whether property appearanceAction is set + * @return true when the property is set + */ + virtual bool IsSetAppearanceAction() const = 0; + /** + * Retrieves whether property trailerAction is set + * @return true when the property is set + */ + virtual bool IsSetTrailerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for a set of single values with a defined probability. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProbabilityDistributionSet : public virtual IOpenScenarioModelElement + { + public: + virtual ~IProbabilityDistributionSet() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines set of elements with a defined probability. + * + * @return value of model property elements + */ + virtual std::vector> GetElements() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetElementsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetElementsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property elements is set + * @return true when the property is set + */ + virtual bool IsSetElements() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates a value and probability in a stochastic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProbabilityDistributionSetElement : public virtual IOpenScenarioModelElement + { + public: + virtual ~IProbabilityDistributionSetElement() = default; + + /** + * From OpenSCENARIO class model specification: + * A possible value in a stochastic distribution. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * This is used to define a propability of occurences for a specific value. Instead of a probability a defined count or + * weight has to be defined. The probability can be calculated by the (1/sum(all weights in the + * ProbabilityDistributionSet)) * weight. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for one or more properties. Properties encloses multiple property instances and/or multiple file references. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProperties : public virtual IOpenScenarioModelElement + { + public: + virtual ~IProperties() = default; + + /** + * From OpenSCENARIO class model specification: + * A name/value pair. The semantic of the name/values are subject of a contract between the provider of a simulation + * environment and the author of a scenario. + * + * @return value of model property properties + */ + virtual std::vector> GetProperties() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of arbitrary files attached to an object that owns the properties. The semantic and the file formats are subject + * of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property files + */ + virtual std::vector> GetFiles() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property customContent + */ + virtual std::vector> GetCustomContent() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPropertiesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPropertiesAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetFilesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetFilesAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetCustomContentSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetCustomContentAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + /** + * Retrieves whether property files is set + * @return true when the property is set + */ + virtual bool IsSetFiles() const = 0; + /** + * Retrieves whether property customContent is set + * @return true when the property is set + */ + virtual bool IsSetCustomContent() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a property by name and value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProperty : public virtual IOpenScenarioModelElement + { + public: + virtual ~IProperty() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of a user defined property. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Value of a user defined property. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * If an entity approaches a junction, the road to follow is selected randomly from the available options. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRandomRouteAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRandomRouteAction() = default; + + + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates a range for a distribution where the following rule applies: lowerLimit <= value <= upperLimit. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRange : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRange() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit of a range. + * + * @return value of model property lowerLimit + */ + virtual double GetLowerLimit() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the upper limit of a range. + * + * @return value of model property upperLimit + */ + virtual double GetUpperLimit() const + { + return 0; + } + + + /** + * Retrieves whether property lowerLimit is set + * @return true when the property is set + */ + virtual bool IsSetLowerLimit() const = 0; + /** + * Retrieves whether property upperLimit is set + * @return true when the property is set + */ + virtual bool IsSetUpperLimit() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Checks if a triggering entity/entities has reached a given position, within some user specified tolerance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IReachPositionCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IReachPositionCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given position. Unit: [m]. Range: [0..inf[. + * + * @return value of model property tolerance + */ + virtual double GetTolerance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The position to be reached with the defined tolerance. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property tolerance is set + * @return true when the property is set + */ + virtual bool IsSetTolerance() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Checks if the relative angle of the triggering entity, measured with respect to the reference entity, has reached a + * given value, within some user-specified angle tolerance. + +The relative angle is generally measured as angle of the + * triggering entity minus angle of the reference entity. +Both angles must be measured in the same coordinate system, as + * specified by the user. + +When the entity value is used, the angles are measured in the local coordinate system of the + * reference entity. +Note that for the s-t coordinate systems the orientation is measured at the local s-coordinate of each + * entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeAngleCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeAngleCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * The angle to be reached with the defined tolerance. Unit: [rad]. Range: [-pi..pi]. + * + * @return value of model property angle + */ + virtual double GetAngle() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Tolerance around the given angle value. Unit: [rad]. Range: [0..pi]. + * + * @return value of model property angleTolerance + */ + virtual double GetAngleTolerance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The angular coordinate to be used for the condition. + * + * @return value of model property angleType + */ + virtual AngleType GetAngleType() const + { + return AngleType(); + } + + /** + * From OpenSCENARIO class model specification: + * Define which coordinate system is used to measure the angles of the reference entity and the triggering entity. Default: + * entity. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property angle is set + * @return true when the property is set + */ + virtual bool IsSetAngle() const = 0; + /** + * Retrieves whether property angleTolerance is set + * @return true when the property is set + */ + virtual bool IsSetAngleTolerance() const = 0; + /** + * Retrieves whether property angleType is set + * @return true when the property is set + */ + virtual bool IsSetAngleType() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Checks if an amount of lanes next to the triggering entity is free from other entities. Evaluates to true, if the + * specified area exists and is free, otherwise evaluates to false. The longitudinal distance to be checked is defined in + * the lane coordinate system of the current lane of the triggering entity. In lateral direction the checked area is + * defined by the lane boundaries. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeClearanceCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeClearanceCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Longitudinal distance behind reference point of the entity to be checked along lane centerline of the current lane of + * the triggering entity. Orientation of entity towards lane determines backward direction. Velocity of entity is + * irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0 + * + * @return value of model property distanceBackward + */ + virtual double GetDistanceBackward() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Longitudinal distance in front of reference point of the entity to be checked along lane centerline of the current lane + * of the triggering entity. Orientation of entity towards lane determines forward direction. Velocity of entity is + * irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0 + * + * @return value of model property distanceForward + */ + virtual double GetDistanceForward() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * If false, then entityRefs are only considered to be on the lane if their reference point is within the checked area; + * otherwise the whole bounding box is considered. + * + * @return value of model property freeSpace + */ + virtual bool GetFreeSpace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * If true, then also lanes in the opposite direction are considered; otherwise only lanes in the same direction are + * considered. + * + * @return value of model property oppositeLanes + */ + virtual bool GetOppositeLanes() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * The lanes to be checked to left and right of the triggering entity (positive to the y-axis). If omitted: all lanes are + * checked. + * + * @return value of model property relativeLaneRange + */ + virtual std::vector> GetRelativeLaneRange() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Constraint to check only specific entities. If it is not used then all entities are considered. + * + * @return value of model property entityRef + */ + virtual std::vector> GetEntityRef() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetRelativeLaneRangeSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetRelativeLaneRangeAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntityRefSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntityRefAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property distanceBackward is set + * @return true when the property is set + */ + virtual bool IsSetDistanceBackward() const = 0; + /** + * Retrieves whether property distanceForward is set + * @return true when the property is set + */ + virtual bool IsSetDistanceForward() const = 0; + /** + * Retrieves whether property freeSpace is set + * @return true when the property is set + */ + virtual bool IsSetFreeSpace() const = 0; + /** + * Retrieves whether property oppositeLanes is set + * @return true when the property is set + */ + virtual bool IsSetOppositeLanes() const = 0; + /** + * Retrieves whether property relativeLaneRange is set + * @return true when the property is set + */ + virtual bool IsSetRelativeLaneRange() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The current relative distance of a triggering entity/entities to a reference entity is compared to a given value. The + * logical operator used for comparison is defined in the rule attribute. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeDistanceCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeDistanceCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * True: distance is measured between closest bounding box points. False: reference point distance is used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. + * + * @return value of model property relativeDistanceType + */ + virtual RelativeDistanceType GetRelativeDistanceType() const + { + return RelativeDistanceType(); + } + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual RoutingAlgorithm GetRoutingAlgorithm() const + { + return RoutingAlgorithm(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * The distance value. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property relativeDistanceType is set + * @return true when the property is set + */ + virtual bool IsSetRelativeDistanceType() const = 0; + /** + * Retrieves whether property routingAlgorithm is set + * @return true when the property is set + */ + virtual bool IsSetRoutingAlgorithm() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a position derived from relative lane coordinates (dLane, ds / dsLane and offset) to a reference entity. +Where + * ds is provided, the position is computed by the following process: +  +

    +
  1. Find the closest road reference line + * point to the reference entity. Travel the road reference line difference ds from the position of the reference + * entity.
  2. +
  3. Find the target lane by adding dLane to that of the reference entity and the intersection of the road + * reference line's normal with its center lane.
  4. +
  5. Apply offset as a lateral offset.
  6. +
+ +Alternatively + * where dsLane is provided, the following process is used: +  +
    +
  1. Find the closest lane center line point to the + * reference entity. Travel the lane center line difference dsLane from the position of the reference entity in the + * direction the reference entity is facing.
  2. +
  3. Find the target lane by adding dLane to that of the reference + * entity's and the intersection of the source lane's center lane normal with its center lane.
  4. +
  5. Apply offset as a + * lateral offset.
  6. +
+ +The target position may be either on the same road segment (defined by roadId), where the + * reference entity is positioned, or on a connecting road. In the latter case, the ds-coordinate is calculated assuming + * that the reference line of the road of the reference entity continues seamlessly on the connecting road (even if its + * shape changes). It is also assumed that the lane, where the reference entity is located, continues seamlessly on the + * connecting road (provided the lane's center line is unbroken between roads). It is assumed that the target position + * relates to the routing of the reference entity. Otherwise, the calculation of the target position cannot be interpreted + * within the OpenSCENARIO standard. + +The relative lane coordinates (dLane, ds/dsLane, and offset) should be specified so + * that the target position is within a road defined by roadId taken from the respective road network definition file + * (external to the ASAM OpenSCENARIO). If the target position would be outside the road boundaries, the z-coordinate of + * the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeLanePosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeLanePosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The deviation value between the laneId of the lane, where the reference entity is located, and the target laneId. + * + * @return value of model property dLane + */ + virtual int GetDLane() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The offset along the road's reference line relative to the s-coordinate of the reference entity. Mutually exclusive with + * dsLane. Unit: [m]. + * + * @return value of model property ds + */ + virtual double GetDs() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The offset along the center line of the lane, where the reference entity is located. Mutually exclusive with ds. Unit: + * [m]. + * + * @return value of model property dsLane + */ + virtual double GetDsLane() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The lateral offset to the center line of the target lane (along the t-axis of the target lane center line). Missing + * value is interpreted as 0. The positive value means the offset is applied in the direction of the t-axis being imagined + * at the target s-position. Unit: [m]. + * + * @return value of model property offset + */ + virtual double GetOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the lane where the target position is located. Only the Heading angle at the target position on the + * (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position + * is built parallel to the tangent to the lane s-axis at the target s-position on the target road s-axis. The Heading is + * counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property dLane is set + * @return true when the property is set + */ + virtual bool IsSetDLane() const = 0; + /** + * Retrieves whether property ds is set + * @return true when the property is set + */ + virtual bool IsSetDs() const = 0; + /** + * Retrieves whether property dsLane is set + * @return true when the property is set + */ + virtual bool IsSetDsLane() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property offset is set + * @return true when the property is set + */ + virtual bool IsSetOffset() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A range of lanes to the left and/or right of a referenced entity. The properties "from" and "to" define the signed + * numbers of lanes that are offset the referenced entity's current lane. (0 is the entity's current lane, positive is left + * of the entity, negative is right of the entity). Set "from" and "to" to the same number in order to check clearance for + * only one lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeLaneRange : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeLaneRange() = default; + + /** + * From OpenSCENARIO class model specification: + * The lower limit of the range. Range: [-inf, inf[. Default if omitted: -inf + * + * @return value of model property from + */ + virtual int GetFrom() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The upper limit of the range. Range: ]-inf, inf]. Default if omitted: +inf + * + * @return value of model property to + */ + virtual int GetTo() const + { + return 0; + } + + + /** + * Retrieves whether property from is set + * @return true when the property is set + */ + virtual bool IsSetFrom() const = 0; + /** + * Retrieves whether property to is set + * @return true when the property is set + */ + virtual bool IsSetTo() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a position derived from coordinates (dx, dy and dz) relative to a reference entity. The coordinate system for + * the relative coordinates is the reference entity's coordinate system (taking the orientation of the entity into + * account). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeObjectPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeObjectPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the x axis, using the coordinate system of the reference entity. + * + * @return value of model property dx + */ + virtual double GetDx() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative position in the y axis, using the coordinate system of the reference entity. + * + * @return value of model property dy + */ + virtual double GetDy() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the reference entity. Missing value is interpreted as 0. + * + * @return value of model property dz + */ + virtual double GetDz() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the orientation with respect + * to the corresponding axes of the local (X,Y,Z)-coordinate system of the reference entity. +Missing Orientation property + * is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property dx is set + * @return true when the property is set + */ + virtual bool IsSetDx() const = 0; + /** + * Retrieves whether property dy is set + * @return true when the property is set + */ + virtual bool IsSetDy() const = 0; + /** + * Retrieves whether property dz is set + * @return true when the property is set + */ + virtual bool IsSetDz() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of the relative distance (ds) along the road's reference line and the relative lateral offset + * (dt) to the road's reference line which are derived from the position of the reference entity. + +The target position may + * be either on the same road segment (defined by roadId) where the reference entity is positioned or on a connecting road. + * In the latter case, the ds-coordinate is calculated along the road reference line of the connecting road. It is assumed + * that the reference line of the road of the reference entity continues seamlessly on the connecting road (even if its + * shape changes). It is assumed that the target position relates to the routing of the reference entity. Otherwise, the + * calculation of the target position cannot be interpreted within the OpenSCENARIO standard. + +The ds- and dt-coordinates + * should be specified so that the target position is within a road defined by roadId taken from the respective road + * network definition file (external to the ASAM OpenSCENARIO). If the target position would be outside the road + * boundaries, the z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeRoadPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeRoadPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The offset along the road's reference line relative to the s-coordinate of the reference entity. Unit: [m]. + * + * @return value of model property ds + */ + virtual double GetDs() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The offset on the axis orthogonal to the road's reference line relative to the t-coordinate of the reference entity. + * Unit: [m]. + * + * @return value of model property dt + */ + virtual double GetDt() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the road at the target position. Only the Heading angle at the target position on the (s,t)-plane can be + * arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to + * the tangent to the road s-axis at the s-position of the target position. The Heading is counted from this imaginary + * axis. +Missing Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property ds is set + * @return true when the property is set + */ + virtual bool IsSetDs() const = 0; + /** + * Retrieves whether property dt is set + * @return true when the property is set + */ + virtual bool IsSetDt() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The current relative speed of a triggering entity/entities to a reference entity is compared to a given value. The + * logical operator used for the evaluation is defined by the rule attribute. If direction is used, only the projection to + * that direction is used in the comparison, with the triggering entity/entities as the reference. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeSpeedCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeSpeedCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Direction of the speed (if not given, the total speed is considered). + * + * @return value of model property direction + */ + virtual DirectionalDimension GetDirection() const + { + return DirectionalDimension(); + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Relative speed value. Unit: [m/s]. Range: ]-inf..inf[. Relative speed is defined as speed_rel = speed(triggering entity) + * - speed(reference entity) + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property direction is set + * @return true when the property is set + */ + virtual bool IsSetDirection() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Speed definition relative to the master entity's speed within a SynchronizeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeSpeedToMaster : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeSpeedToMaster() = default; + + /** + * From OpenSCENARIO class model specification: + * The semantics of the value (delta, offset, factor). + * + * @return value of model property speedTargetValueType + */ + virtual SpeedTargetValueType GetSpeedTargetValueType() const + { + return SpeedTargetValueType(); + } + + /** + * From OpenSCENARIO class model specification: + * Relative speed. Unit: [m/s]. Range: ]-inf..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return value of model property steadyState + */ + virtual std::shared_ptr GetSteadyState() const + { + return nullptr; + } + + + /** + * Retrieves whether property speedTargetValueType is set + * @return true when the property is set + */ + virtual bool IsSetSpeedTargetValueType() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property steadyState is set + * @return true when the property is set + */ + virtual bool IsSetSteadyState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Target lane defined as difference compared to the reference entity's current lane evaluated in the reference entity's + * coordinate system. I.e. positive values refer to lanes in the positive y-axis of the reference entity's coordinate + * system, negative values refer to lanes in the negative y-axis respectively. For ASAM OpenDRIVE maps, the road center + * lane is not counted as a lane and thus omitted. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetLane : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeTargetLane() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Signed number defining the target lane as difference compared to the reference entity's current lane evaluated in the + * reference entity's coordinate system. + * + * @return value of model property value + */ + virtual int GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the relative lane offset from a triggering entity/entities to a reference entity as a target for a + * LaneOffsetTarget. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetLaneOffset : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeTargetLaneOffset() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Lane offset with respect to the reference entity's current lane position. Unit: [m]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a target speed relative to a reference entity's speed. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetSpeed : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeTargetSpeed() = default; + + /** + * From OpenSCENARIO class model specification: + * By setting continuous to true a controller comes into place and tries to maintain a continuous relative speed. This may + * not be used together with Dynamics.time or Dynamics.distance. + * + * @return value of model property continuous + */ + virtual bool GetContinuous() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The value is either a delta (Unit: [m/s]) or a factor (no Unit). + * + * @return value of model property speedTargetValueType + */ + virtual SpeedTargetValueType GetSpeedTargetValueType() const + { + return SpeedTargetValueType(); + } + + /** + * From OpenSCENARIO class model specification: + * Value of the relative speed. This value is either given as a delta or as a factor. E.g. value=10 together with + * valueType=delta means the entity/entities are supposed to drive 10m/s faster than the target reference entity. E.g. + * value=1.1 together with valueType=factor means that the entity/entities are supposed to drive 10% faster than the target + * reference entity. Unit: [m/s] or [1]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property continuous is set + * @return true when the property is set + */ + virtual bool IsSetContinuous() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property speedTargetValueType is set + * @return true when the property is set + */ + virtual bool IsSetSpeedTargetValueType() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of delta x, y, (z) relative to a reference entity's position in world coordinate space. + * Optionally, an orientation can be defined in either absolute or relative values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeWorldPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRelativeWorldPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Relative x coordinate in the world coordinate system. Unit: [m]. + * + * @return value of model property dx + */ + virtual double GetDx() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative y coordinate in the world coordinate system. Unit: [m]. + * + * @return value of model property dy + */ + virtual double GetDy() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative z coordinate in the world coordinate system. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property dz + */ + virtual double GetDz() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity from which the relative world position is measured. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the angular shift of + * orientation angles with respect to the corresponding orientation angles of the reference entity in the World coordinate + * system. The positive value means a counter-clockwise shift. +Missing Orientation property is interpreted as the relative + * reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property dx is set + * @return true when the property is set + */ + virtual bool IsSetDx() const = 0; + /** + * Retrieves whether property dy is set + * @return true when the property is set + */ + virtual bool IsSetDy() const = 0; + /** + * Retrieves whether property dz is set + * @return true when the property is set + */ + virtual bool IsSetDz() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the road friction scale factor. Can be augmented with the addition of optional road properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoadCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Friction scale factor. Range: [0..inf[. + * + * @return value of model property frictionScaleFactor + */ + virtual double GetFrictionScaleFactor() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the wetness of the road. + * + * @return value of model property wetness + */ + virtual Wetness GetWetness() const + { + return Wetness(); + } + + /** + * From OpenSCENARIO class model specification: + * Additional properties to describe the road condition. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + + /** + * Retrieves whether property frictionScaleFactor is set + * @return true when the property is set + */ + virtual bool IsSetFrictionScaleFactor() const = 0; + /** + * Retrieves whether property wetness is set + * @return true when the property is set + */ + virtual bool IsSetWetness() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a cross-section across lanes on a road with respect to the road reference line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadCursor : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoadCursor() = default; + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual std::string GetRoadId() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. If s is omitted and the + * road cursor depicts the start of a road range, then s=0 is assumed. If s is omitted and the road cursor depicts the end + * of a road range, then s=max_length is assumed. Unit: [m]. Range: [0..inf[. + * + * @return value of model property s + */ + virtual double GetS() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Restriction of the road cursor to specific lanes of a road. If omitted, road cursor is valid for all lanes of the road. + * + * @return value of model property lane + */ + virtual std::vector> GetLane() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetLaneSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetLaneAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property roadId is set + * @return true when the property is set + */ + virtual bool IsSetRoadId() const = 0; + /** + * Retrieves whether property s is set + * @return true when the property is set + */ + virtual bool IsSetS() const = 0; + /** + * Retrieves whether property lane is set + * @return true when the property is set + */ + virtual bool IsSetLane() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The road network which provides the base layer (and road-relative coordinate systems) for all scenario elements is + * defined as a reference to a road network file. This reference is optional; in case it is not specified, an infinite + * non-inclined plane on level z=0 shall be assumed as base layer. Additionally and optionally, a visual 3D model file can + * be referenced and any number of signals can be specified. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadNetwork : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoadNetwork() = default; + + /** + * From OpenSCENARIO class model specification: + * File path of the road network file (e.g. an ASAM OpenDRIVE file). + * + * @return value of model property logicFile + */ + virtual std::shared_ptr GetLogicFile() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * File path of a 3D model representing the virtual environment. This may be used for visual representation (rendering). + * + * @return value of model property sceneGraphFile + */ + virtual std::shared_ptr GetSceneGraphFile() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Name references and description of dynamic behavior for traffic signals defined in the road network file. + * + * @return value of model property trafficSignals + */ + virtual std::vector> GetTrafficSignals() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the area of the road network, which is used by the entities. If not provided, then the whole logicFile and + * sceneGraphFile will be used/loaded. + * + * @return value of model property usedArea + */ + virtual std::shared_ptr GetUsedArea() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetTrafficSignalsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetTrafficSignalsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property logicFile is set + * @return true when the property is set + */ + virtual bool IsSetLogicFile() const = 0; + /** + * Retrieves whether property sceneGraphFile is set + * @return true when the property is set + */ + virtual bool IsSetSceneGraphFile() const = 0; + /** + * Retrieves whether property trafficSignals is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignals() const = 0; + /** + * Retrieves whether property usedArea is set + * @return true when the property is set + */ + virtual bool IsSetUsedArea() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position defined in terms of the road segment (roadId), the distance (s) along the road's reference line, and the + * lateral offset (t) to the road's reference line at that point. Orientation is optional. + +The s- and t-coordinates should + * be specified so that the target position is within a road defined by roadId taken from the respective road network + * definition file (external to the ASAM OpenSCENARIO). If the target position would be outside the road boundaries, the + * z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoadPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual std::string GetRoadId() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property s + */ + virtual double GetS() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The t-coordinate taken on the axis orthogonal to the reference line of the road. Unit: [m]. + * + * @return value of model property t + */ + virtual double GetT() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target road that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the road s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + + /** + * Retrieves whether property roadId is set + * @return true when the property is set + */ + virtual bool IsSetRoadId() const = 0; + /** + * Retrieves whether property s is set + * @return true when the property is set + */ + virtual bool IsSetS() const = 0; + /** + * Retrieves whether property t is set + * @return true when the property is set + */ + virtual bool IsSetT() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an area by a range on a specific road. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadRange : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoadRange() = default; + + /** + * From OpenSCENARIO class model specification: + * Limits the length of the road range starting from the first road cursor. If omitted or if length exceeds last road + * cursor, then last road cursor defines the end of the road range. Unit: [m]. Range: ]0;inf[. + * + * @return value of model property length + */ + virtual double GetLength() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * A minimum of 2 road cursors must be provided to specify the start and end of the road range. Intermediate cursors can be + * used to change the lane "validity". + * + * @return value of model property roadCursor + */ + virtual std::vector> GetRoadCursor() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetRoadCursorSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetRoadCursorAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property length is set + * @return true when the property is set + */ + virtual bool IsSetLength() const = 0; + /** + * Retrieves whether property roadCursor is set + * @return true when the property is set + */ + virtual bool IsSetRoadCursor() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A route is defined in a scenario or in a catalog. It represents a continuous path throughout the road network, defined + * by a series of waypoints. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoute : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IRoute() = default; + + /** + * From OpenSCENARIO class model specification: + * In a closed route, the last waypoint is followed by the first waypoint to create a closed route. + * + * @return value of model property closed + */ + virtual bool GetClosed() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the route. Required in catalogs. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * At least two waypoints are needed to define a route. + * + * @return value of model property waypoints + */ + virtual std::vector> GetWaypoints() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetWaypointsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetWaypointsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property closed is set + * @return true when the property is set + */ + virtual bool IsSetClosed() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property waypoints is set + * @return true when the property is set + */ + virtual bool IsSetWaypoints() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up route catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRouteCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRouteCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Position along a route defined in terms of PositionInRoadCoordinates, PositionInLaneCoordinates or current position of a + * reference object. Orientation definition is optional. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoutePosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoutePosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Either a route definition or a catalog reference to the route the position is calculated from. + * + * @return value of model property routeRef + */ + virtual std::shared_ptr GetRouteRef() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Orientation. The relative reference context refers to the referenced road's s and t coordinates, to the current lane's s + * and t coordinates or to the orientation of the reference entity. Missing Orientation property is interpreted as the + * relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Position along the route. + * + * @return value of model property inRoutePosition + */ + virtual std::shared_ptr GetInRoutePosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property routeRef is set + * @return true when the property is set + */ + virtual bool IsSetRouteRef() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + /** + * Retrieves whether property inRoutePosition is set + * @return true when the property is set + */ + virtual bool IsSetInRoutePosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a reference to a route. Either an inline definition of a route or a route in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRouteRef : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRouteRef() = default; + + /** + * From OpenSCENARIO class model specification: + * Route definition. + * + * @return value of model property route + */ + virtual std::shared_ptr GetRoute() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to route in the catalog. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property route is set + * @return true when the property is set + */ + virtual bool IsSetRoute() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls entity routing, either by following a predefined route or trajectory, alternatively by specifying a destination + * position which the entity should aim to reach. +Further, it can be enforced that an entity selects its routing at each + * junction randomly. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoutingAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IRoutingAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route is defined by at least two waypoints. + * + * @return value of model property assignRouteAction + */ + virtual std::shared_ptr GetAssignRouteAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Controls an entity to follow a trajectory. + * + * @return value of model property followTrajectoryAction + */ + virtual std::shared_ptr GetFollowTrajectoryAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route assigned will be the shortest route (along roads) between the entity's current + * position and the position specified. + * + * @return value of model property acquirePositionAction + */ + virtual std::shared_ptr GetAcquirePositionAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Assigns random routing behavior to an entity. + * + * @return value of model property randomRouteAction + */ + virtual std::shared_ptr GetRandomRouteAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property assignRouteAction is set + * @return true when the property is set + */ + virtual bool IsSetAssignRouteAction() const = 0; + /** + * Retrieves whether property followTrajectoryAction is set + * @return true when the property is set + */ + virtual bool IsSetFollowTrajectoryAction() const = 0; + /** + * Retrieves whether property acquirePositionAction is set + * @return true when the property is set + */ + virtual bool IsSetAcquirePositionAction() const = 0; + /** + * Retrieves whether property randomRouteAction is set + * @return true when the property is set + */ + virtual bool IsSetRandomRouteAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Top level container containing all scenario elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioDefinition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IScenarioDefinition() = default; + + /** + * From OpenSCENARIO class model specification: + * Declaration of typed parameters with names and default values. It is used for creating variations of the same scenario. + * The value of the parameters cannot change after startup during runtime. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Declaration of typed variables with names and default values. Their value can change during runtime, and can be used to + * trigger Events in the scenario or on external side. + * + * @return value of model property variableDeclarations + */ + virtual std::vector> GetVariableDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Declaration of monitors by name and initial value. Monitors can be read out by an external tool and may change during + * runtime to monitor the scenario execution. + * + * @return value of model property monitorDeclarations + */ + virtual std::vector> GetMonitorDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * A list of locations to look up catalog files. Each catalog element type has its own list. + * + * @return value of model property catalogLocations + */ + virtual std::shared_ptr GetCatalogLocations() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to the road network. + * + * @return value of model property roadNetwork + */ + virtual std::shared_ptr GetRoadNetwork() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Container for entity selections and scenario object definitions. Instances of ScenarioObject, of EntitySelection and of + * SpawnedObject considered instances of Entity. + * + * @return value of model property entities + */ + virtual std::shared_ptr GetEntities() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Container for the dynamic content of the scenario. + * + * @return value of model property storyboard + */ + virtual std::shared_ptr GetStoryboard() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetVariableDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetVariableDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetMonitorDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetMonitorDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property variableDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetVariableDeclarations() const = 0; + /** + * Retrieves whether property monitorDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetMonitorDeclarations() const = 0; + /** + * Retrieves whether property catalogLocations is set + * @return true when the property is set + */ + virtual bool IsSetCatalogLocations() const = 0; + /** + * Retrieves whether property roadNetwork is set + * @return true when the property is set + */ + virtual bool IsSetRoadNetwork() const = 0; + /** + * Retrieves whether property entities is set + * @return true when the property is set + */ + virtual bool IsSetEntities() const = 0; + /** + * Retrieves whether property storyboard is set + * @return true when the property is set + */ + virtual bool IsSetStoryboard() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A scenario object represents a runtime object that is created from an EntityObject (vehicle type, pedestrian type, + * miscellaneous object type and external object reference type) and Controllers. Miscellaneous objects and external object + * references must not have controllers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioObject : public virtual IOpenScenarioModelElement, public IEntity + { + public: + virtual ~IScenarioObject() = default; + + /** + * From OpenSCENARIO class model specification: + * Identifier of the scenario object. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle, Pedestrian or MiscObject). + * + * @return value of model property entityObject + */ + virtual std::shared_ptr GetEntityObject() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Controller of the EntityObject instance. + * + * @return value of model property objectController + */ + virtual std::vector> GetObjectController() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetObjectControllerSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetObjectControllerAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property entityObject is set + * @return true when the property is set + */ + virtual bool IsSetEntityObject() const = 0; + /** + * Retrieves whether property objectController is set + * @return true when the property is set + */ + virtual bool IsSetObjectController() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * An entity profile that shall appear in an entity group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioObjectTemplate : public virtual IOpenScenarioModelElement, public IEntity + { + public: + virtual ~IScenarioObjectTemplate() = default; + + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle/Pedestrian or CatalogReference to them; no MiscObject or + * ExternalObjectReference). + * + * @return value of model property entitiyObject + */ + virtual std::shared_ptr GetEntitiyObject() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Controller(s) of the EntityObject instance. + * + * @return value of model property objectController + */ + virtual std::vector> GetObjectController() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetObjectControllerSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetObjectControllerAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property entitiyObject is set + * @return true when the property is set + */ + virtual bool IsSetEntitiyObject() const = 0; + /** + * Retrieves whether property objectController is set + * @return true when the property is set + */ + virtual bool IsSetObjectController() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Collection of entities that includes entities explicitly by their reference or includes the entities by their type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISelectedEntities : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISelectedEntities() = default; + + /** + * From OpenSCENARIO class model specification: + * References to the selected entities. + * + * @return value of model property entityRef + */ + virtual std::vector> GetEntityRef() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines the type to determine that all entities of a specific type are members. + * + * @return value of model property byType + */ + virtual std::vector> GetByType() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntityRefSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntityRefAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetByTypeSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetByTypeAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property byType is set + * @return true when the property is set + */ + virtual bool IsSetByType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Reference to a sensor, whose definition is beyond OpenSCENARIO files and catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISensorReference : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISensorReference() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the sensor. The semantics of the sensor names are subject of a contract between the author of a scenario and the + * provider of a simulation environment. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Set of references to sensors, whose definition is beyond OpenSCENARIO files and catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISensorReferenceSet : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISensorReferenceSet() = default; + + /** + * From OpenSCENARIO class model specification: + * Set of references to sensors. + * + * @return value of model property sensorReferences + */ + virtual std::vector> GetSensorReferences() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetSensorReferencesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetSensorReferencesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property sensorReferences is set + * @return true when the property is set + */ + virtual bool IsSetSensorReferences() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Action used to set the value of a monitor. If it is set to false by this action, that indicates the scenario was not + * executed as expected. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISetMonitorAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISetMonitorAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced monitor. + * + * @return value of model property monitorRef + */ + virtual std::shared_ptr> GetMonitorRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * New value of the monitor. + * + * @return value of model property value + */ + virtual bool GetValue() const + { + return false; + } + + + /** + * Retrieves whether property monitorRef is set + * @return true when the property is set + */ + virtual bool IsSetMonitorRef() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Shape for use in trajectories. Supported types: Polyline (line segments), Clothoid, Nurbs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IShape : public virtual IOpenScenarioModelElement + { + public: + virtual ~IShape() = default; + + /** + * From OpenSCENARIO class model specification: + * Polyline property of a shape. + * + * @return value of model property polyline + */ + virtual std::shared_ptr GetPolyline() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Clothoid property of a shape. + * + * @return value of model property clothoid + */ + virtual std::shared_ptr GetClothoid() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Clothoid spline property of a shape. + * + * @return value of model property clothoidSpline + */ + virtual std::shared_ptr GetClothoidSpline() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * NURBS property of a shape. + * + * @return value of model property nurbs + */ + virtual std::shared_ptr GetNurbs() const + { + return nullptr; + } + + + /** + * Retrieves whether property polyline is set + * @return true when the property is set + */ + virtual bool IsSetPolyline() const = 0; + /** + * Retrieves whether property clothoid is set + * @return true when the property is set + */ + virtual bool IsSetClothoid() const = 0; + /** + * Retrieves whether property clothoidSpline is set + * @return true when the property is set + */ + virtual bool IsSetClothoidSpline() const = 0; + /** + * Retrieves whether property nurbs is set + * @return true when the property is set + */ + virtual bool IsSetNurbs() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Compares the simulation time to the specified value. The logical operator is defined by the rule attribute. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISimulationTimeCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISimulationTimeCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Time value of the simulation time condition. Unit: [s]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the transition of an entity's speed to a target speed. SpeedActionDynamics specifies the + * transition with respects to time or distance combined with a shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ISpeedAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines how the target speed is reached. + * + * @return value of model property speedActionDynamics + */ + virtual std::shared_ptr GetSpeedActionDynamics() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed which should be reached. + * + * @return value of model property speedActionTarget + */ + virtual std::shared_ptr GetSpeedActionTarget() const + { + return nullptr; + } + + + /** + * Retrieves whether property speedActionDynamics is set + * @return true when the property is set + */ + virtual bool IsSetSpeedActionDynamics() const = 0; + /** + * Retrieves whether property speedActionTarget is set + * @return true when the property is set + */ + virtual bool IsSetSpeedActionTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specifies the target speed of a SpeedAction. Can be either an absolute speed value or a speed value relative to another + * entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedActionTarget : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISpeedActionTarget() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as relative speed to a reference entity. Unit: [m/s]. + * + * @return value of model property relativeTargetSpeed + */ + virtual std::shared_ptr GetRelativeTargetSpeed() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as absolute speed. Unit: [m/s]. + * + * @return value of model property absoluteTargetSpeed + */ + virtual std::shared_ptr GetAbsoluteTargetSpeed() const + { + return nullptr; + } + + + /** + * Retrieves whether property relativeTargetSpeed is set + * @return true when the property is set + */ + virtual bool IsSetRelativeTargetSpeed() const = 0; + /** + * Retrieves whether property absoluteTargetSpeed is set + * @return true when the property is set + */ + virtual bool IsSetAbsoluteTargetSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Compares a triggering entity's/entities' speed to a target speed. The logical operator for the comparison is given by + * the rule attribute. If direction is used, only the projection to that direction is used in the comparison. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISpeedCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Direction of the speed (if not given, the total speed is considered). + * + * @return value of model property direction + */ + virtual DirectionalDimension GetDirection() const + { + return DirectionalDimension(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Speed value of the speed condition. Unit: [m/s]. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property direction is set + * @return true when the property is set + */ + virtual bool IsSetDirection() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action describes the change of speed in terms of a series of speed targets over time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedProfileAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISpeedProfileAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. If set, the speed values will be interpreted as relative delta to the speed of the referenced entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines whether to apply strictly linear interpolation between speed target values (mode=position), or to apply jerk + * (change rate of acceleration/deceleration) and other optional constraints of the Performance class of a Vehicle entity + * resulting in a smoother speed profile curve (mode=follow). For mode=follow the acceleration is zero at the start and end + * of the profile. + * + * @return value of model property followingMode + */ + virtual FollowingMode GetFollowingMode() const + { + return FollowingMode(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines limitations to the action in terms of acceleration, deceleration, speed and/or jerk. These settings has + * precedence over any Performance settings (applies to vehicles only). + * + * @return value of model property dynamicConstraints + */ + virtual std::shared_ptr GetDynamicConstraints() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a series of speed targets. + * + * @return value of model property speedProfileEntry + */ + virtual std::vector> GetSpeedProfileEntry() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetSpeedProfileEntrySize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetSpeedProfileEntryAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property followingMode is set + * @return true when the property is set + */ + virtual bool IsSetFollowingMode() const = 0; + /** + * Retrieves whether property dynamicConstraints is set + * @return true when the property is set + */ + virtual bool IsSetDynamicConstraints() const = 0; + /** + * Retrieves whether property speedProfileEntry is set + * @return true when the property is set + */ + virtual bool IsSetSpeedProfileEntry() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Describes a speed target for a SpeedProfileAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedProfileEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISpeedProfileEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The speed to reach. Unit: [m/s]. + * + * @return value of model property speed + */ + virtual double GetSpeed() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The time to reach the specified speed. First entry specifies delta from start of the action, remaining entries delta + * from previous entry. If omitted, the speed will be reached as soon as possible given the performance settings. Unit: + * [s]. Range: [0..inf[. + * + * @return value of model property time + */ + virtual double GetTime() const + { + return 0; + } + + + /** + * Retrieves whether property speed is set + * @return true when the property is set + */ + virtual bool IsSetSpeed() const = 0; + /** + * Retrieves whether property time is set + * @return true when the property is set + */ + virtual bool IsSetTime() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Logical expression in condition becomes true if the triggering entity/entities stands still for a given amount of time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStandStillCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStandStillCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Duration time of still standing to let the logical expression become true. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual double GetDuration() const + { + return 0; + } + + + /** + * Retrieves whether property duration is set + * @return true when the property is set + */ + virtual bool IsSetDuration() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Final phase of constant (final) speed, start of which defined by distance or time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISteadyState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISteadyState() = default; + + /** + * From OpenSCENARIO class model specification: + * The target distance steady state (distance from object to target) + * + * @return value of model property targetDistanceSteadyState + */ + virtual std::shared_ptr GetTargetDistanceSteadyState() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The target time steady state (remaining time for object to reach target position). + * + * @return value of model property targetTimeSteadyState + */ + virtual std::shared_ptr GetTargetTimeSteadyState() const + { + return nullptr; + } + + + /** + * Retrieves whether property targetDistanceSteadyState is set + * @return true when the property is set + */ + virtual bool IsSetTargetDistanceSteadyState() const = 0; + /** + * Retrieves whether property targetTimeSteadyState is set + * @return true when the property is set + */ + virtual bool IsSetTargetTimeSteadyState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Top level container for all stochastic distribution elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochastic : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStochastic() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the total number of runs for each stochastic distribution. + * + * @return value of model property numberOfTestRuns + */ + virtual uint32_t GetNumberOfTestRuns() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the seed which is used to generate the random values. A identical seed shall generate the same set of random + * values. + * + * @return value of model property randomSeed + */ + virtual double GetRandomSeed() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return value of model property stochasticDistributions + */ + virtual std::vector> GetStochasticDistributions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetStochasticDistributionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetStochasticDistributionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property numberOfTestRuns is set + * @return true when the property is set + */ + virtual bool IsSetNumberOfTestRuns() const = 0; + /** + * Retrieves whether property randomSeed is set + * @return true when the property is set + */ + virtual bool IsSetRandomSeed() const = 0; + /** + * Retrieves whether property stochasticDistributions is set + * @return true when the property is set + */ + virtual bool IsSetStochasticDistributions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for a stochastic distribution which applies to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochasticDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStochasticDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the parameter name these distribution values should be applied to. + * + * @return value of model property parameterName + */ + virtual std::string GetParameterName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return value of model property stochasticDistributionType + */ + virtual std::shared_ptr GetStochasticDistributionType() const + { + return nullptr; + } + + + /** + * Retrieves whether property parameterName is set + * @return true when the property is set + */ + virtual bool IsSetParameterName() const = 0; + /** + * Retrieves whether property stochasticDistributionType is set + * @return true when the property is set + */ + virtual bool IsSetStochasticDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Container for a stochastic distribution type which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochasticDistributionType : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStochasticDistributionType() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines a set of values with a defined probability + * + * @return value of model property probabilityDistributionSet + */ + virtual std::shared_ptr GetProbabilityDistributionSet() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a normal distribution. + * + * @return value of model property normalDistribution + */ + virtual std::shared_ptr GetNormalDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a log normal distribution. + * + * @return value of model property logNormalDistribution + */ + virtual std::shared_ptr GetLogNormalDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a uniform distribution. + * + * @return value of model property uniformDistribution + */ + virtual std::shared_ptr GetUniformDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a poisson distribution. + * + * @return value of model property poissonDistribution + */ + virtual std::shared_ptr GetPoissonDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a histogram. + * + * @return value of model property histogram + */ + virtual std::shared_ptr GetHistogram() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a user defined stochastic distribution. + * + * @return value of model property userDefinedDistribution + */ + virtual std::shared_ptr GetUserDefinedDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property probabilityDistributionSet is set + * @return true when the property is set + */ + virtual bool IsSetProbabilityDistributionSet() const = 0; + /** + * Retrieves whether property normalDistribution is set + * @return true when the property is set + */ + virtual bool IsSetNormalDistribution() const = 0; + /** + * Retrieves whether property logNormalDistribution is set + * @return true when the property is set + */ + virtual bool IsSetLogNormalDistribution() const = 0; + /** + * Retrieves whether property uniformDistribution is set + * @return true when the property is set + */ + virtual bool IsSetUniformDistribution() const = 0; + /** + * Retrieves whether property poissonDistribution is set + * @return true when the property is set + */ + virtual bool IsSetPoissonDistribution() const = 0; + /** + * Retrieves whether property histogram is set + * @return true when the property is set + */ + virtual bool IsSetHistogram() const = 0; + /** + * Retrieves whether property userDefinedDistribution is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Grouping of independent executable parts of a scenario. The name of a story must be unique within an OpenSCENARIO file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStory : public virtual IOpenScenarioModelElement, public IStoryboardElement + { + public: + virtual ~IStory() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the story, must be unique within an OpenSCENARIO file. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines the acts of the story. + * + * @return value of model property acts + */ + virtual std::vector> GetActs() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetActsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetActsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property acts is set + * @return true when the property is set + */ + virtual bool IsSetActs() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Top container for the dynamic content of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboard : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStoryboard() = default; + + /** + * From OpenSCENARIO class model specification: + * Initialization of the storyboard instance. Initial conditions are set and initial actions are applied to entities. + * + * @return value of model property init + */ + virtual std::shared_ptr GetInit() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * List of stories defined in a story board. + * + * @return value of model property stories + */ + virtual std::vector> GetStories() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * Trigger to stop the Storyboard instance. If no trigger is defined, the Storyboard will be never stopped. + * + * @return value of model property stopTrigger + */ + virtual std::shared_ptr GetStopTrigger() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetStoriesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetStoriesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property init is set + * @return true when the property is set + */ + virtual bool IsSetInit() const = 0; + /** + * Retrieves whether property stories is set + * @return true when the property is set + */ + virtual bool IsSetStories() const = 0; + /** + * Retrieves whether property stopTrigger is set + * @return true when the property is set + */ + virtual bool IsSetStopTrigger() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Considered true if a referenced storyboard element has reached a given runtime state (standbyState, runningState, + * completeState) or if the referenced storyboard element undergoes a specific transition (startTransition, stopTransition, + * endTransition, skipTransition) at a discrete time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboardElementStateCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IStoryboardElementStateCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * The state or the transition of the storyboard element instance for which the condition becomes true. + * + * @return value of model property state + */ + virtual StoryboardElementState GetState() const + { + return StoryboardElementState(); + } + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced Storyboard instance. + * + * @return value of model property storyboardElementRef + */ + virtual std::shared_ptr> GetStoryboardElementRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Type of storyboard element instance. + * + * @return value of model property storyboardElementType + */ + virtual StoryboardElementType GetStoryboardElementType() const + { + return StoryboardElementType(); + } + + + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + /** + * Retrieves whether property storyboardElementRef is set + * @return true when the property is set + */ + virtual bool IsSetStoryboardElementRef() const = 0; + /** + * Retrieves whether property storyboardElementType is set + * @return true when the property is set + */ + virtual bool IsSetStoryboardElementType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specification of sun properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISun : public virtual IOpenScenarioModelElement + { + public: + virtual ~ISun() = default; + + /** + * From OpenSCENARIO class model specification: + * Azimuth of the sun, counted clockwise, 0=north, PI/2 = east, PI=south, 3/2 PI=west. Unit: [rad]. Range: [0..2*PI]. + * + * @return value of model property azimuth + */ + virtual double GetAzimuth() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Solar elevation angle, 0=x/y plane, PI/2=zenith. Unit: [rad]. Range: [-PI..PI]. + * + * @return value of model property elevation + */ + virtual double GetElevation() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Illuminance of the sun, direct sunlight is around 100,000 lx. Unit: [lx]. Range: [0..inf[. Default if missing: 0. + * + * @return value of model property illuminance + */ + virtual double GetIlluminance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Illuminance of the sun, direct sunlight is around 100,000 lx. Unit: [lx]. Range: [0..inf[. + * + * @return value of model property intensity + */ + virtual double GetIntensity() const + { + return 0; + } + + + /** + * Retrieves whether property azimuth is set + * @return true when the property is set + */ + virtual bool IsSetAzimuth() const = 0; + /** + * Retrieves whether property elevation is set + * @return true when the property is set + */ + virtual bool IsSetElevation() const = 0; + /** + * Retrieves whether property illuminance is set + * @return true when the property is set + */ + virtual bool IsSetIlluminance() const = 0; + /** + * Retrieves whether property intensity is set + * @return true when the property is set + */ + virtual bool IsSetIntensity() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Synchronizes an entity's arrival at a destination with a master entity. Both entities are provided with their own + * reference position which shall be reached at the same time. Final speed can be specified. Note that the reference + * positions can be different or identical. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISynchronizeAction : public virtual IOpenScenarioModelElement, public IMotionControlAction + { + public: + virtual ~ISynchronizeAction() = default; + + /** + * From OpenSCENARIO class model specification: + * A reference to the master entity. + * + * @return value of model property masterEntityRef + */ + virtual std::shared_ptr> GetMasterEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given TargetPosition. Unit: [m]. Range: [0..inf[. + * + * @return value of model property targetTolerance + */ + virtual double GetTargetTolerance() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given TargetPositionMaster. Unit: [m]. Range: [0..inf[. + * + * @return value of model property targetToleranceMaster + */ + virtual double GetTargetToleranceMaster() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The target position for the master entity. + * + * @return value of model property targetPositionMaster + */ + virtual std::shared_ptr GetTargetPositionMaster() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The target position for the entity that should be synchronized. + * + * @return value of model property targetPosition + */ + virtual std::shared_ptr GetTargetPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The speed that the synchronized entity should have at its target position. + * + * @return value of model property finalSpeed + */ + virtual std::shared_ptr GetFinalSpeed() const + { + return nullptr; + } + + + /** + * Retrieves whether property masterEntityRef is set + * @return true when the property is set + */ + virtual bool IsSetMasterEntityRef() const = 0; + /** + * Retrieves whether property targetTolerance is set + * @return true when the property is set + */ + virtual bool IsSetTargetTolerance() const = 0; + /** + * Retrieves whether property targetToleranceMaster is set + * @return true when the property is set + */ + virtual bool IsSetTargetToleranceMaster() const = 0; + /** + * Retrieves whether property targetPositionMaster is set + * @return true when the property is set + */ + virtual bool IsSetTargetPositionMaster() const = 0; + /** + * Retrieves whether property targetPosition is set + * @return true when the property is set + */ + virtual bool IsSetTargetPosition() const = 0; + /** + * Retrieves whether property finalSpeed is set + * @return true when the property is set + */ + virtual bool IsSetFinalSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The distance between object and target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITargetDistanceSteadyState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITargetDistanceSteadyState() = default; + + /** + * From OpenSCENARIO class model specification: + * The distance. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property distance + */ + virtual double GetDistance() const + { + return 0; + } + + + /** + * Retrieves whether property distance is set + * @return true when the property is set + */ + virtual bool IsSetDistance() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The remaining time for object to reach target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITargetTimeSteadyState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITargetTimeSteadyState() = default; + + /** + * From OpenSCENARIO class model specification: + * The time to reach target position. Unit: [s]. Range: ]0..inf[. + * + * @return value of model property time + */ + virtual double GetTime() const + { + return 0; + } + + + /** + * Retrieves whether property time is set + * @return true when the property is set + */ + virtual bool IsSetTime() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specifying a target position an entity is teleported to. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITeleportAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITeleportAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The position the entity/entities are teleported to. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Condition based on the headway time between a triggering entity and a reference entity. The reference entity is assumed + * to be leading/ahead, so the triggering entity is trailing. TimeHeadway is calculated similar to TimeToCollision + * (distance divided by relative speed, no acceleration) with the following exception: For the relative speed only the + * speed of the triggering entity is considered but not the speed of the reference entity. This is because it doesn't + * matter where the reference entity moves, only the time it takes for the triggering entity to reach the current position + * of the reference entity is calculated. The logical operator used for comparison is defined by the rule attribute. The + * property "alongRoute" is deprecated. If "coordinateSystem" or "relativeDistanceType" are set, "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeHeadwayCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeHeadwayCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. + * + * @return value of model property alongRoute + */ + virtual bool GetAlongRoute() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity to which the time headway is computed. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr> GetEntityRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * True: time headway is measured using the distance between closest bounding box points. False: reference point distance + * is used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual RelativeDistanceType GetRelativeDistanceType() const + { + return RelativeDistanceType(); + } + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual RoutingAlgorithm GetRoutingAlgorithm() const + { + return RoutingAlgorithm(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * The time headway value. Unit: [s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property alongRoute is set + * @return true when the property is set + */ + virtual bool IsSetAlongRoute() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property relativeDistanceType is set + * @return true when the property is set + */ + virtual bool IsSetRelativeDistanceType() const = 0; + /** + * Retrieves whether property routingAlgorithm is set + * @return true when the property is set + */ + virtual bool IsSetRoutingAlgorithm() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the day and time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeOfDay : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeOfDay() = default; + + /** + * From OpenSCENARIO class model specification: + * If true, the timeofday is animated with progressing simulation time, e.g. in order to animate the position of the sun. + * + * @return value of model property animation + */ + virtual bool GetAnimation() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Datetime value. + * + * @return value of model property dateTime + */ + virtual DateTime GetDateTime() const + { + return {}; + } + + + /** + * Retrieves whether property animation is set + * @return true when the property is set + */ + virtual bool IsSetAnimation() const = 0; + /** + * Retrieves whether property dateTime is set + * @return true when the property is set + */ + virtual bool IsSetDateTime() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The logical expression is considered true if the simulated time and date verifies the specified relation rule (bigger + * than, smaller than, or equal to) relatively to a given time and date value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeOfDayCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeOfDayCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Datetime value for comparison. + * + * @return value of model property dateTime + */ + virtual DateTime GetDateTime() const + { + return {}; + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + + /** + * Retrieves whether property dateTime is set + * @return true when the property is set + */ + virtual bool IsSetDateTime() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines whether time information present in trajectories should be considered. If considered, it may be used as either + * absolute or relative time values. Moreover, a time offset or time scaling may be applied. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeReference : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeReference() = default; + + /** + * From OpenSCENARIO class model specification: + * This property indicates Timing information is neglected. + * + * @return value of model property none + */ + virtual std::shared_ptr GetNone() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * This property indicates timing information is taken into account. Its underlying properties allow specification of the + * time domain (absolute or relative), time scaling and a global time offset. + * + * @return value of model property timing + */ + virtual std::shared_ptr GetTiming() const + { + return nullptr; + } + + + /** + * Retrieves whether property none is set + * @return true when the property is set + */ + virtual bool IsSetNone() const = 0; + /** + * Retrieves whether property timing is set + * @return true when the property is set + */ + virtual bool IsSetTiming() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The currently predicted time to collision of a triggering entity/entities and either a reference entity or an explicit + * position is compared to a given time value. Time to collision is calculated as the distance divided by the relative + * speed. Acceleration of entities is not taken into consideration. For the relative speed calculation the same coordinate + * system and relative distance type applies as for the distance calculation. If the relative speed is negative, which + * means the entity is moving away from the position / the entities are moving away from each other, then the time to + * collision cannot be predicted and the condition evaluates to false. The logical operator for comparison is defined by + * the rule attribute. The property "alongRoute" is deprecated. If "coordinateSystem" or "relativeDistanceType" are set, + * "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeToCollisionCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeToCollisionCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. This + * value is ignored if "coordinateSystem" or "relativeDistanceType" is set. + * + * @return value of model property alongRoute + */ + virtual bool GetAlongRoute() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual CoordinateSystem GetCoordinateSystem() const + { + return CoordinateSystem(); + } + + /** + * From OpenSCENARIO class model specification: + * True: time to collision is measured using the distance between closest bounding box points. False: reference point + * distance is used. + * + * @return value of model property freespace + */ + virtual bool GetFreespace() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual RelativeDistanceType GetRelativeDistanceType() const + { + return RelativeDistanceType(); + } + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual RoutingAlgorithm GetRoutingAlgorithm() const + { + return RoutingAlgorithm(); + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * The time to collision value. Unit: [s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The explicit position or a position defined through the current position of a reference entity. + * + * @return value of model property timeToCollisionConditionTarget + */ + virtual std::shared_ptr GetTimeToCollisionConditionTarget() const + { + return nullptr; + } + + + /** + * Retrieves whether property alongRoute is set + * @return true when the property is set + */ + virtual bool IsSetAlongRoute() const = 0; + /** + * Retrieves whether property coordinateSystem is set + * @return true when the property is set + */ + virtual bool IsSetCoordinateSystem() const = 0; + /** + * Retrieves whether property freespace is set + * @return true when the property is set + */ + virtual bool IsSetFreespace() const = 0; + /** + * Retrieves whether property relativeDistanceType is set + * @return true when the property is set + */ + virtual bool IsSetRelativeDistanceType() const = 0; + /** + * Retrieves whether property routingAlgorithm is set + * @return true when the property is set + */ + virtual bool IsSetRoutingAlgorithm() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property timeToCollisionConditionTarget is set + * @return true when the property is set + */ + virtual bool IsSetTimeToCollisionConditionTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Target position used in the TimeToCollisionCondition. Can be defined as either an explicit position, or the position of + * a reference entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeToCollisionConditionTarget : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITimeToCollisionConditionTarget() = default; + + /** + * From OpenSCENARIO class model specification: + * Position. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual std::shared_ptr GetEntityRef() const + { + return nullptr; + } + + + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + /** + * Retrieves whether property entityRef is set + * @return true when the property is set + */ + virtual bool IsSetEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Adjust the timing within time references by scale and offset. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITiming : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITiming() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of time value context as either absolute or relative. + * + * @return value of model property domainAbsoluteRelative + */ + virtual ReferenceContext GetDomainAbsoluteRelative() const + { + return ReferenceContext(); + } + + /** + * From OpenSCENARIO class model specification: + * Introduction of a global offset for all time values. Unit: [s]. Range: ]-inf..inf[. + * + * @return value of model property offset + */ + virtual double GetOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Scaling factor for time values. While values smaller than 1.0 represent negative scaling, values larger than 1.0 will + * result in positive scaling. A value of 1.0 means no scaling. Range: ]0..inf[. + * + * @return value of model property scale + */ + virtual double GetScale() const + { + return 0; + } + + + /** + * Retrieves whether property domainAbsoluteRelative is set + * @return true when the property is set + */ + virtual bool IsSetDomainAbsoluteRelative() const = 0; + /** + * Retrieves whether property offset is set + * @return true when the property is set + */ + virtual bool IsSetOffset() const = 0; + /** + * Retrieves whether property scale is set + * @return true when the property is set + */ + virtual bool IsSetScale() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Actions defining macroscopic traffic flow and behavior. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the traffic that is created. This name can be referenced when stopping the traffic with StopTrafficAction. + * + * @return value of model property trafficName + */ + virtual std::string GetTrafficName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a source of traffic at a specific position. + * + * @return value of model property trafficSourceAction + */ + virtual std::shared_ptr GetTrafficSourceAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines a sink of traffic at a specific position. + * + * @return value of model property trafficSinkAction + */ + virtual std::shared_ptr GetTrafficSinkAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines swarm traffic around a given central entity. + * + * @return value of model property trafficSwarmAction + */ + virtual std::shared_ptr GetTrafficSwarmAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines traffic in a specific area. + * + * @return value of model property trafficAreaAction + */ + virtual std::shared_ptr GetTrafficAreaAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Stops traffic instances (area, swarm, source, sink). + * + * @return value of model property trafficStopAction + */ + virtual std::shared_ptr GetTrafficStopAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property trafficName is set + * @return true when the property is set + */ + virtual bool IsSetTrafficName() const = 0; + /** + * Retrieves whether property trafficSourceAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSourceAction() const = 0; + /** + * Retrieves whether property trafficSinkAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSinkAction() const = 0; + /** + * Retrieves whether property trafficSwarmAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSwarmAction() const = 0; + /** + * Retrieves whether property trafficAreaAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficAreaAction() const = 0; + /** + * Retrieves whether property trafficStopAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficStopAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the area, where the traffic shall be spawned. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficArea : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficArea() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines an area by a polygon. Suitable for urban areas, where all roads within an area shall be populated. + * + * @return value of model property polygon + */ + virtual std::shared_ptr GetPolygon() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines an area by one or multiple road ranges. Suitable for highways, where only a few specific roads shall be + * populated. + * + * @return value of model property roadRange + */ + virtual std::vector> GetRoadRange() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetRoadRangeSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetRoadRangeAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property polygon is set + * @return true when the property is set + */ + virtual bool IsSetPolygon() const = 0; + /** + * Retrieves whether property roadRange is set + * @return true when the property is set + */ + virtual bool IsSetRoadRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines traffic in a specific area. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficAreaAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficAreaAction() = default; + + /** + * From OpenSCENARIO class model specification: + * If false, then traffic shall be only spawned once when the action is started and the action ends immediately. If true, + * then continuously the spawned traffic is despawned when it leaves the area and new traffic is spawned in the area to + * keep a constant number of entities. + * + * @return value of model property continuous + */ + virtual bool GetContinuous() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * The maximum number of spawned entities in the area. Depending on the size of the area and the available spawning + * positions on the included roads, less than numberOfEntities might be set up. Range: [0..inf[. + * + * @return value of model property numberOfEntities + */ + virtual uint32_t GetNumberOfEntities() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the entity and controller distribution for the traffic. + * + * @return value of model property trafficDistribution + */ + virtual std::shared_ptr GetTrafficDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the area, where the traffic shall be spawned. + * + * @return value of model property trafficArea + */ + virtual std::shared_ptr GetTrafficArea() const + { + return nullptr; + } + + + /** + * Retrieves whether property continuous is set + * @return true when the property is set + */ + virtual bool IsSetContinuous() const = 0; + /** + * Retrieves whether property numberOfEntities is set + * @return true when the property is set + */ + virtual bool IsSetNumberOfEntities() const = 0; + /** + * Retrieves whether property trafficDistribution is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDistribution() const = 0; + /** + * Retrieves whether property trafficArea is set + * @return true when the property is set + */ + virtual bool IsSetTrafficArea() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of macroscopic traffic based on vehicle and controller definitions. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDefinition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficDefinition() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the traffic definition. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle categories within the traffic. + * + * @return value of model property vehicleCategoryDistribution + */ + virtual std::shared_ptr GetVehicleCategoryDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle roles within the traffic. + * + * @return value of model property vehicleRoleDistribution + */ + virtual std::shared_ptr GetVehicleRoleDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Distribution of controllers within this traffic. + * + * @return value of model property controllerDistribution + */ + virtual std::shared_ptr GetControllerDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property vehicleCategoryDistribution is set + * @return true when the property is set + */ + virtual bool IsSetVehicleCategoryDistribution() const = 0; + /** + * Retrieves whether property vehicleRoleDistribution is set + * @return true when the property is set + */ + virtual bool IsSetVehicleRoleDistribution() const = 0; + /** + * Retrieves whether property controllerDistribution is set + * @return true when the property is set + */ + virtual bool IsSetControllerDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of a traffic source/swarm including their controllers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted vehicle/pedestrian entity groups as part of the traffic. + * + * @return value of model property trafficDistributionEntry + */ + virtual std::vector> GetTrafficDistributionEntry() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetTrafficDistributionEntrySize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetTrafficDistributionEntryAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property trafficDistributionEntry is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDistributionEntry() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines one weighted vehicle/pedestrian entity group as part of the traffic. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDistributionEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficDistributionEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The weight of this entity group within the traffic distribution. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The entity group within the traffic distribution. + * + * @return value of model property entityDistribution + */ + virtual std::shared_ptr GetEntityDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Describing tool specific properties for spawning of the entity group (e.g. spawn only on the rightmost lane for a truck + * group, overwrite speed range for slower vehicles/trucks). + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + /** + * Retrieves whether property entityDistribution is set + * @return true when the property is set + */ + virtual bool IsSetEntityDistribution() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Action used to change the state of a traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Action used to set a semantic phase of a TrafficSignalController. + * + * @return value of model property trafficSignalControllerAction + */ + virtual std::shared_ptr GetTrafficSignalControllerAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Action used to control the observable state of a signal. + * + * @return value of model property trafficSignalStateAction + */ + virtual std::shared_ptr GetTrafficSignalStateAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property trafficSignalControllerAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalControllerAction() const = 0; + /** + * Retrieves whether property trafficSignalStateAction is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalStateAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Considered true if a referenced traffic signal (e.g. from an OpenDRIVE file) reaches a specific observable state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * ID of the referenced signal in a road network file. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Observable state of the signal to be reached for the condition to become true. + * + * @return value of model property state + */ + virtual std::string GetState() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The TrafficSignalController provides a signal cycle to a single signal or a signal group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalController : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalController() = default; + + /** + * From OpenSCENARIO class model specification: + * The delay to the controller in the reference property. A controller having a delay to another one means that its first + * phase virtually starts delaytime seconds after the start of the reference's first phase. This can be used to define a + * progressive signal system, but only makes sense, if the total times of all connected controllers are the same. If delay + * is set, reference is required. Unit: [s]. Range: [0..inf[. + * + * @return value of model property delay + */ + virtual double GetDelay() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * ID of the TrafficSignalController for reference within the scenario and the reference to an OpenDRIVE signal group ID. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * A reference (ID) to a TrafficSignalController. If reference is set, a delay is required. + * + * @return value of model property reference + */ + virtual std::string GetReference() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Semantic phases of a TrafficSignalController, forming the signal cycle. + * + * @return value of model property phases + */ + virtual std::vector> GetPhases() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPhasesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPhasesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property delay is set + * @return true when the property is set + */ + virtual bool IsSetDelay() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property reference is set + * @return true when the property is set + */ + virtual bool IsSetReference() const = 0; + /** + * Retrieves whether property phases is set + * @return true when the property is set + */ + virtual bool IsSetPhases() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Sets a specific semantic phase of a traffic signal controller, typically affecting a signal group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalControllerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalControllerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Targeted phase of the signal controller. + * + * @return value of model property phase + */ + virtual std::string GetPhase() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * ID of the signal controller in a road network. + * + * @return value of model property trafficSignalControllerRef + */ + virtual std::shared_ptr> GetTrafficSignalControllerRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The reference to the semantic phase (phase is the referential key in the referenced TrafficSignalController). + * + * @return value of model property phaseRef + */ + virtual std::vector> GetPhaseRef() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPhaseRefSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPhaseRefAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property phase is set + * @return true when the property is set + */ + virtual bool IsSetPhase() const = 0; + /** + * Retrieves whether property trafficSignalControllerRef is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalControllerRef() const = 0; + /** + * Retrieves whether property phaseRef is set + * @return true when the property is set + */ + virtual bool IsSetPhaseRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Considered true if a given TrafficSignalController (which shall be defined within OpenSCENARIO) reaches a specific + * semantic phase. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalControllerCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalControllerCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced phase of the TrafficSignalController to be reached for the condition to become true. + * + * @return value of model property phase + */ + virtual std::string GetPhase() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced TrafficSignalController. + * + * @return value of model property trafficSignalControllerRef + */ + virtual std::shared_ptr> GetTrafficSignalControllerRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * The reference to the semantic phase (phase is the referential key in the referenced TrafficSignalController). + * + * @return value of model property phaseRef + */ + virtual std::vector> GetPhaseRef() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPhaseRefSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPhaseRefAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property phase is set + * @return true when the property is set + */ + virtual bool IsSetPhase() const = 0; + /** + * Retrieves whether property trafficSignalControllerRef is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalControllerRef() const = 0; + /** + * Retrieves whether property phaseRef is set + * @return true when the property is set + */ + virtual bool IsSetPhaseRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Observable state of a traffic signal group within one semantic phase. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalGroupState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalGroupState() = default; + + /** + * From OpenSCENARIO class model specification: + * Observable state of all signals controlled by this TrafficSignalController, e.g. the visual information "off;off;on". + * The number of values in the state depends on the traffic signal in the roadnetwork , e.g. type and subtype in OpenDRIVE + * + * @return value of model property state + */ + virtual std::string GetState() const + { + return ""; + } + + + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * State of a traffic signal for this phase. One state per phase and traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalState : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalState() = default; + + /** + * From OpenSCENARIO class model specification: + * Observable state of the signal, e.g. "off;off;on". The number of values in the state depends on the traffic signal in + * the roadnetwork , e.g. type and subtype in OpenDRIVE + * + * @return value of model property state + */ + virtual std::string GetState() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * ID of the referenced signal in a road network file. + * + * @return value of model property trafficSignalId + */ + virtual std::string GetTrafficSignalId() const + { + return ""; + } + + + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + /** + * Retrieves whether property trafficSignalId is set + * @return true when the property is set + */ + virtual bool IsSetTrafficSignalId() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Controls the observable state of a traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalStateAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSignalStateAction() = default; + + /** + * From OpenSCENARIO class model specification: + * ID of a signal in a road network file. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Targeted state of the signal. The number of light bulbs, i.e. observable states can be derived from the type of the + * dynamic signal in the road network file. + * + * @return value of model property state + */ + virtual std::string GetState() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property state is set + * @return true when the property is set + */ + virtual bool IsSetState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a sink of traffic at a specific position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSinkAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSinkAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the radius of the traffic sink where vehicles disappear around the specified position. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property radius + */ + virtual double GetRadius() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the rate on which vehicles disappear at the sinks location. If omitted, rate is interpreted as 'inf'. Unit: + * [vehicles/s]. Range: [0..inf[. + * + * @return value of model property rate + */ + virtual double GetRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic sink. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the sink. + * + * @return value of model property trafficDefinition + */ + virtual std::shared_ptr GetTrafficDefinition() const + { + return nullptr; + } + + + /** + * Retrieves whether property radius is set + * @return true when the property is set + */ + virtual bool IsSetRadius() const = 0; + /** + * Retrieves whether property rate is set + * @return true when the property is set + */ + virtual bool IsSetRate() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + /** + * Retrieves whether property trafficDefinition is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDefinition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a source of traffic at a specific position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSourceAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSourceAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the radius of the traffic source where vehicles appear around the specific position. Unit: [m]. Range: [0..inf[. + * + * @return value of model property radius + */ + virtual double GetRadius() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the rate on which vehicles appear at the source location. Unit: [vehicles/s]. Range: [0..inf[. + * + * @return value of model property rate + */ + virtual double GetRate() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The optional starting speed of a scenario object. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property speed + */ + virtual double GetSpeed() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The optional starting velocity of a scenario object. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property velocity + */ + virtual double GetVelocity() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic source. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the source. + * + * @return value of model property trafficDefinition + */ + virtual std::shared_ptr GetTrafficDefinition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic source including their controllers. + * + * @return value of model property trafficDistribution + */ + virtual std::shared_ptr GetTrafficDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property radius is set + * @return true when the property is set + */ + virtual bool IsSetRadius() const = 0; + /** + * Retrieves whether property rate is set + * @return true when the property is set + */ + virtual bool IsSetRate() const = 0; + /** + * Retrieves whether property speed is set + * @return true when the property is set + */ + virtual bool IsSetSpeed() const = 0; + /** + * Retrieves whether property velocity is set + * @return true when the property is set + */ + virtual bool IsSetVelocity() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + /** + * Retrieves whether property trafficDefinition is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDefinition() const = 0; + /** + * Retrieves whether property trafficDistribution is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This action stops one or more traffic instances. The instances to be stopped are identified by their name. All active + * traffic instances with this name are stopped. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficStopAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficStopAction() = default; + + + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines swarm traffic within an elliptical planview around a given central entity. The innerRadius defines the minimum + * distance between the central vehicle and swarm traffic. The latter is set up in the free space between the circular area + * defined by innerRadius and the outline of the ellipsis defined by the two semi axis attributes. While vehicles are + * created in this area, they are removed if they leave it crossing the it ellipsis’ outline. Within the innerRadius, + * vehicles are neither set up nor removed. Optionally, the swarm area can be longitudinally offset to the central scenario + * object. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSwarmAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrafficSwarmAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Radius of the inner circular area around the central entity. Unit: [m]. Range: [0..inf[. + * + * @return value of model property innerRadius + */ + virtual double GetInnerRadius() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The maximum number of vehicles surrounding the central entity. Depending on the current road situation less than + * numberOfVehicles might be set up. Range: [0..inf[. + * + * @return value of model property numberOfVehicles + */ + virtual uint32_t GetNumberOfVehicles() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Offset in longitudinal direction related to the x-axis of the central entity. Unit: [m]. + * + * @return value of model property offset + */ + virtual double GetOffset() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Shape of the swarm traffic distribution area is given as an ellipsis around a central entity. SemiMajorAxis defines the + * half length of the major axis of this ellipsis. Unit: [m]. Range: [0..inf[. + * + * @return value of model property semiMajorAxis + */ + virtual double GetSemiMajorAxis() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Shape of the swarm traffic distribution area is given as an ellipsis around a central entity. SemiMinorAxis defines the + * half length of the minor axis of this ellipsis. Unit: [m]. Range: [0..inf[. + * + * @return value of model property semiMinorAxis + */ + virtual double GetSemiMinorAxis() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The optional starting velocity of the created entities. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property velocity + */ + virtual double GetVelocity() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The entity that represents the center of a swarm. + * + * @return value of model property centralObject + */ + virtual std::shared_ptr GetCentralObject() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Specifies properties of autonomous traffic with respect to vehicle and driver distributions. + * + * @return value of model property trafficDefinition + */ + virtual std::shared_ptr GetTrafficDefinition() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic swarm including their controllers. + * + * @return value of model property trafficDistribution + */ + virtual std::shared_ptr GetTrafficDistribution() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * The optional starting speeds of the created entities. Unit: [m/s]; Range for lower and upper limit: [0..inf[. + * Distributed uniformly/equally. + * + * @return value of model property initialSpeedRange + */ + virtual std::shared_ptr GetInitialSpeedRange() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle directions of travel relative to the centralObject. If omitted, direction of travel is + * distributed uniformly. + * + * @return value of model property directionOfTravelDistribution + */ + virtual std::shared_ptr GetDirectionOfTravelDistribution() const + { + return nullptr; + } + + + /** + * Retrieves whether property innerRadius is set + * @return true when the property is set + */ + virtual bool IsSetInnerRadius() const = 0; + /** + * Retrieves whether property numberOfVehicles is set + * @return true when the property is set + */ + virtual bool IsSetNumberOfVehicles() const = 0; + /** + * Retrieves whether property offset is set + * @return true when the property is set + */ + virtual bool IsSetOffset() const = 0; + /** + * Retrieves whether property semiMajorAxis is set + * @return true when the property is set + */ + virtual bool IsSetSemiMajorAxis() const = 0; + /** + * Retrieves whether property semiMinorAxis is set + * @return true when the property is set + */ + virtual bool IsSetSemiMinorAxis() const = 0; + /** + * Retrieves whether property velocity is set + * @return true when the property is set + */ + virtual bool IsSetVelocity() const = 0; + /** + * Retrieves whether property centralObject is set + * @return true when the property is set + */ + virtual bool IsSetCentralObject() const = 0; + /** + * Retrieves whether property trafficDefinition is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDefinition() const = 0; + /** + * Retrieves whether property trafficDistribution is set + * @return true when the property is set + */ + virtual bool IsSetTrafficDistribution() const = 0; + /** + * Retrieves whether property initialSpeedRange is set + * @return true when the property is set + */ + virtual bool IsSetInitialSpeedRange() const = 0; + /** + * Retrieves whether property directionOfTravelDistribution is set + * @return true when the property is set + */ + virtual bool IsSetDirectionOfTravelDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a trailer to be towed. The included or referred ScenarioObject must include an EntityObject of type + * Vehicle. The Vehicle must have a trailerCoupler in order for the connection to be complete. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailer : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrailer() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of a trailer vehicle (inline or catalog reference). + * + * @return value of model property trailer + */ + virtual std::shared_ptr GetTrailer() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the trailer vehicle. + * + * @return value of model property trailerRef + */ + virtual std::shared_ptr GetTrailerRef() const + { + return nullptr; + } + + + /** + * Retrieves whether property trailer is set + * @return true when the property is set + */ + virtual bool IsSetTrailer() const = 0; + /** + * Retrieves whether property trailerRef is set + * @return true when the property is set + */ + virtual bool IsSetTrailerRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Action to connect or disconnect trailer. Applied to the towing vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrailerAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Connect a trailer to a vehicle. Any other already connected trailer will be disconnected. + * + * @return value of model property connectTrailerAction + */ + virtual std::shared_ptr GetConnectTrailerAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Disconnect any connected trailer from a vehicle. + * + * @return value of model property disconnectTrailerAction + */ + virtual std::shared_ptr GetDisconnectTrailerAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property connectTrailerAction is set + * @return true when the property is set + */ + virtual bool IsSetConnectTrailerAction() const = 0; + /** + * Retrieves whether property disconnectTrailerAction is set + * @return true when the property is set + */ + virtual bool IsSetDisconnectTrailerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the mounting point for connecting the trailer to a towing vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerCoupler : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrailerCoupler() = default; + + /** + * From OpenSCENARIO class model specification: + * Relative position of the trailerCoupler in the x axis, using the coordinate system of the vehicle. + * + * @return value of model property dx + */ + virtual double GetDx() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the vehicle. If omitted, z of the towing vehicle's hitch + * will be applied. If neither hitch nor coupler has a z value, a 2D connection will be applied, constrained to rotation in + * the XY-plane. + * + * @return value of model property dz + */ + virtual double GetDz() const + { + return 0; + } + + + /** + * Retrieves whether property dx is set + * @return true when the property is set + */ + virtual bool IsSetDx() const = 0; + /** + * Retrieves whether property dz is set + * @return true when the property is set + */ + virtual bool IsSetDz() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the mounting point for connecting a trailer to the vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerHitch : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrailerHitch() = default; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the x axis, using the coordinate system of the vehicle. + * + * @return value of model property dx + */ + virtual double GetDx() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the vehicle. If omitted, z of the trailer's coupler will + * be applied. If neither hitch nor coupler has a z value, a 2D connection will be applied, constrained to rotation in the + * XY-plane. + * + * @return value of model property dz + */ + virtual double GetDz() const + { + return 0; + } + + + /** + * Retrieves whether property dx is set + * @return true when the property is set + */ + virtual bool IsSetDx() const = 0; + /** + * Retrieves whether property dz is set + * @return true when the property is set + */ + virtual bool IsSetDz() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a trajectory type in terms of shape and optional time domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectory : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~ITrajectory() = default; + + /** + * From OpenSCENARIO class model specification: + * If 'true', then the trajectory forms a loop, where the end of the trajectory is connected to the start of the trajectory + * by a straight line. For continuous derivatives of this segment, end and start point can also be at the same position and + * form a zero-length segment. A FollowTrajectoryAction with a closed trajectory doesn't end regularly but has to be + * stopped. If 'true' then the timing information in the trajectory cannot be used as absolute values. + * + * @return value of model property closed + */ + virtual bool GetClosed() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the trajectory type. Required if used in catalog. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * The shape of a trajectory (Polyline, Clothoid or Nurbs) + * + * @return value of model property shape + */ + virtual std::shared_ptr GetShape() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property closed is set + * @return true when the property is set + */ + virtual bool IsSetClosed() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property shape is set + * @return true when the property is set + */ + virtual bool IsSetShape() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up trajectory catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrajectoryCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Used to define a steering trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryFollowingMode : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrajectoryFollowingMode() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the (lateral) trajectory following behavior of the actor: Mode 'position' forces the actor to strictly adhere to + * the trajectory. In contrast, mode 'follow' hands over control to the actor. In this mode, the actor tries to follow the + * trajectory as best as he can. This may be restricted by dynamics constraints and/or control loop implementation. In mode + * 'follow' the resulting path of the entity is not guaranteed to be identical for every simulation environment. + * + * @return value of model property followingMode + */ + virtual FollowingMode GetFollowingMode() const + { + return FollowingMode(); + } + + + /** + * Retrieves whether property followingMode is set + * @return true when the property is set + */ + virtual bool IsSetFollowingMode() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a trajectory type in terms of shape and optional time domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrajectoryPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * Represents the s coordinate from the start of the trajectory. Unit: [m]. Range: [0..arclength of the trajectory]. + * + * @return value of model property s + */ + virtual double GetS() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Represents the t coordinate orthogonal to the arclength of the trajectory. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property t + */ + virtual double GetT() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the reference trajectory. Only the Heading angle at the target position on the (s,t)-plane can be arbitrarily + * specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to the tangent + * to the reference trajectory s-axis at the point with the target s-coordinate. The Heading is counted from this imaginary + * axis. +If the reference trajectory s-axis shape contains sharp "kinks" (e.g., vertices on the polyline shape), the + * relative reference context with respect to such points cannot be interpreted within the OpenSCENARIO standard. +Missing + * Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual std::shared_ptr GetOrientation() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory the position is calculated from. + * + * @return value of model property trajectoryRef + */ + virtual std::shared_ptr GetTrajectoryRef() const + { + return nullptr; + } + + + /** + * Retrieves whether property s is set + * @return true when the property is set + */ + virtual bool IsSetS() const = 0; + /** + * Retrieves whether property t is set + * @return true when the property is set + */ + virtual bool IsSetT() const = 0; + /** + * Retrieves whether property orientation is set + * @return true when the property is set + */ + virtual bool IsSetOrientation() const = 0; + /** + * Retrieves whether property trajectoryRef is set + * @return true when the property is set + */ + virtual bool IsSetTrajectoryRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines a reference to a trajectory. Either an inline definition of a trajectory or a trajectory in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryRef : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrajectoryRef() = default; + + /** + * From OpenSCENARIO class model specification: + * A trajectory definition. + * + * @return value of model property trajectory + */ + virtual std::shared_ptr GetTrajectory() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to a trajectory in a catalog. + * + * @return value of model property catalogReference + */ + virtual std::shared_ptr GetCatalogReference() const + { + return nullptr; + } + + + /** + * Retrieves whether property trajectory is set + * @return true when the property is set + */ + virtual bool IsSetTrajectory() const = 0; + /** + * Retrieves whether property catalogReference is set + * @return true when the property is set + */ + virtual bool IsSetCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Specifies the dynamics of a value transition and defines how the value changes over time or distance. Different shapes + * can be used for the transition. Step is an immediate transition, i.e. a jump from the current current value to the + * target value. In this case value for time or distance must be 0. Linear will result in a linear transition between the + * start and end value. A smooth transition is only given with cubic and sinusoidal shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITransitionDynamics : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITransitionDynamics() = default; + + /** + * From OpenSCENARIO class model specification: + * The semantics of the value: 'rate', 'time' or 'distance'. + * + * @return value of model property dynamicsDimension + */ + virtual DynamicsDimension GetDynamicsDimension() const + { + return DynamicsDimension(); + } + + /** + * From OpenSCENARIO class model specification: + * The shape of the transition function f(x) between current and target value. + * + * @return value of model property dynamicsShape + */ + virtual DynamicsShape GetDynamicsShape() const + { + return DynamicsShape(); + } + + /** + * From OpenSCENARIO class model specification: + * Defines the shape following behavior of the actor: Mode 'position' forces the actor to strictly adhere to a given shape. + * In contrast, in mode 'follow' the actor tries to follow the shape as best as it can. This may be restricted by the + * 'Performance' properties (for vehicles), dynamic constraints of an external agent (if the actor is not controlled by the + * default controller) and/or control loop implementation. In mode 'follow' the resulting path of the entity is not + * guaranteed to be identical for every simulation environment. Default value if omitted: position + * + * @return value of model property followingMode + */ + virtual FollowingMode GetFollowingMode() const + { + return FollowingMode(); + } + + /** + * From OpenSCENARIO class model specification: + * The value for a predefined rate (Unit: [delta/s]), time (Unit: [s]) or distance (Unit: [m]) to acquire the target value. + * Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property dynamicsDimension is set + * @return true when the property is set + */ + virtual bool IsSetDynamicsDimension() const = 0; + /** + * Retrieves whether property dynamicsShape is set + * @return true when the property is set + */ + virtual bool IsSetDynamicsShape() const = 0; + /** + * Retrieves whether property followingMode is set + * @return true when the property is set + */ + virtual bool IsSetFollowingMode() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Logical expression in condition becomes true after the triggering entity/entities have traveled the given distance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITraveledDistanceCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITraveledDistanceCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Amount of traveled distance. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A trigger is defined as an association of condition groups. A trigger evaluates to true if at least one of the + * associated condition groups evaluates to true, otherwise it evaluates to false (OR operation). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrigger : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITrigger() = default; + + /** + * From OpenSCENARIO class model specification: + * List of condition groups as a container of conditions. Omitting this attribute is deprecated. + * + * @return value of model property conditionGroups + */ + virtual std::vector> GetConditionGroups() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetConditionGroupsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetConditionGroupsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property conditionGroups is set + * @return true when the property is set + */ + virtual bool IsSetConditionGroups() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A collection of entities evaluated for an EntityCondition to be triggered. It is optional whether the condition must be + * fulfilled any or all of the objects. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITriggeringEntities : public virtual IOpenScenarioModelElement + { + public: + virtual ~ITriggeringEntities() = default; + + /** + * From OpenSCENARIO class model specification: + * All or any. + * + * @return value of model property triggeringEntitiesRule + */ + virtual TriggeringEntitiesRule GetTriggeringEntitiesRule() const + { + return TriggeringEntitiesRule(); + } + + /** + * From OpenSCENARIO class model specification: + * List of referenced entities that trigger the condition. + * + * @return value of model property entityRefs + */ + virtual std::vector> GetEntityRefs() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetEntityRefsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetEntityRefsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property triggeringEntitiesRule is set + * @return true when the property is set + */ + virtual bool IsSetTriggeringEntitiesRule() const = 0; + /** + * Retrieves whether property entityRefs is set + * @return true when the property is set + */ + virtual bool IsSetEntityRefs() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Uniform distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUniformDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUniformDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and upper limit of the uniform distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual std::shared_ptr GetRange() const + { + return nullptr; + } + + + /** + * Retrieves whether property range is set + * @return true when the property is set + */ + virtual bool IsSetRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The area that is used by the entities. When using big road network and/or scene files (several GB, e.g. for whole + * Europe), a simulator shall not load the whole road network for performance reasons. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUsedArea : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUsedArea() = default; + + /** + * From OpenSCENARIO class model specification: + * Definition of the used area. A minimum of 2 positions needs to be provided. + * + * @return value of model property positions + */ + virtual std::vector> GetPositions() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetPositionsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetPositionsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property positions is set + * @return true when the property is set + */ + virtual bool IsSetPositions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Used to either issue a command to the simulation environment (e.g. test software, system under test, simulation models) + * or start an external script. Allows the user to activate custom actions in their simulation user software. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The available commands are subject of a contract between simulation environment provider and scenario author. + * + * @return value of model property customCommandAction + */ + virtual std::shared_ptr GetCustomCommandAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property customCommandAction is set + * @return true when the property is set + */ + virtual bool IsSetCustomCommandAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of user defined animation types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedAnimation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedAnimation() = default; + + /** + * From OpenSCENARIO class model specification: + * The available user defined animation types are subject of a contract between simulation environment provider and + * scenario author. + * + * @return value of model property userDefinedAnimationType + */ + virtual std::string GetUserDefinedAnimationType() const + { + return ""; + } + + + /** + * Retrieves whether property userDefinedAnimationType is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedAnimationType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type of the user defined component. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedComponent : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedComponent() = default; + + /** + * From OpenSCENARIO class model specification: + * User defined component type. + * + * @return value of model property userDefinedComponentType + */ + virtual std::string GetUserDefinedComponentType() const + { + return ""; + } + + + /** + * Retrieves whether property userDefinedComponentType is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedComponentType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Indicates a user defined distribution which can be deterministic or stochastic. This distribution contains a property + * with the name type and some user defined content. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * User defined content. + * + * @return value of model property content + */ + virtual std::string GetContent() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the UserDefinedDistribution + * + * @return value of model property type + */ + virtual std::string GetType() const + { + return ""; + } + + + /** + * Retrieves whether property content is set + * @return true when the property is set + */ + virtual bool IsSetContent() const = 0; + /** + * Retrieves whether property type is set + * @return true when the property is set + */ + virtual bool IsSetType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of user defined light types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedLight : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedLight() = default; + + /** + * From OpenSCENARIO class model specification: + * The available user defined light types are subject of a contract between simulation environment provider and scenario + * author. + * + * @return value of model property userDefinedLightType + */ + virtual std::string GetUserDefinedLightType() const + { + return ""; + } + + + /** + * Retrieves whether property userDefinedLightType is set + * @return true when the property is set + */ + virtual bool IsSetUserDefinedLightType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * This condition acts as a wrapper for external custom conditions which are implemented in the simulation user software. + * It can compare e.g. complex types, which are not covered by the primitive types of OpenSCENARIO (boolean, int, + * double...). This condition is considered true if the given external value verifies the specified relation rule (<, + * <=, ==, >=, >) relatively to the provided reference value. +The external value can only be set from outside the + * scenario. Therefore this condition creates an interface from the scenario to the simulator or other components (e.g. + * test software, test case, system under test or simulation models). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedValueCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IUserDefinedValueCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the external value. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Reference value the external value is compared to. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Value constraints represent a single rule to a given parameter in a parameter declaration. Note that value must match + * the type of the enclosing parameter declaration. A ValueConstraint for parameter declaration of type "string" must use + * either "equalTo" or "notEqualTo" for the rule property. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueConstraint : public virtual IOpenScenarioModelElement + { + public: + virtual ~IValueConstraint() = default; + + /** + * From OpenSCENARIO class model specification: + * Available operators for the validation of the constraint. Note that either "equalTo" or "notEqualTo" must be used in + * parameter declarations of type "string". + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * A constant value, parameter or parameter expression. The value must match the type of the enclosing parameter + * declaration. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A ValueConstraintGroup represents a set of logical constraints which need to evaluate to true for a defined parameter + * value to start the simulation. A constraint group needs to have at least one constraint. +Multiple constraint groups are + * combined by an OR. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueConstraintGroup : public virtual IOpenScenarioModelElement + { + public: + virtual ~IValueConstraintGroup() = default; + + /** + * From OpenSCENARIO class model specification: + * Defines one or more constraints for a constraint group. Multiple constraints are combined by an AND. + * + * @return value of model property constraints + */ + virtual std::vector> GetConstraints() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetConstraintsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetConstraintsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property constraints is set + * @return true when the property is set + */ + virtual bool IsSetConstraints() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Deterministic multi-parameter distribution, where one or multiple sets of parameter values can be defined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueSetDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IValueSetDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * Set of parameter values that have to be assigned for a single concrete scenario. + * + * @return value of model property parameterValueSets + */ + virtual std::vector> GetParameterValueSets() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterValueSetsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterValueSetsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property parameterValueSets is set + * @return true when the property is set + */ + virtual bool IsSetParameterValueSets() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Set or modify a variable. (Be aware of the data type). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the variable. + * + * @return value of model property variableRef + */ + virtual std::shared_ptr> GetVariableRef() const + { + return std::make_shared>(); + } + + /** + * From OpenSCENARIO class model specification: + * New value for the variable. + * + * @return value of model property setAction + */ + virtual std::shared_ptr GetSetAction() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the variable (Add value or multiply by value). + * + * @return value of model property modifyAction + */ + virtual std::shared_ptr GetModifyAction() const + { + return nullptr; + } + + + /** + * Retrieves whether property variableRef is set + * @return true when the property is set + */ + virtual bool IsSetVariableRef() const = 0; + /** + * Retrieves whether property setAction is set + * @return true when the property is set + */ + virtual bool IsSetSetAction() const = 0; + /** + * Retrieves whether property modifyAction is set + * @return true when the property is set + */ + virtual bool IsSetModifyAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines an addition of a value to a variable as part of a ModifyRule. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableAddValueRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableAddValueRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Add value to existing variable. + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Compares a named variable's value to a reference value. The logical operator used for comparison is defined by the rule + * attribute. Less and greater operators will only be supported if the value given as string can unambiguously be converted + * into a scalar value (e.g. value=5, value=16.667). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableCondition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableCondition() = default; + + /** + * From OpenSCENARIO class model specification: + * The operator (<, <=, ==, >=, >). + * + * @return value of model property rule + */ + virtual Rule GetRule() const + { + return Rule(); + } + + /** + * From OpenSCENARIO class model specification: + * Value to which the value of the variable shall be compared to. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the variable that must be defined. + * + * @return value of model property variableRef + */ + virtual std::shared_ptr> GetVariableRef() const + { + return std::make_shared>(); + } + + + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property variableRef is set + * @return true when the property is set + */ + virtual bool IsSetVariableRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Declaration of a typed variable with a name and a default value. Its value can change during runtime either from within + * the scenario (OSC Model instance) by using a VariableAction or can be also set from external side, e.g. by a test + * software. For this the Simulator Core needs to provide an interface to change variable values. The value can be used to + * either trigger Events in the scenario with VariableConditions or it can be used on external side, e.g. a test software + * to trigger test steps. For this the Simulator Core needs to provide an interface to read the variable values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableDeclaration : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableDeclaration() = default; + + /** + * From OpenSCENARIO class model specification: + * Name of the variable. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Initialization value of the variable (must be convertible to variableType). + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Type of the variable. + * + * @return value of model property variableType + */ + virtual ParameterType GetVariableType() const + { + return ParameterType(); + } + + + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + /** + * Retrieves whether property variableType is set + * @return true when the property is set + */ + virtual bool IsSetVariableType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Modify a variable according to given rules. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableModifyAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableModifyAction() = default; + + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a variable or multiply a variable by a value. Has to match the variable type. + * + * @return value of model property rule + */ + virtual std::shared_ptr GetRule() const + { + return nullptr; + } + + + /** + * Retrieves whether property rule is set + * @return true when the property is set + */ + virtual bool IsSetRule() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Enclosing type for either adding a value to a variable or multiply the variable by a value. Has to be match the variable + * type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableModifyRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableModifyRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Adding a value to a variable. + * + * @return value of model property addValue + */ + virtual std::shared_ptr GetAddValue() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Multiply a variable by a value. + * + * @return value of model property multiplyByValue + */ + virtual std::shared_ptr GetMultiplyByValue() const + { + return nullptr; + } + + + /** + * Retrieves whether property addValue is set + * @return true when the property is set + */ + virtual bool IsSetAddValue() const = 0; + /** + * Retrieves whether property multiplyByValue is set + * @return true when the property is set + */ + virtual bool IsSetMultiplyByValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Multiply a variable by a value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableMultiplyByValueRule : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableMultiplyByValueRule() = default; + + /** + * From OpenSCENARIO class model specification: + * Multiply existing variable by the value (be aware of the variable data type). + * + * @return value of model property value + */ + virtual double GetValue() const + { + return 0; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Setting a variable to a given value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableSetAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVariableSetAction() = default; + + /** + * From OpenSCENARIO class model specification: + * The new value for the variable. + * + * @return value of model property value + */ + virtual std::string GetValue() const + { + return ""; + } + + + /** + * Retrieves whether property value is set + * @return true when the property is set + */ + virtual bool IsSetValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a vehicle type in a scenario or in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicle : public virtual IOpenScenarioModelElement, public ICatalogElement + { + public: + virtual ~IVehicle() = default; + + /** + * From OpenSCENARIO class model specification: + * The mass of a vehicle. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual double GetMass() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the vehicle as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual std::string GetModel3d() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Name of the vehicle type. + * + * @return value of model property name + */ + virtual std::string GetName() const + { + return ""; + } + + /** + * From OpenSCENARIO class model specification: + * Role of the vehicle (ambulance, police,...). The default vehicle role if not specified is None. + * + * @return value of model property role + */ + virtual Role GetRole() const + { + return Role(); + } + + /** + * From OpenSCENARIO class model specification: + * Category of the vehicle (bicycle, train,...). + * + * @return value of model property vehicleCategory + */ + virtual VehicleCategory GetVehicleCategory() const + { + return VehicleCategory(); + } + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual std::vector> GetParameterDeclarations() const + { + return std::vector>(); + } + + /** + * From OpenSCENARIO class model specification: + * The three dimensional bounding box that encloses the vehicle. + * + * @return value of model property boundingBox + */ + virtual std::shared_ptr GetBoundingBox() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Performance properties of the vehicle. + * + * @return value of model property performance + */ + virtual std::shared_ptr GetPerformance() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * A set of axles (front, rear, additional) and their geometric locations. + * + * @return value of model property axles + */ + virtual std::shared_ptr GetAxles() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Properties of the vehicle. + * + * @return value of model property properties + */ + virtual std::shared_ptr GetProperties() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Tow vehicle mounting point for optional trailer. + * + * @return value of model property trailerHitch + */ + virtual std::shared_ptr GetTrailerHitch() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Trailer vehicle mounting point for connecting to a tow vehicle. + * + * @return value of model property trailerCoupler + */ + virtual std::shared_ptr GetTrailerCoupler() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Initially connected trailer vehicle. Can be defined inline or a reference to a trailer in a catalog or the scenario + * file. + * + * @return value of model property trailer + */ + virtual std::shared_ptr GetTrailer() const + { + return nullptr; + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetParameterDeclarationsSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetParameterDeclarationsAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property mass is set + * @return true when the property is set + */ + virtual bool IsSetMass() const = 0; + /** + * Retrieves whether property model3d is set + * @return true when the property is set + */ + virtual bool IsSetModel3d() const = 0; + /** + * Retrieves whether property name is set + * @return true when the property is set + */ + virtual bool IsSetName() const = 0; + /** + * Retrieves whether property role is set + * @return true when the property is set + */ + virtual bool IsSetRole() const = 0; + /** + * Retrieves whether property vehicleCategory is set + * @return true when the property is set + */ + virtual bool IsSetVehicleCategory() const = 0; + /** + * Retrieves whether property parameterDeclarations is set + * @return true when the property is set + */ + virtual bool IsSetParameterDeclarations() const = 0; + /** + * Retrieves whether property boundingBox is set + * @return true when the property is set + */ + virtual bool IsSetBoundingBox() const = 0; + /** + * Retrieves whether property performance is set + * @return true when the property is set + */ + virtual bool IsSetPerformance() const = 0; + /** + * Retrieves whether property axles is set + * @return true when the property is set + */ + virtual bool IsSetAxles() const = 0; + /** + * Retrieves whether property properties is set + * @return true when the property is set + */ + virtual bool IsSetProperties() const = 0; + /** + * Retrieves whether property trailerHitch is set + * @return true when the property is set + */ + virtual bool IsSetTrailerHitch() const = 0; + /** + * Retrieves whether property trailerCoupler is set + * @return true when the property is set + */ + virtual bool IsSetTrailerCoupler() const = 0; + /** + * Retrieves whether property trailer is set + * @return true when the property is set + */ + virtual bool IsSetTrailer() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The directory where to look up vehicle catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCatalogLocation : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleCatalogLocation() = default; + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual std::shared_ptr GetDirectory() const + { + return nullptr; + } + + + /** + * Retrieves whether property directory is set + * @return true when the property is set + */ + virtual bool IsSetDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A distribution for vehicle in traffic. Category of vehicles and their weight (measure of relative likelihood, check + * VehicleCategoryDistributionEntry). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCategoryDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleCategoryDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle categories and their weight within the distribution. + * + * @return value of model property vehicleCategoryDistributionEntries + */ + virtual std::vector> GetVehicleCategoryDistributionEntries() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetVehicleCategoryDistributionEntriesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetVehicleCategoryDistributionEntriesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property vehicleCategoryDistributionEntries is set + * @return true when the property is set + */ + virtual bool IsSetVehicleCategoryDistributionEntries() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Represents the weight of a given vehicle category within a traffic definition. The relative probability for the + * occurence of this category is defined by the weight devided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCategoryDistributionEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleCategoryDistributionEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The category of the vehicles that appear in traffic. + * + * @return value of model property category + */ + virtual VehicleCategory GetCategory() const + { + return VehicleCategory(); + } + + /** + * From OpenSCENARIO class model specification: + * The weight of a vehicle category within a traffic distribution. Range: [0..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + + /** + * Retrieves whether property category is set + * @return true when the property is set + */ + virtual bool IsSetCategory() const = 0; + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type of the vehicle component. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleComponent : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleComponent() = default; + + /** + * From OpenSCENARIO class model specification: + * Available component types attached to a vehicle. + * + * @return value of model property vehicleComponentType + */ + virtual VehicleComponentType GetVehicleComponentType() const + { + return VehicleComponentType(); + } + + + /** + * Retrieves whether property vehicleComponentType is set + * @return true when the property is set + */ + virtual bool IsSetVehicleComponentType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type of the vehicle light. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleLight : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleLight() = default; + + /** + * From OpenSCENARIO class model specification: + * Available light types attached to a vehicle. + * + * @return value of model property vehicleLightType + */ + virtual VehicleLightType GetVehicleLightType() const + { + return VehicleLightType(); + } + + + /** + * Retrieves whether property vehicleLightType is set + * @return true when the property is set + */ + virtual bool IsSetVehicleLightType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A distribution for vehicle in traffic. Roles of vehicles and their weight (measure of relative likelihood, check + * VehicleRoleDistributionEntry). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleRoleDistribution : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleRoleDistribution() = default; + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle roles and their weight within the distribution. + * + * @return value of model property vehicleRoleDistributionEntries + */ + virtual std::vector> GetVehicleRoleDistributionEntries() const + { + return std::vector>(); + } + + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int GetVehicleRoleDistributionEntriesSize() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual std::shared_ptr GetVehicleRoleDistributionEntriesAtIndex(const unsigned int index) const + { + return nullptr; + } + + /** + * Retrieves whether property vehicleRoleDistributionEntries is set + * @return true when the property is set + */ + virtual bool IsSetVehicleRoleDistributionEntries() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Represents the weight of a given vehicle role within a traffic definition. The relative probability for the occurrence + * of this role is defined by the weight divided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleRoleDistributionEntry : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVehicleRoleDistributionEntry() = default; + + /** + * From OpenSCENARIO class model specification: + * The role of the vehicles that appear in traffic. + * + * @return value of model property role + */ + virtual Role GetRole() const + { + return Role(); + } + + /** + * From OpenSCENARIO class model specification: + * The weight of a vehicle role within a traffic distribution. Range: [0..inf[. + * + * @return value of model property weight + */ + virtual double GetWeight() const + { + return 0; + } + + + /** + * Retrieves whether property role is set + * @return true when the property is set + */ + virtual bool IsSetRole() const = 0; + /** + * Retrieves whether property weight is set + * @return true when the property is set + */ + virtual bool IsSetWeight() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Vertex of a polygonal chain (polyline) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVertex : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVertex() = default; + + /** + * From OpenSCENARIO class model specification: + * Optional time specification of the vertex. + * + * @return value of model property time + */ + virtual double GetTime() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Position of the vertex. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property time is set + * @return true when the property is set + */ + virtual bool IsSetTime() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Action that toggles (on or off) an entity's visibility attributes, with respect to sensors, other traffic or the + * graphics engine. The default for entities is that they are visible everywhere. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVisibilityAction : public virtual IOpenScenarioModelElement + { + public: + virtual ~IVisibilityAction() = default; + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible in image generator(s). False: actor is not visible in image generator(s). + * + * @return value of model property graphics + */ + virtual bool GetGraphics() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible in sensor(s). False: actor is not visible in sensor(s). + * + * @return value of model property sensors + */ + virtual bool GetSensors() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible for other traffic participants, particularly for autonomous driver models. False: actor is not + * visible for other traffic participants. + * + * @return value of model property traffic + */ + virtual bool GetTraffic() const + { + return false; + } + + /** + * From OpenSCENARIO class model specification: + * Reference to names of single sensors, for which the actor shall be (not) visible. For the other not named sensors + * implicitly the opposite applies. If no sensor references are provided, the actor is (not) visible for all sensors. E.g. + * a false positive for the front camera and lidar sensor could be specified with traffic="false", sensors="true", + * SensorReferenceSet={SensorReference{name="front camera"}, SensorReference{name="lidar"}}. The semantics of the sensor + * names are subject of a contract between the author of a scenario and the provider of a simulation environment. + * + * @return value of model property sensorReferenceSet + */ + virtual std::shared_ptr GetSensorReferenceSet() const + { + return nullptr; + } + + + /** + * Retrieves whether property graphics is set + * @return true when the property is set + */ + virtual bool IsSetGraphics() const = 0; + /** + * Retrieves whether property sensors is set + * @return true when the property is set + */ + virtual bool IsSetSensors() const = 0; + /** + * Retrieves whether property traffic is set + * @return true when the property is set + */ + virtual bool IsSetTraffic() const = 0; + /** + * Retrieves whether property sensorReferenceSet is set + * @return true when the property is set + */ + virtual bool IsSetSensorReferenceSet() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Reference position used to form a route. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWaypoint : public virtual IOpenScenarioModelElement + { + public: + virtual ~IWaypoint() = default; + + /** + * From OpenSCENARIO class model specification: + * The corresponding routing strategy (fastest, shortest, random, leastIntersections). + * + * @return value of model property routeStrategy + */ + virtual RouteStrategy GetRouteStrategy() const + { + return RouteStrategy(); + } + + /** + * From OpenSCENARIO class model specification: + * The reference position to form the route. + * + * @return value of model property position + */ + virtual std::shared_ptr GetPosition() const + { + return nullptr; + } + + + /** + * Retrieves whether property routeStrategy is set + * @return true when the property is set + */ + virtual bool IsSetRouteStrategy() const = 0; + /** + * Retrieves whether property position is set + * @return true when the property is set + */ + virtual bool IsSetPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the weather conditions in terms of light, fog, precipitation, cloud, temperature and atmospheric pressure + * states. If one of the conditions is missing it means that it doesn't change. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWeather : public virtual IOpenScenarioModelElement + { + public: + virtual ~IWeather() = default; + + /** + * From OpenSCENARIO class model specification: + * Reference atmospheric pressure at z=0.0 in world coordinate system. Unit: [Pa]. Range: [80000..120000]. The actual + * atmospheric pressure around the entities of the scenario has to be calculated depending on their z position. See also + * the Standard Atmosphere as defined in ISO2533. + * + * @return value of model property atmosphericPressure + */ + virtual double GetAtmosphericPressure() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the cloud state, i.e. cloud state and sky visualization settings. + * + * @return value of model property cloudState + */ + virtual CloudState GetCloudState() const + { + return CloudState(); + } + + /** + * From OpenSCENARIO class model specification: + * Definition of cloud states using the fractional cloud cover in oktas. + * + * @return value of model property fractionalCloudCover + */ + virtual FractionalCloudCover GetFractionalCloudCover() const + { + return FractionalCloudCover(); + } + + /** + * From OpenSCENARIO class model specification: + * Outside temperature at z=0.0 in world coordinate system. Unit: [K]. Range: [170..340]. The actual outside temperature + * around the entities of the scenario has to be calculated depending on their z position. + * + * @return value of model property temperature + */ + virtual double GetTemperature() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the sun, i.e. position and intensity. + * + * @return value of model property sun + */ + virtual std::shared_ptr GetSun() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of fog, i.e. visual range and bounding box. + * + * @return value of model property fog + */ + virtual std::shared_ptr GetFog() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of precipitation, i.e. type and intensity. + * + * @return value of model property precipitation + */ + virtual std::shared_ptr GetPrecipitation() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Definition of the wind: direction and speed. + * + * @return value of model property wind + */ + virtual std::shared_ptr GetWind() const + { + return nullptr; + } + + /** + * From OpenSCENARIO class model specification: + * Image reference to represent the sky. Mutually exclusive with "fractionalCloudCover". If the image also contains + * lighting information (HDRi) it is also mutually exclusive with "sun". + * + * @return value of model property domeImage + */ + virtual std::shared_ptr GetDomeImage() const + { + return nullptr; + } + + + /** + * Retrieves whether property atmosphericPressure is set + * @return true when the property is set + */ + virtual bool IsSetAtmosphericPressure() const = 0; + /** + * Retrieves whether property cloudState is set + * @return true when the property is set + */ + virtual bool IsSetCloudState() const = 0; + /** + * Retrieves whether property fractionalCloudCover is set + * @return true when the property is set + */ + virtual bool IsSetFractionalCloudCover() const = 0; + /** + * Retrieves whether property temperature is set + * @return true when the property is set + */ + virtual bool IsSetTemperature() const = 0; + /** + * Retrieves whether property sun is set + * @return true when the property is set + */ + virtual bool IsSetSun() const = 0; + /** + * Retrieves whether property fog is set + * @return true when the property is set + */ + virtual bool IsSetFog() const = 0; + /** + * Retrieves whether property precipitation is set + * @return true when the property is set + */ + virtual bool IsSetPrecipitation() const = 0; + /** + * Retrieves whether property wind is set + * @return true when the property is set + */ + virtual bool IsSetWind() const = 0; + /** + * Retrieves whether property domeImage is set + * @return true when the property is set + */ + virtual bool IsSetDomeImage() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines wind properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWind : public virtual IOpenScenarioModelElement + { + public: + virtual ~IWind() = default; + + /** + * From OpenSCENARIO class model specification: + * The target direction of the wind (not the origin direction) in the ground/xy-plane of the world coordinate system. + * Corresponds to the heading/yaw angle. x-axis-direction is 0 rad. Unit: [rad]. Range: [0..2*PI[. + * + * @return value of model property direction + */ + virtual double GetDirection() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The wind speed. Unit: [m/s]. Range: [0..inf[ + * + * @return value of model property speed + */ + virtual double GetSpeed() const + { + return 0; + } + + + /** + * Retrieves whether property direction is set + * @return true when the property is set + */ + virtual bool IsSetDirection() const = 0; + /** + * Retrieves whether property speed is set + * @return true when the property is set + */ + virtual bool IsSetSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A position which is fixed in the inertial reference frame of the simulation environment, the so-called world coordinate + * system. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWorldPosition : public virtual IOpenScenarioModelElement + { + public: + virtual ~IWorldPosition() = default; + + /** + * From OpenSCENARIO class model specification: + * The heading angle of the object, defining a mathematically positive rotation about the z-axis (see ISO 8855:2011). + * Missing value is interpreted as 0. Unit: [rad]. + * + * @return value of model property h + */ + virtual double GetH() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The pitch angle of the object, defining a mathematically positive rotation about the y-axis (see ISO 8855:2011). Missing + * value is interpreted as 0. Unit: [rad]. + * + * @return value of model property p + */ + virtual double GetP() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The roll angle of the object, defining a mathematically positive rotation about the x-axis (see ISO 8855:2011). Missing + * value is interpreted as 0. Unit: [rad]. + * + * @return value of model property r + */ + virtual double GetR() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The x coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property x + */ + virtual double GetX() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The y coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property y + */ + virtual double GetY() const + { + return 0; + } + + /** + * From OpenSCENARIO class model specification: + * The z coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property z + */ + virtual double GetZ() const + { + return 0; + } + + + /** + * Retrieves whether property h is set + * @return true when the property is set + */ + virtual bool IsSetH() const = 0; + /** + * Retrieves whether property p is set + * @return true when the property is set + */ + virtual bool IsSetP() const = 0; + /** + * Retrieves whether property r is set + * @return true when the property is set + */ + virtual bool IsSetR() const = 0; + /** + * Retrieves whether property x is set + * @return true when the property is set + */ + virtual bool IsSetX() const = 0; + /** + * Retrieves whether property y is set + * @return true when the property is set + */ + virtual bool IsSetY() const = 0; + /** + * Retrieves whether property z is set + * @return true when the property is set + */ + virtual bool IsSetZ() const = 0; + + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.cpp new file mode 100644 index 00000000..98d2a638 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.cpp @@ -0,0 +1,3165 @@ + +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EnumerationsV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + std::map AngleType::_stringToEnum = + { + {"heading", HEADING}, + {"pitch", PITCH}, + {"roll", ROLL}, + }; + + + AngleType::AngleType() + { + _literal = kAngleTypeEnumString[0]; + _angleTypeEnum = GetFromLiteral(_literal); + } + + AngleType::AngleType(AngleTypeEnum& angleType) + { + _literal = kAngleTypeEnumString[angleType+1]; + _angleTypeEnum = GetFromLiteral(_literal); + } + + AngleType::AngleType(const AngleTypeEnum angleType) + { + _literal = kAngleTypeEnumString[angleType+1]; + _angleTypeEnum = GetFromLiteral(_literal); + } + + AngleType::AngleType(std::string& literal_):_literal(literal_) + { + _angleTypeEnum = GetFromLiteral(_literal); + } + + bool AngleType::IsDeprecated(const AngleTypeEnum angleType) + { + return false; + } + + std::string AngleType::GetDeprecatedVersion(const AngleTypeEnum angleType) + { + return ""; + } + + std::string AngleType::GetDeprecatedComment(const AngleTypeEnum angleType) + { + return ""; + } + + std::string AngleType::GetLiteral() const + { + return _literal; + } + + AngleType& AngleType::operator= (const AngleTypeEnum &rhs) + { + _angleTypeEnum = rhs; + _literal = kAngleTypeEnumString[_angleTypeEnum+1]; + return *this; + } + + AngleType& AngleType::operator= (const AngleType &rhs ) + { + _literal = rhs._literal; + _angleTypeEnum = rhs._angleTypeEnum; + return *this; + } + + bool AngleType::operator== (const AngleTypeEnum &rhs) const + { + return _angleTypeEnum == rhs; + } + + AngleType::AngleTypeEnum AngleType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map AutomaticGearType::_stringToEnum = + { + {"d", D}, + {"n", N}, + {"p", P}, + {"r", R}, + }; + + + AutomaticGearType::AutomaticGearType() + { + _literal = kAutomaticGearTypeEnumString[0]; + _automaticGearTypeEnum = GetFromLiteral(_literal); + } + + AutomaticGearType::AutomaticGearType(AutomaticGearTypeEnum& automaticGearType) + { + _literal = kAutomaticGearTypeEnumString[automaticGearType+1]; + _automaticGearTypeEnum = GetFromLiteral(_literal); + } + + AutomaticGearType::AutomaticGearType(const AutomaticGearTypeEnum automaticGearType) + { + _literal = kAutomaticGearTypeEnumString[automaticGearType+1]; + _automaticGearTypeEnum = GetFromLiteral(_literal); + } + + AutomaticGearType::AutomaticGearType(std::string& literal_):_literal(literal_) + { + _automaticGearTypeEnum = GetFromLiteral(_literal); + } + + bool AutomaticGearType::IsDeprecated(const AutomaticGearTypeEnum automaticGearType) + { + return false; + } + + std::string AutomaticGearType::GetDeprecatedVersion(const AutomaticGearTypeEnum automaticGearType) + { + return ""; + } + + std::string AutomaticGearType::GetDeprecatedComment(const AutomaticGearTypeEnum automaticGearType) + { + return ""; + } + + std::string AutomaticGearType::GetLiteral() const + { + return _literal; + } + + AutomaticGearType& AutomaticGearType::operator= (const AutomaticGearTypeEnum &rhs) + { + _automaticGearTypeEnum = rhs; + _literal = kAutomaticGearTypeEnumString[_automaticGearTypeEnum+1]; + return *this; + } + + AutomaticGearType& AutomaticGearType::operator= (const AutomaticGearType &rhs ) + { + _literal = rhs._literal; + _automaticGearTypeEnum = rhs._automaticGearTypeEnum; + return *this; + } + + bool AutomaticGearType::operator== (const AutomaticGearTypeEnum &rhs) const + { + return _automaticGearTypeEnum == rhs; + } + + AutomaticGearType::AutomaticGearTypeEnum AutomaticGearType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map CloudState::_stringToEnum = + { + {"cloudy", CLOUDY}, + {"free", FREE}, + {"overcast", OVERCAST}, + {"rainy", RAINY}, + {"skyOff", SKY_OFF}, + }; + + + CloudState::CloudState() + { + _literal = kCloudStateEnumString[0]; + _cloudStateEnum = GetFromLiteral(_literal); + } + + CloudState::CloudState(CloudStateEnum& cloudState) + { + _literal = kCloudStateEnumString[cloudState+1]; + _cloudStateEnum = GetFromLiteral(_literal); + } + + CloudState::CloudState(const CloudStateEnum cloudState) + { + _literal = kCloudStateEnumString[cloudState+1]; + _cloudStateEnum = GetFromLiteral(_literal); + } + + CloudState::CloudState(std::string& literal_):_literal(literal_) + { + _cloudStateEnum = GetFromLiteral(_literal); + } + + bool CloudState::IsDeprecated(const CloudStateEnum cloudState) + { + return false; + } + + std::string CloudState::GetDeprecatedVersion(const CloudStateEnum cloudState) + { + return ""; + } + + std::string CloudState::GetDeprecatedComment(const CloudStateEnum cloudState) + { + return ""; + } + + std::string CloudState::GetLiteral() const + { + return _literal; + } + + CloudState& CloudState::operator= (const CloudStateEnum &rhs) + { + _cloudStateEnum = rhs; + _literal = kCloudStateEnumString[_cloudStateEnum+1]; + return *this; + } + + CloudState& CloudState::operator= (const CloudState &rhs ) + { + _literal = rhs._literal; + _cloudStateEnum = rhs._cloudStateEnum; + return *this; + } + + bool CloudState::operator== (const CloudStateEnum &rhs) const + { + return _cloudStateEnum == rhs; + } + + CloudState::CloudStateEnum CloudState::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ColorType::_stringToEnum = + { + {"black", BLACK}, + {"blue", BLUE}, + {"brown", BROWN}, + {"green", GREEN}, + {"grey", GREY}, + {"orange", ORANGE}, + {"other", OTHER}, + {"red", RED}, + {"violet", VIOLET}, + {"white", WHITE}, + {"yellow", YELLOW}, + }; + + + ColorType::ColorType() + { + _literal = kColorTypeEnumString[0]; + _colorTypeEnum = GetFromLiteral(_literal); + } + + ColorType::ColorType(ColorTypeEnum& colorType) + { + _literal = kColorTypeEnumString[colorType+1]; + _colorTypeEnum = GetFromLiteral(_literal); + } + + ColorType::ColorType(const ColorTypeEnum colorType) + { + _literal = kColorTypeEnumString[colorType+1]; + _colorTypeEnum = GetFromLiteral(_literal); + } + + ColorType::ColorType(std::string& literal_):_literal(literal_) + { + _colorTypeEnum = GetFromLiteral(_literal); + } + + bool ColorType::IsDeprecated(const ColorTypeEnum colorType) + { + return false; + } + + std::string ColorType::GetDeprecatedVersion(const ColorTypeEnum colorType) + { + return ""; + } + + std::string ColorType::GetDeprecatedComment(const ColorTypeEnum colorType) + { + return ""; + } + + std::string ColorType::GetLiteral() const + { + return _literal; + } + + ColorType& ColorType::operator= (const ColorTypeEnum &rhs) + { + _colorTypeEnum = rhs; + _literal = kColorTypeEnumString[_colorTypeEnum+1]; + return *this; + } + + ColorType& ColorType::operator= (const ColorType &rhs ) + { + _literal = rhs._literal; + _colorTypeEnum = rhs._colorTypeEnum; + return *this; + } + + bool ColorType::operator== (const ColorTypeEnum &rhs) const + { + return _colorTypeEnum == rhs; + } + + ColorType::ColorTypeEnum ColorType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ConditionEdge::_stringToEnum = + { + {"falling", FALLING}, + {"none", NONE}, + {"rising", RISING}, + {"risingOrFalling", RISING_OR_FALLING}, + }; + + + ConditionEdge::ConditionEdge() + { + _literal = kConditionEdgeEnumString[0]; + _conditionEdgeEnum = GetFromLiteral(_literal); + } + + ConditionEdge::ConditionEdge(ConditionEdgeEnum& conditionEdge) + { + _literal = kConditionEdgeEnumString[conditionEdge+1]; + _conditionEdgeEnum = GetFromLiteral(_literal); + } + + ConditionEdge::ConditionEdge(const ConditionEdgeEnum conditionEdge) + { + _literal = kConditionEdgeEnumString[conditionEdge+1]; + _conditionEdgeEnum = GetFromLiteral(_literal); + } + + ConditionEdge::ConditionEdge(std::string& literal_):_literal(literal_) + { + _conditionEdgeEnum = GetFromLiteral(_literal); + } + + bool ConditionEdge::IsDeprecated(const ConditionEdgeEnum conditionEdge) + { + return false; + } + + std::string ConditionEdge::GetDeprecatedVersion(const ConditionEdgeEnum conditionEdge) + { + return ""; + } + + std::string ConditionEdge::GetDeprecatedComment(const ConditionEdgeEnum conditionEdge) + { + return ""; + } + + std::string ConditionEdge::GetLiteral() const + { + return _literal; + } + + ConditionEdge& ConditionEdge::operator= (const ConditionEdgeEnum &rhs) + { + _conditionEdgeEnum = rhs; + _literal = kConditionEdgeEnumString[_conditionEdgeEnum+1]; + return *this; + } + + ConditionEdge& ConditionEdge::operator= (const ConditionEdge &rhs ) + { + _literal = rhs._literal; + _conditionEdgeEnum = rhs._conditionEdgeEnum; + return *this; + } + + bool ConditionEdge::operator== (const ConditionEdgeEnum &rhs) const + { + return _conditionEdgeEnum == rhs; + } + + ConditionEdge::ConditionEdgeEnum ConditionEdge::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ControllerType::_stringToEnum = + { + {"all", ALL}, + {"animation", ANIMATION}, + {"appearance", APPEARANCE}, + {"lateral", LATERAL}, + {"lighting", LIGHTING}, + {"longitudinal", LONGITUDINAL}, + {"movement", MOVEMENT}, + }; + + + ControllerType::ControllerType() + { + _literal = kControllerTypeEnumString[0]; + _controllerTypeEnum = GetFromLiteral(_literal); + } + + ControllerType::ControllerType(ControllerTypeEnum& controllerType) + { + _literal = kControllerTypeEnumString[controllerType+1]; + _controllerTypeEnum = GetFromLiteral(_literal); + } + + ControllerType::ControllerType(const ControllerTypeEnum controllerType) + { + _literal = kControllerTypeEnumString[controllerType+1]; + _controllerTypeEnum = GetFromLiteral(_literal); + } + + ControllerType::ControllerType(std::string& literal_):_literal(literal_) + { + _controllerTypeEnum = GetFromLiteral(_literal); + } + + bool ControllerType::IsDeprecated(const ControllerTypeEnum controllerType) + { + return false; + } + + std::string ControllerType::GetDeprecatedVersion(const ControllerTypeEnum controllerType) + { + return ""; + } + + std::string ControllerType::GetDeprecatedComment(const ControllerTypeEnum controllerType) + { + return ""; + } + + std::string ControllerType::GetLiteral() const + { + return _literal; + } + + ControllerType& ControllerType::operator= (const ControllerTypeEnum &rhs) + { + _controllerTypeEnum = rhs; + _literal = kControllerTypeEnumString[_controllerTypeEnum+1]; + return *this; + } + + ControllerType& ControllerType::operator= (const ControllerType &rhs ) + { + _literal = rhs._literal; + _controllerTypeEnum = rhs._controllerTypeEnum; + return *this; + } + + bool ControllerType::operator== (const ControllerTypeEnum &rhs) const + { + return _controllerTypeEnum == rhs; + } + + ControllerType::ControllerTypeEnum ControllerType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map CoordinateSystem::_stringToEnum = + { + {"entity", ENTITY}, + {"lane", LANE}, + {"road", ROAD}, + {"trajectory", TRAJECTORY}, + {"world", WORLD}, + }; + + + CoordinateSystem::CoordinateSystem() + { + _literal = kCoordinateSystemEnumString[0]; + _coordinateSystemEnum = GetFromLiteral(_literal); + } + + CoordinateSystem::CoordinateSystem(CoordinateSystemEnum& coordinateSystem) + { + _literal = kCoordinateSystemEnumString[coordinateSystem+1]; + _coordinateSystemEnum = GetFromLiteral(_literal); + } + + CoordinateSystem::CoordinateSystem(const CoordinateSystemEnum coordinateSystem) + { + _literal = kCoordinateSystemEnumString[coordinateSystem+1]; + _coordinateSystemEnum = GetFromLiteral(_literal); + } + + CoordinateSystem::CoordinateSystem(std::string& literal_):_literal(literal_) + { + _coordinateSystemEnum = GetFromLiteral(_literal); + } + + bool CoordinateSystem::IsDeprecated(const CoordinateSystemEnum coordinateSystem) + { + return false; + } + + std::string CoordinateSystem::GetDeprecatedVersion(const CoordinateSystemEnum coordinateSystem) + { + return ""; + } + + std::string CoordinateSystem::GetDeprecatedComment(const CoordinateSystemEnum coordinateSystem) + { + return ""; + } + + std::string CoordinateSystem::GetLiteral() const + { + return _literal; + } + + CoordinateSystem& CoordinateSystem::operator= (const CoordinateSystemEnum &rhs) + { + _coordinateSystemEnum = rhs; + _literal = kCoordinateSystemEnumString[_coordinateSystemEnum+1]; + return *this; + } + + CoordinateSystem& CoordinateSystem::operator= (const CoordinateSystem &rhs ) + { + _literal = rhs._literal; + _coordinateSystemEnum = rhs._coordinateSystemEnum; + return *this; + } + + bool CoordinateSystem::operator== (const CoordinateSystemEnum &rhs) const + { + return _coordinateSystemEnum == rhs; + } + + CoordinateSystem::CoordinateSystemEnum CoordinateSystem::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map DirectionalDimension::_stringToEnum = + { + {"lateral", LATERAL}, + {"longitudinal", LONGITUDINAL}, + {"vertical", VERTICAL}, + }; + + + DirectionalDimension::DirectionalDimension() + { + _literal = kDirectionalDimensionEnumString[0]; + _directionalDimensionEnum = GetFromLiteral(_literal); + } + + DirectionalDimension::DirectionalDimension(DirectionalDimensionEnum& directionalDimension) + { + _literal = kDirectionalDimensionEnumString[directionalDimension+1]; + _directionalDimensionEnum = GetFromLiteral(_literal); + } + + DirectionalDimension::DirectionalDimension(const DirectionalDimensionEnum directionalDimension) + { + _literal = kDirectionalDimensionEnumString[directionalDimension+1]; + _directionalDimensionEnum = GetFromLiteral(_literal); + } + + DirectionalDimension::DirectionalDimension(std::string& literal_):_literal(literal_) + { + _directionalDimensionEnum = GetFromLiteral(_literal); + } + + bool DirectionalDimension::IsDeprecated(const DirectionalDimensionEnum directionalDimension) + { + return false; + } + + std::string DirectionalDimension::GetDeprecatedVersion(const DirectionalDimensionEnum directionalDimension) + { + return ""; + } + + std::string DirectionalDimension::GetDeprecatedComment(const DirectionalDimensionEnum directionalDimension) + { + return ""; + } + + std::string DirectionalDimension::GetLiteral() const + { + return _literal; + } + + DirectionalDimension& DirectionalDimension::operator= (const DirectionalDimensionEnum &rhs) + { + _directionalDimensionEnum = rhs; + _literal = kDirectionalDimensionEnumString[_directionalDimensionEnum+1]; + return *this; + } + + DirectionalDimension& DirectionalDimension::operator= (const DirectionalDimension &rhs ) + { + _literal = rhs._literal; + _directionalDimensionEnum = rhs._directionalDimensionEnum; + return *this; + } + + bool DirectionalDimension::operator== (const DirectionalDimensionEnum &rhs) const + { + return _directionalDimensionEnum == rhs; + } + + DirectionalDimension::DirectionalDimensionEnum DirectionalDimension::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map DynamicsDimension::_stringToEnum = + { + {"distance", DISTANCE}, + {"rate", RATE}, + {"time", TIME}, + }; + + + DynamicsDimension::DynamicsDimension() + { + _literal = kDynamicsDimensionEnumString[0]; + _dynamicsDimensionEnum = GetFromLiteral(_literal); + } + + DynamicsDimension::DynamicsDimension(DynamicsDimensionEnum& dynamicsDimension) + { + _literal = kDynamicsDimensionEnumString[dynamicsDimension+1]; + _dynamicsDimensionEnum = GetFromLiteral(_literal); + } + + DynamicsDimension::DynamicsDimension(const DynamicsDimensionEnum dynamicsDimension) + { + _literal = kDynamicsDimensionEnumString[dynamicsDimension+1]; + _dynamicsDimensionEnum = GetFromLiteral(_literal); + } + + DynamicsDimension::DynamicsDimension(std::string& literal_):_literal(literal_) + { + _dynamicsDimensionEnum = GetFromLiteral(_literal); + } + + bool DynamicsDimension::IsDeprecated(const DynamicsDimensionEnum dynamicsDimension) + { + return false; + } + + std::string DynamicsDimension::GetDeprecatedVersion(const DynamicsDimensionEnum dynamicsDimension) + { + return ""; + } + + std::string DynamicsDimension::GetDeprecatedComment(const DynamicsDimensionEnum dynamicsDimension) + { + return ""; + } + + std::string DynamicsDimension::GetLiteral() const + { + return _literal; + } + + DynamicsDimension& DynamicsDimension::operator= (const DynamicsDimensionEnum &rhs) + { + _dynamicsDimensionEnum = rhs; + _literal = kDynamicsDimensionEnumString[_dynamicsDimensionEnum+1]; + return *this; + } + + DynamicsDimension& DynamicsDimension::operator= (const DynamicsDimension &rhs ) + { + _literal = rhs._literal; + _dynamicsDimensionEnum = rhs._dynamicsDimensionEnum; + return *this; + } + + bool DynamicsDimension::operator== (const DynamicsDimensionEnum &rhs) const + { + return _dynamicsDimensionEnum == rhs; + } + + DynamicsDimension::DynamicsDimensionEnum DynamicsDimension::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map DynamicsShape::_stringToEnum = + { + {"cubic", CUBIC}, + {"linear", LINEAR}, + {"sinusoidal", SINUSOIDAL}, + {"step", STEP}, + }; + + + DynamicsShape::DynamicsShape() + { + _literal = kDynamicsShapeEnumString[0]; + _dynamicsShapeEnum = GetFromLiteral(_literal); + } + + DynamicsShape::DynamicsShape(DynamicsShapeEnum& dynamicsShape) + { + _literal = kDynamicsShapeEnumString[dynamicsShape+1]; + _dynamicsShapeEnum = GetFromLiteral(_literal); + } + + DynamicsShape::DynamicsShape(const DynamicsShapeEnum dynamicsShape) + { + _literal = kDynamicsShapeEnumString[dynamicsShape+1]; + _dynamicsShapeEnum = GetFromLiteral(_literal); + } + + DynamicsShape::DynamicsShape(std::string& literal_):_literal(literal_) + { + _dynamicsShapeEnum = GetFromLiteral(_literal); + } + + bool DynamicsShape::IsDeprecated(const DynamicsShapeEnum dynamicsShape) + { + return false; + } + + std::string DynamicsShape::GetDeprecatedVersion(const DynamicsShapeEnum dynamicsShape) + { + return ""; + } + + std::string DynamicsShape::GetDeprecatedComment(const DynamicsShapeEnum dynamicsShape) + { + return ""; + } + + std::string DynamicsShape::GetLiteral() const + { + return _literal; + } + + DynamicsShape& DynamicsShape::operator= (const DynamicsShapeEnum &rhs) + { + _dynamicsShapeEnum = rhs; + _literal = kDynamicsShapeEnumString[_dynamicsShapeEnum+1]; + return *this; + } + + DynamicsShape& DynamicsShape::operator= (const DynamicsShape &rhs ) + { + _literal = rhs._literal; + _dynamicsShapeEnum = rhs._dynamicsShapeEnum; + return *this; + } + + bool DynamicsShape::operator== (const DynamicsShapeEnum &rhs) const + { + return _dynamicsShapeEnum == rhs; + } + + DynamicsShape::DynamicsShapeEnum DynamicsShape::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map FollowingMode::_stringToEnum = + { + {"follow", FOLLOW}, + {"position", POSITION}, + }; + + + FollowingMode::FollowingMode() + { + _literal = kFollowingModeEnumString[0]; + _followingModeEnum = GetFromLiteral(_literal); + } + + FollowingMode::FollowingMode(FollowingModeEnum& followingMode) + { + _literal = kFollowingModeEnumString[followingMode+1]; + _followingModeEnum = GetFromLiteral(_literal); + } + + FollowingMode::FollowingMode(const FollowingModeEnum followingMode) + { + _literal = kFollowingModeEnumString[followingMode+1]; + _followingModeEnum = GetFromLiteral(_literal); + } + + FollowingMode::FollowingMode(std::string& literal_):_literal(literal_) + { + _followingModeEnum = GetFromLiteral(_literal); + } + + bool FollowingMode::IsDeprecated(const FollowingModeEnum followingMode) + { + return false; + } + + std::string FollowingMode::GetDeprecatedVersion(const FollowingModeEnum followingMode) + { + return ""; + } + + std::string FollowingMode::GetDeprecatedComment(const FollowingModeEnum followingMode) + { + return ""; + } + + std::string FollowingMode::GetLiteral() const + { + return _literal; + } + + FollowingMode& FollowingMode::operator= (const FollowingModeEnum &rhs) + { + _followingModeEnum = rhs; + _literal = kFollowingModeEnumString[_followingModeEnum+1]; + return *this; + } + + FollowingMode& FollowingMode::operator= (const FollowingMode &rhs ) + { + _literal = rhs._literal; + _followingModeEnum = rhs._followingModeEnum; + return *this; + } + + bool FollowingMode::operator== (const FollowingModeEnum &rhs) const + { + return _followingModeEnum == rhs; + } + + FollowingMode::FollowingModeEnum FollowingMode::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map FractionalCloudCover::_stringToEnum = + { + {"eightOktas", EIGHT_OKTAS}, + {"fiveOktas", FIVE_OKTAS}, + {"fourOktas", FOUR_OKTAS}, + {"nineOktas", NINE_OKTAS}, + {"oneOktas", ONE_OKTAS}, + {"sevenOktas", SEVEN_OKTAS}, + {"sixOktas", SIX_OKTAS}, + {"threeOktas", THREE_OKTAS}, + {"twoOktas", TWO_OKTAS}, + {"zeroOktas", ZERO_OKTAS}, + }; + + + FractionalCloudCover::FractionalCloudCover() + { + _literal = kFractionalCloudCoverEnumString[0]; + _fractionalCloudCoverEnum = GetFromLiteral(_literal); + } + + FractionalCloudCover::FractionalCloudCover(FractionalCloudCoverEnum& fractionalCloudCover) + { + _literal = kFractionalCloudCoverEnumString[fractionalCloudCover+1]; + _fractionalCloudCoverEnum = GetFromLiteral(_literal); + } + + FractionalCloudCover::FractionalCloudCover(const FractionalCloudCoverEnum fractionalCloudCover) + { + _literal = kFractionalCloudCoverEnumString[fractionalCloudCover+1]; + _fractionalCloudCoverEnum = GetFromLiteral(_literal); + } + + FractionalCloudCover::FractionalCloudCover(std::string& literal_):_literal(literal_) + { + _fractionalCloudCoverEnum = GetFromLiteral(_literal); + } + + bool FractionalCloudCover::IsDeprecated(const FractionalCloudCoverEnum fractionalCloudCover) + { + return false; + } + + std::string FractionalCloudCover::GetDeprecatedVersion(const FractionalCloudCoverEnum fractionalCloudCover) + { + return ""; + } + + std::string FractionalCloudCover::GetDeprecatedComment(const FractionalCloudCoverEnum fractionalCloudCover) + { + return ""; + } + + std::string FractionalCloudCover::GetLiteral() const + { + return _literal; + } + + FractionalCloudCover& FractionalCloudCover::operator= (const FractionalCloudCoverEnum &rhs) + { + _fractionalCloudCoverEnum = rhs; + _literal = kFractionalCloudCoverEnumString[_fractionalCloudCoverEnum+1]; + return *this; + } + + FractionalCloudCover& FractionalCloudCover::operator= (const FractionalCloudCover &rhs ) + { + _literal = rhs._literal; + _fractionalCloudCoverEnum = rhs._fractionalCloudCoverEnum; + return *this; + } + + bool FractionalCloudCover::operator== (const FractionalCloudCoverEnum &rhs) const + { + return _fractionalCloudCoverEnum == rhs; + } + + FractionalCloudCover::FractionalCloudCoverEnum FractionalCloudCover::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map LateralDisplacement::_stringToEnum = + { + {"any", ANY}, + {"leftToReferencedEntity", LEFT_TO_REFERENCED_ENTITY}, + {"rightToReferencedEntity", RIGHT_TO_REFERENCED_ENTITY}, + }; + + + LateralDisplacement::LateralDisplacement() + { + _literal = kLateralDisplacementEnumString[0]; + _lateralDisplacementEnum = GetFromLiteral(_literal); + } + + LateralDisplacement::LateralDisplacement(LateralDisplacementEnum& lateralDisplacement) + { + _literal = kLateralDisplacementEnumString[lateralDisplacement+1]; + _lateralDisplacementEnum = GetFromLiteral(_literal); + } + + LateralDisplacement::LateralDisplacement(const LateralDisplacementEnum lateralDisplacement) + { + _literal = kLateralDisplacementEnumString[lateralDisplacement+1]; + _lateralDisplacementEnum = GetFromLiteral(_literal); + } + + LateralDisplacement::LateralDisplacement(std::string& literal_):_literal(literal_) + { + _lateralDisplacementEnum = GetFromLiteral(_literal); + } + + bool LateralDisplacement::IsDeprecated(const LateralDisplacementEnum lateralDisplacement) + { + return false; + } + + std::string LateralDisplacement::GetDeprecatedVersion(const LateralDisplacementEnum lateralDisplacement) + { + return ""; + } + + std::string LateralDisplacement::GetDeprecatedComment(const LateralDisplacementEnum lateralDisplacement) + { + return ""; + } + + std::string LateralDisplacement::GetLiteral() const + { + return _literal; + } + + LateralDisplacement& LateralDisplacement::operator= (const LateralDisplacementEnum &rhs) + { + _lateralDisplacementEnum = rhs; + _literal = kLateralDisplacementEnumString[_lateralDisplacementEnum+1]; + return *this; + } + + LateralDisplacement& LateralDisplacement::operator= (const LateralDisplacement &rhs ) + { + _literal = rhs._literal; + _lateralDisplacementEnum = rhs._lateralDisplacementEnum; + return *this; + } + + bool LateralDisplacement::operator== (const LateralDisplacementEnum &rhs) const + { + return _lateralDisplacementEnum == rhs; + } + + LateralDisplacement::LateralDisplacementEnum LateralDisplacement::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map LightMode::_stringToEnum = + { + {"flashing", FLASHING}, + {"off", OFF}, + {"on", ON}, + }; + + + LightMode::LightMode() + { + _literal = kLightModeEnumString[0]; + _lightModeEnum = GetFromLiteral(_literal); + } + + LightMode::LightMode(LightModeEnum& lightMode) + { + _literal = kLightModeEnumString[lightMode+1]; + _lightModeEnum = GetFromLiteral(_literal); + } + + LightMode::LightMode(const LightModeEnum lightMode) + { + _literal = kLightModeEnumString[lightMode+1]; + _lightModeEnum = GetFromLiteral(_literal); + } + + LightMode::LightMode(std::string& literal_):_literal(literal_) + { + _lightModeEnum = GetFromLiteral(_literal); + } + + bool LightMode::IsDeprecated(const LightModeEnum lightMode) + { + return false; + } + + std::string LightMode::GetDeprecatedVersion(const LightModeEnum lightMode) + { + return ""; + } + + std::string LightMode::GetDeprecatedComment(const LightModeEnum lightMode) + { + return ""; + } + + std::string LightMode::GetLiteral() const + { + return _literal; + } + + LightMode& LightMode::operator= (const LightModeEnum &rhs) + { + _lightModeEnum = rhs; + _literal = kLightModeEnumString[_lightModeEnum+1]; + return *this; + } + + LightMode& LightMode::operator= (const LightMode &rhs ) + { + _literal = rhs._literal; + _lightModeEnum = rhs._lightModeEnum; + return *this; + } + + bool LightMode::operator== (const LightModeEnum &rhs) const + { + return _lightModeEnum == rhs; + } + + LightMode::LightModeEnum LightMode::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map LongitudinalDisplacement::_stringToEnum = + { + {"any", ANY}, + {"leadingReferencedEntity", LEADING_REFERENCED_ENTITY}, + {"trailingReferencedEntity", TRAILING_REFERENCED_ENTITY}, + }; + + + LongitudinalDisplacement::LongitudinalDisplacement() + { + _literal = kLongitudinalDisplacementEnumString[0]; + _longitudinalDisplacementEnum = GetFromLiteral(_literal); + } + + LongitudinalDisplacement::LongitudinalDisplacement(LongitudinalDisplacementEnum& longitudinalDisplacement) + { + _literal = kLongitudinalDisplacementEnumString[longitudinalDisplacement+1]; + _longitudinalDisplacementEnum = GetFromLiteral(_literal); + } + + LongitudinalDisplacement::LongitudinalDisplacement(const LongitudinalDisplacementEnum longitudinalDisplacement) + { + _literal = kLongitudinalDisplacementEnumString[longitudinalDisplacement+1]; + _longitudinalDisplacementEnum = GetFromLiteral(_literal); + } + + LongitudinalDisplacement::LongitudinalDisplacement(std::string& literal_):_literal(literal_) + { + _longitudinalDisplacementEnum = GetFromLiteral(_literal); + } + + bool LongitudinalDisplacement::IsDeprecated(const LongitudinalDisplacementEnum longitudinalDisplacement) + { + return false; + } + + std::string LongitudinalDisplacement::GetDeprecatedVersion(const LongitudinalDisplacementEnum longitudinalDisplacement) + { + return ""; + } + + std::string LongitudinalDisplacement::GetDeprecatedComment(const LongitudinalDisplacementEnum longitudinalDisplacement) + { + return ""; + } + + std::string LongitudinalDisplacement::GetLiteral() const + { + return _literal; + } + + LongitudinalDisplacement& LongitudinalDisplacement::operator= (const LongitudinalDisplacementEnum &rhs) + { + _longitudinalDisplacementEnum = rhs; + _literal = kLongitudinalDisplacementEnumString[_longitudinalDisplacementEnum+1]; + return *this; + } + + LongitudinalDisplacement& LongitudinalDisplacement::operator= (const LongitudinalDisplacement &rhs ) + { + _literal = rhs._literal; + _longitudinalDisplacementEnum = rhs._longitudinalDisplacementEnum; + return *this; + } + + bool LongitudinalDisplacement::operator== (const LongitudinalDisplacementEnum &rhs) const + { + return _longitudinalDisplacementEnum == rhs; + } + + LongitudinalDisplacement::LongitudinalDisplacementEnum LongitudinalDisplacement::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map MiscObjectCategory::_stringToEnum = + { + {"barrier", BARRIER}, + {"building", BUILDING}, + {"crosswalk", CROSSWALK}, + {"gantry", GANTRY}, + {"none", NONE}, + {"obstacle", OBSTACLE}, + {"parkingSpace", PARKING_SPACE}, + {"patch", PATCH}, + {"pole", POLE}, + {"railing", RAILING}, + {"roadMark", ROAD_MARK}, + {"soundBarrier", SOUND_BARRIER}, + {"streetLamp", STREET_LAMP}, + {"trafficIsland", TRAFFIC_ISLAND}, + {"tree", TREE}, + {"vegetation", VEGETATION}, + {"wind", WIND}, + }; + + std::map MiscObjectCategory::_enumToDeprecated = + { + {MiscObjectCategory::BARRIER, false}, + {MiscObjectCategory::BUILDING, false}, + {MiscObjectCategory::CROSSWALK, false}, + {MiscObjectCategory::GANTRY, false}, + {MiscObjectCategory::NONE, false}, + {MiscObjectCategory::OBSTACLE, false}, + {MiscObjectCategory::PARKING_SPACE, false}, + {MiscObjectCategory::PATCH, false}, + {MiscObjectCategory::POLE, false}, + {MiscObjectCategory::RAILING, false}, + {MiscObjectCategory::ROAD_MARK, false}, + {MiscObjectCategory::SOUND_BARRIER, false}, + {MiscObjectCategory::STREET_LAMP, false}, + {MiscObjectCategory::TRAFFIC_ISLAND, false}, + {MiscObjectCategory::TREE, false}, + {MiscObjectCategory::VEGETATION, false}, + {MiscObjectCategory::WIND, true}, + }; + std::map MiscObjectCategory::_enumToDeprecatedVersion + { + {MiscObjectCategory::BARRIER, ""}, + {MiscObjectCategory::BUILDING, ""}, + {MiscObjectCategory::CROSSWALK, ""}, + {MiscObjectCategory::GANTRY, ""}, + {MiscObjectCategory::NONE, ""}, + {MiscObjectCategory::OBSTACLE, ""}, + {MiscObjectCategory::PARKING_SPACE, ""}, + {MiscObjectCategory::PATCH, ""}, + {MiscObjectCategory::POLE, ""}, + {MiscObjectCategory::RAILING, ""}, + {MiscObjectCategory::ROAD_MARK, ""}, + {MiscObjectCategory::SOUND_BARRIER, ""}, + {MiscObjectCategory::STREET_LAMP, ""}, + {MiscObjectCategory::TRAFFIC_ISLAND, ""}, + {MiscObjectCategory::TREE, ""}, + {MiscObjectCategory::VEGETATION, ""}, + {MiscObjectCategory::WIND, "1.1"}, + }; + std::map MiscObjectCategory::_enumToDeprecatedComment + { + {MiscObjectCategory::BARRIER, ""}, + {MiscObjectCategory::BUILDING, ""}, + {MiscObjectCategory::CROSSWALK, ""}, + {MiscObjectCategory::GANTRY, ""}, + {MiscObjectCategory::NONE, ""}, + {MiscObjectCategory::OBSTACLE, ""}, + {MiscObjectCategory::PARKING_SPACE, ""}, + {MiscObjectCategory::PATCH, ""}, + {MiscObjectCategory::POLE, ""}, + {MiscObjectCategory::RAILING, ""}, + {MiscObjectCategory::ROAD_MARK, ""}, + {MiscObjectCategory::SOUND_BARRIER, ""}, + {MiscObjectCategory::STREET_LAMP, ""}, + {MiscObjectCategory::TRAFFIC_ISLAND, ""}, + {MiscObjectCategory::TREE, ""}, + {MiscObjectCategory::VEGETATION, ""}, + {MiscObjectCategory::WIND, "Use instead XSDcomplexeType \"Wind\" in \"Weather\"."}, + }; + + + + MiscObjectCategory::MiscObjectCategory() + { + _literal = kMiscObjectCategoryEnumString[0]; + _miscObjectCategoryEnum = GetFromLiteral(_literal); + } + + MiscObjectCategory::MiscObjectCategory(MiscObjectCategoryEnum& miscObjectCategory) + { + _literal = kMiscObjectCategoryEnumString[miscObjectCategory+1]; + _miscObjectCategoryEnum = GetFromLiteral(_literal); + } + + MiscObjectCategory::MiscObjectCategory(const MiscObjectCategoryEnum miscObjectCategory) + { + _literal = kMiscObjectCategoryEnumString[miscObjectCategory+1]; + _miscObjectCategoryEnum = GetFromLiteral(_literal); + } + + MiscObjectCategory::MiscObjectCategory(std::string& literal_):_literal(literal_) + { + _miscObjectCategoryEnum = GetFromLiteral(_literal); + } + + bool MiscObjectCategory::IsDeprecated(const MiscObjectCategoryEnum miscObjectCategory) + { + return _enumToDeprecated[miscObjectCategory]; + } + + std::string MiscObjectCategory::GetDeprecatedVersion(const MiscObjectCategoryEnum miscObjectCategory) + { + return _enumToDeprecatedVersion[miscObjectCategory]; + } + + std::string MiscObjectCategory::GetDeprecatedComment(const MiscObjectCategoryEnum miscObjectCategory) + { + return _enumToDeprecatedComment[miscObjectCategory]; + } + + std::string MiscObjectCategory::GetLiteral() const + { + return _literal; + } + + MiscObjectCategory& MiscObjectCategory::operator= (const MiscObjectCategoryEnum &rhs) + { + _miscObjectCategoryEnum = rhs; + _literal = kMiscObjectCategoryEnumString[_miscObjectCategoryEnum+1]; + return *this; + } + + MiscObjectCategory& MiscObjectCategory::operator= (const MiscObjectCategory &rhs ) + { + _literal = rhs._literal; + _miscObjectCategoryEnum = rhs._miscObjectCategoryEnum; + return *this; + } + + bool MiscObjectCategory::operator== (const MiscObjectCategoryEnum &rhs) const + { + return _miscObjectCategoryEnum == rhs; + } + + MiscObjectCategory::MiscObjectCategoryEnum MiscObjectCategory::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ObjectType::_stringToEnum = + { + {"external", EXTERNAL}, + {"miscellaneous", MISCELLANEOUS}, + {"pedestrian", PEDESTRIAN}, + {"vehicle", VEHICLE}, + }; + + + ObjectType::ObjectType() + { + _literal = kObjectTypeEnumString[0]; + _objectTypeEnum = GetFromLiteral(_literal); + } + + ObjectType::ObjectType(ObjectTypeEnum& objectType) + { + _literal = kObjectTypeEnumString[objectType+1]; + _objectTypeEnum = GetFromLiteral(_literal); + } + + ObjectType::ObjectType(const ObjectTypeEnum objectType) + { + _literal = kObjectTypeEnumString[objectType+1]; + _objectTypeEnum = GetFromLiteral(_literal); + } + + ObjectType::ObjectType(std::string& literal_):_literal(literal_) + { + _objectTypeEnum = GetFromLiteral(_literal); + } + + bool ObjectType::IsDeprecated(const ObjectTypeEnum objectType) + { + return false; + } + + std::string ObjectType::GetDeprecatedVersion(const ObjectTypeEnum objectType) + { + return ""; + } + + std::string ObjectType::GetDeprecatedComment(const ObjectTypeEnum objectType) + { + return ""; + } + + std::string ObjectType::GetLiteral() const + { + return _literal; + } + + ObjectType& ObjectType::operator= (const ObjectTypeEnum &rhs) + { + _objectTypeEnum = rhs; + _literal = kObjectTypeEnumString[_objectTypeEnum+1]; + return *this; + } + + ObjectType& ObjectType::operator= (const ObjectType &rhs ) + { + _literal = rhs._literal; + _objectTypeEnum = rhs._objectTypeEnum; + return *this; + } + + bool ObjectType::operator== (const ObjectTypeEnum &rhs) const + { + return _objectTypeEnum == rhs; + } + + ObjectType::ObjectTypeEnum ObjectType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ParameterType::_stringToEnum = + { + {"boolean", BOOLEAN}, + {"dateTime", DATE_TIME}, + {"double", DOUBLE}, + {"int", INT}, + {"integer", INTEGER}, + {"string", STRING}, + {"unsignedInt", UNSIGNED_INT}, + {"unsignedShort", UNSIGNED_SHORT}, + }; + + std::map ParameterType::_enumToDeprecated = + { + {ParameterType::BOOLEAN, false}, + {ParameterType::DATE_TIME, false}, + {ParameterType::DOUBLE, false}, + {ParameterType::INT, false}, + {ParameterType::INTEGER, true}, + {ParameterType::STRING, false}, + {ParameterType::UNSIGNED_INT, false}, + {ParameterType::UNSIGNED_SHORT, false}, + }; + std::map ParameterType::_enumToDeprecatedVersion + { + {ParameterType::BOOLEAN, ""}, + {ParameterType::DATE_TIME, ""}, + {ParameterType::DOUBLE, ""}, + {ParameterType::INT, ""}, + {ParameterType::INTEGER, "1.2"}, + {ParameterType::STRING, ""}, + {ParameterType::UNSIGNED_INT, ""}, + {ParameterType::UNSIGNED_SHORT, ""}, + }; + std::map ParameterType::_enumToDeprecatedComment + { + {ParameterType::BOOLEAN, ""}, + {ParameterType::DATE_TIME, ""}, + {ParameterType::DOUBLE, ""}, + {ParameterType::INT, ""}, + {ParameterType::INTEGER, "Deprecated for consistency with xsd type. Use int instead."}, + {ParameterType::STRING, ""}, + {ParameterType::UNSIGNED_INT, ""}, + {ParameterType::UNSIGNED_SHORT, ""}, + }; + + + + ParameterType::ParameterType() + { + _literal = kParameterTypeEnumString[0]; + _parameterTypeEnum = GetFromLiteral(_literal); + } + + ParameterType::ParameterType(ParameterTypeEnum& parameterType) + { + _literal = kParameterTypeEnumString[parameterType+1]; + _parameterTypeEnum = GetFromLiteral(_literal); + } + + ParameterType::ParameterType(const ParameterTypeEnum parameterType) + { + _literal = kParameterTypeEnumString[parameterType+1]; + _parameterTypeEnum = GetFromLiteral(_literal); + } + + ParameterType::ParameterType(std::string& literal_):_literal(literal_) + { + _parameterTypeEnum = GetFromLiteral(_literal); + } + + bool ParameterType::IsDeprecated(const ParameterTypeEnum parameterType) + { + return _enumToDeprecated[parameterType]; + } + + std::string ParameterType::GetDeprecatedVersion(const ParameterTypeEnum parameterType) + { + return _enumToDeprecatedVersion[parameterType]; + } + + std::string ParameterType::GetDeprecatedComment(const ParameterTypeEnum parameterType) + { + return _enumToDeprecatedComment[parameterType]; + } + + std::string ParameterType::GetLiteral() const + { + return _literal; + } + + ParameterType& ParameterType::operator= (const ParameterTypeEnum &rhs) + { + _parameterTypeEnum = rhs; + _literal = kParameterTypeEnumString[_parameterTypeEnum+1]; + return *this; + } + + ParameterType& ParameterType::operator= (const ParameterType &rhs ) + { + _literal = rhs._literal; + _parameterTypeEnum = rhs._parameterTypeEnum; + return *this; + } + + bool ParameterType::operator== (const ParameterTypeEnum &rhs) const + { + return _parameterTypeEnum == rhs; + } + + ParameterType::ParameterTypeEnum ParameterType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map PedestrianCategory::_stringToEnum = + { + {"animal", ANIMAL}, + {"pedestrian", PEDESTRIAN}, + {"wheelchair", WHEELCHAIR}, + }; + + + PedestrianCategory::PedestrianCategory() + { + _literal = kPedestrianCategoryEnumString[0]; + _pedestrianCategoryEnum = GetFromLiteral(_literal); + } + + PedestrianCategory::PedestrianCategory(PedestrianCategoryEnum& pedestrianCategory) + { + _literal = kPedestrianCategoryEnumString[pedestrianCategory+1]; + _pedestrianCategoryEnum = GetFromLiteral(_literal); + } + + PedestrianCategory::PedestrianCategory(const PedestrianCategoryEnum pedestrianCategory) + { + _literal = kPedestrianCategoryEnumString[pedestrianCategory+1]; + _pedestrianCategoryEnum = GetFromLiteral(_literal); + } + + PedestrianCategory::PedestrianCategory(std::string& literal_):_literal(literal_) + { + _pedestrianCategoryEnum = GetFromLiteral(_literal); + } + + bool PedestrianCategory::IsDeprecated(const PedestrianCategoryEnum pedestrianCategory) + { + return false; + } + + std::string PedestrianCategory::GetDeprecatedVersion(const PedestrianCategoryEnum pedestrianCategory) + { + return ""; + } + + std::string PedestrianCategory::GetDeprecatedComment(const PedestrianCategoryEnum pedestrianCategory) + { + return ""; + } + + std::string PedestrianCategory::GetLiteral() const + { + return _literal; + } + + PedestrianCategory& PedestrianCategory::operator= (const PedestrianCategoryEnum &rhs) + { + _pedestrianCategoryEnum = rhs; + _literal = kPedestrianCategoryEnumString[_pedestrianCategoryEnum+1]; + return *this; + } + + PedestrianCategory& PedestrianCategory::operator= (const PedestrianCategory &rhs ) + { + _literal = rhs._literal; + _pedestrianCategoryEnum = rhs._pedestrianCategoryEnum; + return *this; + } + + bool PedestrianCategory::operator== (const PedestrianCategoryEnum &rhs) const + { + return _pedestrianCategoryEnum == rhs; + } + + PedestrianCategory::PedestrianCategoryEnum PedestrianCategory::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map PedestrianGestureType::_stringToEnum = + { + {"coffeeLeftHand", COFFEE_LEFT_HAND}, + {"coffeeRightHand", COFFEE_RIGHT_HAND}, + {"crossArms", CROSS_ARMS}, + {"phoneCallLeftHand", PHONE_CALL_LEFT_HAND}, + {"phoneCallRightHand", PHONE_CALL_RIGHT_HAND}, + {"phoneTextLeftHand", PHONE_TEXT_LEFT_HAND}, + {"phoneTextRightHand", PHONE_TEXT_RIGHT_HAND}, + {"sandwichLeftHand", SANDWICH_LEFT_HAND}, + {"sandwichRightHand", SANDWICH_RIGHT_HAND}, + {"umbrellaLeftHand", UMBRELLA_LEFT_HAND}, + {"umbrellaRightHand", UMBRELLA_RIGHT_HAND}, + {"wavingLeftArm", WAVING_LEFT_ARM}, + {"wavingRightArm", WAVING_RIGHT_ARM}, + }; + + + PedestrianGestureType::PedestrianGestureType() + { + _literal = kPedestrianGestureTypeEnumString[0]; + _pedestrianGestureTypeEnum = GetFromLiteral(_literal); + } + + PedestrianGestureType::PedestrianGestureType(PedestrianGestureTypeEnum& pedestrianGestureType) + { + _literal = kPedestrianGestureTypeEnumString[pedestrianGestureType+1]; + _pedestrianGestureTypeEnum = GetFromLiteral(_literal); + } + + PedestrianGestureType::PedestrianGestureType(const PedestrianGestureTypeEnum pedestrianGestureType) + { + _literal = kPedestrianGestureTypeEnumString[pedestrianGestureType+1]; + _pedestrianGestureTypeEnum = GetFromLiteral(_literal); + } + + PedestrianGestureType::PedestrianGestureType(std::string& literal_):_literal(literal_) + { + _pedestrianGestureTypeEnum = GetFromLiteral(_literal); + } + + bool PedestrianGestureType::IsDeprecated(const PedestrianGestureTypeEnum pedestrianGestureType) + { + return false; + } + + std::string PedestrianGestureType::GetDeprecatedVersion(const PedestrianGestureTypeEnum pedestrianGestureType) + { + return ""; + } + + std::string PedestrianGestureType::GetDeprecatedComment(const PedestrianGestureTypeEnum pedestrianGestureType) + { + return ""; + } + + std::string PedestrianGestureType::GetLiteral() const + { + return _literal; + } + + PedestrianGestureType& PedestrianGestureType::operator= (const PedestrianGestureTypeEnum &rhs) + { + _pedestrianGestureTypeEnum = rhs; + _literal = kPedestrianGestureTypeEnumString[_pedestrianGestureTypeEnum+1]; + return *this; + } + + PedestrianGestureType& PedestrianGestureType::operator= (const PedestrianGestureType &rhs ) + { + _literal = rhs._literal; + _pedestrianGestureTypeEnum = rhs._pedestrianGestureTypeEnum; + return *this; + } + + bool PedestrianGestureType::operator== (const PedestrianGestureTypeEnum &rhs) const + { + return _pedestrianGestureTypeEnum == rhs; + } + + PedestrianGestureType::PedestrianGestureTypeEnum PedestrianGestureType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map PedestrianMotionType::_stringToEnum = + { + {"bendingDown", BENDING_DOWN}, + {"crawling", CRAWLING}, + {"cycling", CYCLING}, + {"ducking", DUCKING}, + {"jumping", JUMPING}, + {"lying", LYING}, + {"reeling", REELING}, + {"running", RUNNING}, + {"sitting", SITTING}, + {"squatting", SQUATTING}, + {"standing", STANDING}, + {"walking", WALKING}, + }; + + + PedestrianMotionType::PedestrianMotionType() + { + _literal = kPedestrianMotionTypeEnumString[0]; + _pedestrianMotionTypeEnum = GetFromLiteral(_literal); + } + + PedestrianMotionType::PedestrianMotionType(PedestrianMotionTypeEnum& pedestrianMotionType) + { + _literal = kPedestrianMotionTypeEnumString[pedestrianMotionType+1]; + _pedestrianMotionTypeEnum = GetFromLiteral(_literal); + } + + PedestrianMotionType::PedestrianMotionType(const PedestrianMotionTypeEnum pedestrianMotionType) + { + _literal = kPedestrianMotionTypeEnumString[pedestrianMotionType+1]; + _pedestrianMotionTypeEnum = GetFromLiteral(_literal); + } + + PedestrianMotionType::PedestrianMotionType(std::string& literal_):_literal(literal_) + { + _pedestrianMotionTypeEnum = GetFromLiteral(_literal); + } + + bool PedestrianMotionType::IsDeprecated(const PedestrianMotionTypeEnum pedestrianMotionType) + { + return false; + } + + std::string PedestrianMotionType::GetDeprecatedVersion(const PedestrianMotionTypeEnum pedestrianMotionType) + { + return ""; + } + + std::string PedestrianMotionType::GetDeprecatedComment(const PedestrianMotionTypeEnum pedestrianMotionType) + { + return ""; + } + + std::string PedestrianMotionType::GetLiteral() const + { + return _literal; + } + + PedestrianMotionType& PedestrianMotionType::operator= (const PedestrianMotionTypeEnum &rhs) + { + _pedestrianMotionTypeEnum = rhs; + _literal = kPedestrianMotionTypeEnumString[_pedestrianMotionTypeEnum+1]; + return *this; + } + + PedestrianMotionType& PedestrianMotionType::operator= (const PedestrianMotionType &rhs ) + { + _literal = rhs._literal; + _pedestrianMotionTypeEnum = rhs._pedestrianMotionTypeEnum; + return *this; + } + + bool PedestrianMotionType::operator== (const PedestrianMotionTypeEnum &rhs) const + { + return _pedestrianMotionTypeEnum == rhs; + } + + PedestrianMotionType::PedestrianMotionTypeEnum PedestrianMotionType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map PrecipitationType::_stringToEnum = + { + {"dry", DRY}, + {"rain", RAIN}, + {"snow", SNOW}, + }; + + + PrecipitationType::PrecipitationType() + { + _literal = kPrecipitationTypeEnumString[0]; + _precipitationTypeEnum = GetFromLiteral(_literal); + } + + PrecipitationType::PrecipitationType(PrecipitationTypeEnum& precipitationType) + { + _literal = kPrecipitationTypeEnumString[precipitationType+1]; + _precipitationTypeEnum = GetFromLiteral(_literal); + } + + PrecipitationType::PrecipitationType(const PrecipitationTypeEnum precipitationType) + { + _literal = kPrecipitationTypeEnumString[precipitationType+1]; + _precipitationTypeEnum = GetFromLiteral(_literal); + } + + PrecipitationType::PrecipitationType(std::string& literal_):_literal(literal_) + { + _precipitationTypeEnum = GetFromLiteral(_literal); + } + + bool PrecipitationType::IsDeprecated(const PrecipitationTypeEnum precipitationType) + { + return false; + } + + std::string PrecipitationType::GetDeprecatedVersion(const PrecipitationTypeEnum precipitationType) + { + return ""; + } + + std::string PrecipitationType::GetDeprecatedComment(const PrecipitationTypeEnum precipitationType) + { + return ""; + } + + std::string PrecipitationType::GetLiteral() const + { + return _literal; + } + + PrecipitationType& PrecipitationType::operator= (const PrecipitationTypeEnum &rhs) + { + _precipitationTypeEnum = rhs; + _literal = kPrecipitationTypeEnumString[_precipitationTypeEnum+1]; + return *this; + } + + PrecipitationType& PrecipitationType::operator= (const PrecipitationType &rhs ) + { + _literal = rhs._literal; + _precipitationTypeEnum = rhs._precipitationTypeEnum; + return *this; + } + + bool PrecipitationType::operator== (const PrecipitationTypeEnum &rhs) const + { + return _precipitationTypeEnum == rhs; + } + + PrecipitationType::PrecipitationTypeEnum PrecipitationType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map Priority::_stringToEnum = + { + {"override", OVERRIDE}, + {"overwrite", OVERWRITE}, + {"parallel", PARALLEL}, + {"skip", SKIP}, + }; + + std::map Priority::_enumToDeprecated = + { + {Priority::OVERRIDE, false}, + {Priority::OVERWRITE, true}, + {Priority::PARALLEL, false}, + {Priority::SKIP, false}, + }; + std::map Priority::_enumToDeprecatedVersion + { + {Priority::OVERRIDE, ""}, + {Priority::OVERWRITE, "1.2"}, + {Priority::PARALLEL, ""}, + {Priority::SKIP, ""}, + }; + std::map Priority::_enumToDeprecatedComment + { + {Priority::OVERRIDE, ""}, + {Priority::OVERWRITE, "Deprecated for consistency. Use override instead"}, + {Priority::PARALLEL, ""}, + {Priority::SKIP, ""}, + }; + + + + Priority::Priority() + { + _literal = kPriorityEnumString[0]; + _priorityEnum = GetFromLiteral(_literal); + } + + Priority::Priority(PriorityEnum& priority) + { + _literal = kPriorityEnumString[priority+1]; + _priorityEnum = GetFromLiteral(_literal); + } + + Priority::Priority(const PriorityEnum priority) + { + _literal = kPriorityEnumString[priority+1]; + _priorityEnum = GetFromLiteral(_literal); + } + + Priority::Priority(std::string& literal_):_literal(literal_) + { + _priorityEnum = GetFromLiteral(_literal); + } + + bool Priority::IsDeprecated(const PriorityEnum priority) + { + return _enumToDeprecated[priority]; + } + + std::string Priority::GetDeprecatedVersion(const PriorityEnum priority) + { + return _enumToDeprecatedVersion[priority]; + } + + std::string Priority::GetDeprecatedComment(const PriorityEnum priority) + { + return _enumToDeprecatedComment[priority]; + } + + std::string Priority::GetLiteral() const + { + return _literal; + } + + Priority& Priority::operator= (const PriorityEnum &rhs) + { + _priorityEnum = rhs; + _literal = kPriorityEnumString[_priorityEnum+1]; + return *this; + } + + Priority& Priority::operator= (const Priority &rhs ) + { + _literal = rhs._literal; + _priorityEnum = rhs._priorityEnum; + return *this; + } + + bool Priority::operator== (const PriorityEnum &rhs) const + { + return _priorityEnum == rhs; + } + + Priority::PriorityEnum Priority::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map ReferenceContext::_stringToEnum = + { + {"absolute", ABSOLUTE}, + {"relative", RELATIVE}, + }; + + + ReferenceContext::ReferenceContext() + { + _literal = kReferenceContextEnumString[0]; + _referenceContextEnum = GetFromLiteral(_literal); + } + + ReferenceContext::ReferenceContext(ReferenceContextEnum& referenceContext) + { + _literal = kReferenceContextEnumString[referenceContext+1]; + _referenceContextEnum = GetFromLiteral(_literal); + } + + ReferenceContext::ReferenceContext(const ReferenceContextEnum referenceContext) + { + _literal = kReferenceContextEnumString[referenceContext+1]; + _referenceContextEnum = GetFromLiteral(_literal); + } + + ReferenceContext::ReferenceContext(std::string& literal_):_literal(literal_) + { + _referenceContextEnum = GetFromLiteral(_literal); + } + + bool ReferenceContext::IsDeprecated(const ReferenceContextEnum referenceContext) + { + return false; + } + + std::string ReferenceContext::GetDeprecatedVersion(const ReferenceContextEnum referenceContext) + { + return ""; + } + + std::string ReferenceContext::GetDeprecatedComment(const ReferenceContextEnum referenceContext) + { + return ""; + } + + std::string ReferenceContext::GetLiteral() const + { + return _literal; + } + + ReferenceContext& ReferenceContext::operator= (const ReferenceContextEnum &rhs) + { + _referenceContextEnum = rhs; + _literal = kReferenceContextEnumString[_referenceContextEnum+1]; + return *this; + } + + ReferenceContext& ReferenceContext::operator= (const ReferenceContext &rhs ) + { + _literal = rhs._literal; + _referenceContextEnum = rhs._referenceContextEnum; + return *this; + } + + bool ReferenceContext::operator== (const ReferenceContextEnum &rhs) const + { + return _referenceContextEnum == rhs; + } + + ReferenceContext::ReferenceContextEnum ReferenceContext::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map RelativeDistanceType::_stringToEnum = + { + {"cartesianDistance", CARTESIAN_DISTANCE}, + {"euclidianDistance", EUCLIDIAN_DISTANCE}, + {"lateral", LATERAL}, + {"longitudinal", LONGITUDINAL}, + }; + + std::map RelativeDistanceType::_enumToDeprecated = + { + {RelativeDistanceType::CARTESIAN_DISTANCE, true}, + {RelativeDistanceType::EUCLIDIAN_DISTANCE, false}, + {RelativeDistanceType::LATERAL, false}, + {RelativeDistanceType::LONGITUDINAL, false}, + }; + std::map RelativeDistanceType::_enumToDeprecatedVersion + { + {RelativeDistanceType::CARTESIAN_DISTANCE, "1.1"}, + {RelativeDistanceType::EUCLIDIAN_DISTANCE, ""}, + {RelativeDistanceType::LATERAL, ""}, + {RelativeDistanceType::LONGITUDINAL, ""}, + }; + std::map RelativeDistanceType::_enumToDeprecatedComment + { + {RelativeDistanceType::CARTESIAN_DISTANCE, "Use euclideanDistance"}, + {RelativeDistanceType::EUCLIDIAN_DISTANCE, ""}, + {RelativeDistanceType::LATERAL, ""}, + {RelativeDistanceType::LONGITUDINAL, ""}, + }; + + + + RelativeDistanceType::RelativeDistanceType() + { + _literal = kRelativeDistanceTypeEnumString[0]; + _relativeDistanceTypeEnum = GetFromLiteral(_literal); + } + + RelativeDistanceType::RelativeDistanceType(RelativeDistanceTypeEnum& relativeDistanceType) + { + _literal = kRelativeDistanceTypeEnumString[relativeDistanceType+1]; + _relativeDistanceTypeEnum = GetFromLiteral(_literal); + } + + RelativeDistanceType::RelativeDistanceType(const RelativeDistanceTypeEnum relativeDistanceType) + { + _literal = kRelativeDistanceTypeEnumString[relativeDistanceType+1]; + _relativeDistanceTypeEnum = GetFromLiteral(_literal); + } + + RelativeDistanceType::RelativeDistanceType(std::string& literal_):_literal(literal_) + { + _relativeDistanceTypeEnum = GetFromLiteral(_literal); + } + + bool RelativeDistanceType::IsDeprecated(const RelativeDistanceTypeEnum relativeDistanceType) + { + return _enumToDeprecated[relativeDistanceType]; + } + + std::string RelativeDistanceType::GetDeprecatedVersion(const RelativeDistanceTypeEnum relativeDistanceType) + { + return _enumToDeprecatedVersion[relativeDistanceType]; + } + + std::string RelativeDistanceType::GetDeprecatedComment(const RelativeDistanceTypeEnum relativeDistanceType) + { + return _enumToDeprecatedComment[relativeDistanceType]; + } + + std::string RelativeDistanceType::GetLiteral() const + { + return _literal; + } + + RelativeDistanceType& RelativeDistanceType::operator= (const RelativeDistanceTypeEnum &rhs) + { + _relativeDistanceTypeEnum = rhs; + _literal = kRelativeDistanceTypeEnumString[_relativeDistanceTypeEnum+1]; + return *this; + } + + RelativeDistanceType& RelativeDistanceType::operator= (const RelativeDistanceType &rhs ) + { + _literal = rhs._literal; + _relativeDistanceTypeEnum = rhs._relativeDistanceTypeEnum; + return *this; + } + + bool RelativeDistanceType::operator== (const RelativeDistanceTypeEnum &rhs) const + { + return _relativeDistanceTypeEnum == rhs; + } + + RelativeDistanceType::RelativeDistanceTypeEnum RelativeDistanceType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map Role::_stringToEnum = + { + {"ambulance", AMBULANCE}, + {"civil", CIVIL}, + {"fire", FIRE}, + {"military", MILITARY}, + {"none", NONE}, + {"police", POLICE}, + {"publicTransport", PUBLIC_TRANSPORT}, + {"roadAssistance", ROAD_ASSISTANCE}, + }; + + + Role::Role() + { + _literal = kRoleEnumString[0]; + _roleEnum = GetFromLiteral(_literal); + } + + Role::Role(RoleEnum& role) + { + _literal = kRoleEnumString[role+1]; + _roleEnum = GetFromLiteral(_literal); + } + + Role::Role(const RoleEnum role) + { + _literal = kRoleEnumString[role+1]; + _roleEnum = GetFromLiteral(_literal); + } + + Role::Role(std::string& literal_):_literal(literal_) + { + _roleEnum = GetFromLiteral(_literal); + } + + bool Role::IsDeprecated(const RoleEnum role) + { + return false; + } + + std::string Role::GetDeprecatedVersion(const RoleEnum role) + { + return ""; + } + + std::string Role::GetDeprecatedComment(const RoleEnum role) + { + return ""; + } + + std::string Role::GetLiteral() const + { + return _literal; + } + + Role& Role::operator= (const RoleEnum &rhs) + { + _roleEnum = rhs; + _literal = kRoleEnumString[_roleEnum+1]; + return *this; + } + + Role& Role::operator= (const Role &rhs ) + { + _literal = rhs._literal; + _roleEnum = rhs._roleEnum; + return *this; + } + + bool Role::operator== (const RoleEnum &rhs) const + { + return _roleEnum == rhs; + } + + Role::RoleEnum Role::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map RouteStrategy::_stringToEnum = + { + {"fastest", FASTEST}, + {"leastIntersections", LEAST_INTERSECTIONS}, + {"random", RANDOM}, + {"shortest", SHORTEST}, + }; + + + RouteStrategy::RouteStrategy() + { + _literal = kRouteStrategyEnumString[0]; + _routeStrategyEnum = GetFromLiteral(_literal); + } + + RouteStrategy::RouteStrategy(RouteStrategyEnum& routeStrategy) + { + _literal = kRouteStrategyEnumString[routeStrategy+1]; + _routeStrategyEnum = GetFromLiteral(_literal); + } + + RouteStrategy::RouteStrategy(const RouteStrategyEnum routeStrategy) + { + _literal = kRouteStrategyEnumString[routeStrategy+1]; + _routeStrategyEnum = GetFromLiteral(_literal); + } + + RouteStrategy::RouteStrategy(std::string& literal_):_literal(literal_) + { + _routeStrategyEnum = GetFromLiteral(_literal); + } + + bool RouteStrategy::IsDeprecated(const RouteStrategyEnum routeStrategy) + { + return false; + } + + std::string RouteStrategy::GetDeprecatedVersion(const RouteStrategyEnum routeStrategy) + { + return ""; + } + + std::string RouteStrategy::GetDeprecatedComment(const RouteStrategyEnum routeStrategy) + { + return ""; + } + + std::string RouteStrategy::GetLiteral() const + { + return _literal; + } + + RouteStrategy& RouteStrategy::operator= (const RouteStrategyEnum &rhs) + { + _routeStrategyEnum = rhs; + _literal = kRouteStrategyEnumString[_routeStrategyEnum+1]; + return *this; + } + + RouteStrategy& RouteStrategy::operator= (const RouteStrategy &rhs ) + { + _literal = rhs._literal; + _routeStrategyEnum = rhs._routeStrategyEnum; + return *this; + } + + bool RouteStrategy::operator== (const RouteStrategyEnum &rhs) const + { + return _routeStrategyEnum == rhs; + } + + RouteStrategy::RouteStrategyEnum RouteStrategy::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map RoutingAlgorithm::_stringToEnum = + { + {"assignedRoute", ASSIGNED_ROUTE}, + {"fastest", FASTEST}, + {"leastIntersections", LEAST_INTERSECTIONS}, + {"shortest", SHORTEST}, + {"undefined", UNDEFINED}, + }; + + + RoutingAlgorithm::RoutingAlgorithm() + { + _literal = kRoutingAlgorithmEnumString[0]; + _routingAlgorithmEnum = GetFromLiteral(_literal); + } + + RoutingAlgorithm::RoutingAlgorithm(RoutingAlgorithmEnum& routingAlgorithm) + { + _literal = kRoutingAlgorithmEnumString[routingAlgorithm+1]; + _routingAlgorithmEnum = GetFromLiteral(_literal); + } + + RoutingAlgorithm::RoutingAlgorithm(const RoutingAlgorithmEnum routingAlgorithm) + { + _literal = kRoutingAlgorithmEnumString[routingAlgorithm+1]; + _routingAlgorithmEnum = GetFromLiteral(_literal); + } + + RoutingAlgorithm::RoutingAlgorithm(std::string& literal_):_literal(literal_) + { + _routingAlgorithmEnum = GetFromLiteral(_literal); + } + + bool RoutingAlgorithm::IsDeprecated(const RoutingAlgorithmEnum routingAlgorithm) + { + return false; + } + + std::string RoutingAlgorithm::GetDeprecatedVersion(const RoutingAlgorithmEnum routingAlgorithm) + { + return ""; + } + + std::string RoutingAlgorithm::GetDeprecatedComment(const RoutingAlgorithmEnum routingAlgorithm) + { + return ""; + } + + std::string RoutingAlgorithm::GetLiteral() const + { + return _literal; + } + + RoutingAlgorithm& RoutingAlgorithm::operator= (const RoutingAlgorithmEnum &rhs) + { + _routingAlgorithmEnum = rhs; + _literal = kRoutingAlgorithmEnumString[_routingAlgorithmEnum+1]; + return *this; + } + + RoutingAlgorithm& RoutingAlgorithm::operator= (const RoutingAlgorithm &rhs ) + { + _literal = rhs._literal; + _routingAlgorithmEnum = rhs._routingAlgorithmEnum; + return *this; + } + + bool RoutingAlgorithm::operator== (const RoutingAlgorithmEnum &rhs) const + { + return _routingAlgorithmEnum == rhs; + } + + RoutingAlgorithm::RoutingAlgorithmEnum RoutingAlgorithm::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map Rule::_stringToEnum = + { + {"equalTo", EQUAL_TO}, + {"greaterOrEqual", GREATER_OR_EQUAL}, + {"greaterThan", GREATER_THAN}, + {"lessOrEqual", LESS_OR_EQUAL}, + {"lessThan", LESS_THAN}, + {"notEqualTo", NOT_EQUAL_TO}, + }; + + + Rule::Rule() + { + _literal = kRuleEnumString[0]; + _ruleEnum = GetFromLiteral(_literal); + } + + Rule::Rule(RuleEnum& rule) + { + _literal = kRuleEnumString[rule+1]; + _ruleEnum = GetFromLiteral(_literal); + } + + Rule::Rule(const RuleEnum rule) + { + _literal = kRuleEnumString[rule+1]; + _ruleEnum = GetFromLiteral(_literal); + } + + Rule::Rule(std::string& literal_):_literal(literal_) + { + _ruleEnum = GetFromLiteral(_literal); + } + + bool Rule::IsDeprecated(const RuleEnum rule) + { + return false; + } + + std::string Rule::GetDeprecatedVersion(const RuleEnum rule) + { + return ""; + } + + std::string Rule::GetDeprecatedComment(const RuleEnum rule) + { + return ""; + } + + std::string Rule::GetLiteral() const + { + return _literal; + } + + Rule& Rule::operator= (const RuleEnum &rhs) + { + _ruleEnum = rhs; + _literal = kRuleEnumString[_ruleEnum+1]; + return *this; + } + + Rule& Rule::operator= (const Rule &rhs ) + { + _literal = rhs._literal; + _ruleEnum = rhs._ruleEnum; + return *this; + } + + bool Rule::operator== (const RuleEnum &rhs) const + { + return _ruleEnum == rhs; + } + + Rule::RuleEnum Rule::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map SpeedTargetValueType::_stringToEnum = + { + {"delta", DELTA}, + {"factor", FACTOR}, + }; + + + SpeedTargetValueType::SpeedTargetValueType() + { + _literal = kSpeedTargetValueTypeEnumString[0]; + _speedTargetValueTypeEnum = GetFromLiteral(_literal); + } + + SpeedTargetValueType::SpeedTargetValueType(SpeedTargetValueTypeEnum& speedTargetValueType) + { + _literal = kSpeedTargetValueTypeEnumString[speedTargetValueType+1]; + _speedTargetValueTypeEnum = GetFromLiteral(_literal); + } + + SpeedTargetValueType::SpeedTargetValueType(const SpeedTargetValueTypeEnum speedTargetValueType) + { + _literal = kSpeedTargetValueTypeEnumString[speedTargetValueType+1]; + _speedTargetValueTypeEnum = GetFromLiteral(_literal); + } + + SpeedTargetValueType::SpeedTargetValueType(std::string& literal_):_literal(literal_) + { + _speedTargetValueTypeEnum = GetFromLiteral(_literal); + } + + bool SpeedTargetValueType::IsDeprecated(const SpeedTargetValueTypeEnum speedTargetValueType) + { + return false; + } + + std::string SpeedTargetValueType::GetDeprecatedVersion(const SpeedTargetValueTypeEnum speedTargetValueType) + { + return ""; + } + + std::string SpeedTargetValueType::GetDeprecatedComment(const SpeedTargetValueTypeEnum speedTargetValueType) + { + return ""; + } + + std::string SpeedTargetValueType::GetLiteral() const + { + return _literal; + } + + SpeedTargetValueType& SpeedTargetValueType::operator= (const SpeedTargetValueTypeEnum &rhs) + { + _speedTargetValueTypeEnum = rhs; + _literal = kSpeedTargetValueTypeEnumString[_speedTargetValueTypeEnum+1]; + return *this; + } + + SpeedTargetValueType& SpeedTargetValueType::operator= (const SpeedTargetValueType &rhs ) + { + _literal = rhs._literal; + _speedTargetValueTypeEnum = rhs._speedTargetValueTypeEnum; + return *this; + } + + bool SpeedTargetValueType::operator== (const SpeedTargetValueTypeEnum &rhs) const + { + return _speedTargetValueTypeEnum == rhs; + } + + SpeedTargetValueType::SpeedTargetValueTypeEnum SpeedTargetValueType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map StoryboardElementState::_stringToEnum = + { + {"completeState", COMPLETE_STATE}, + {"endTransition", END_TRANSITION}, + {"runningState", RUNNING_STATE}, + {"skipTransition", SKIP_TRANSITION}, + {"standbyState", STANDBY_STATE}, + {"startTransition", START_TRANSITION}, + {"stopTransition", STOP_TRANSITION}, + }; + + + StoryboardElementState::StoryboardElementState() + { + _literal = kStoryboardElementStateEnumString[0]; + _storyboardElementStateEnum = GetFromLiteral(_literal); + } + + StoryboardElementState::StoryboardElementState(StoryboardElementStateEnum& storyboardElementState) + { + _literal = kStoryboardElementStateEnumString[storyboardElementState+1]; + _storyboardElementStateEnum = GetFromLiteral(_literal); + } + + StoryboardElementState::StoryboardElementState(const StoryboardElementStateEnum storyboardElementState) + { + _literal = kStoryboardElementStateEnumString[storyboardElementState+1]; + _storyboardElementStateEnum = GetFromLiteral(_literal); + } + + StoryboardElementState::StoryboardElementState(std::string& literal_):_literal(literal_) + { + _storyboardElementStateEnum = GetFromLiteral(_literal); + } + + bool StoryboardElementState::IsDeprecated(const StoryboardElementStateEnum storyboardElementState) + { + return false; + } + + std::string StoryboardElementState::GetDeprecatedVersion(const StoryboardElementStateEnum storyboardElementState) + { + return ""; + } + + std::string StoryboardElementState::GetDeprecatedComment(const StoryboardElementStateEnum storyboardElementState) + { + return ""; + } + + std::string StoryboardElementState::GetLiteral() const + { + return _literal; + } + + StoryboardElementState& StoryboardElementState::operator= (const StoryboardElementStateEnum &rhs) + { + _storyboardElementStateEnum = rhs; + _literal = kStoryboardElementStateEnumString[_storyboardElementStateEnum+1]; + return *this; + } + + StoryboardElementState& StoryboardElementState::operator= (const StoryboardElementState &rhs ) + { + _literal = rhs._literal; + _storyboardElementStateEnum = rhs._storyboardElementStateEnum; + return *this; + } + + bool StoryboardElementState::operator== (const StoryboardElementStateEnum &rhs) const + { + return _storyboardElementStateEnum == rhs; + } + + StoryboardElementState::StoryboardElementStateEnum StoryboardElementState::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map StoryboardElementType::_stringToEnum = + { + {"act", ACT}, + {"action", ACTION}, + {"event", EVENT}, + {"maneuver", MANEUVER}, + {"maneuverGroup", MANEUVER_GROUP}, + {"story", STORY}, + }; + + + StoryboardElementType::StoryboardElementType() + { + _literal = kStoryboardElementTypeEnumString[0]; + _storyboardElementTypeEnum = GetFromLiteral(_literal); + } + + StoryboardElementType::StoryboardElementType(StoryboardElementTypeEnum& storyboardElementType) + { + _literal = kStoryboardElementTypeEnumString[storyboardElementType+1]; + _storyboardElementTypeEnum = GetFromLiteral(_literal); + } + + StoryboardElementType::StoryboardElementType(const StoryboardElementTypeEnum storyboardElementType) + { + _literal = kStoryboardElementTypeEnumString[storyboardElementType+1]; + _storyboardElementTypeEnum = GetFromLiteral(_literal); + } + + StoryboardElementType::StoryboardElementType(std::string& literal_):_literal(literal_) + { + _storyboardElementTypeEnum = GetFromLiteral(_literal); + } + + bool StoryboardElementType::IsDeprecated(const StoryboardElementTypeEnum storyboardElementType) + { + return false; + } + + std::string StoryboardElementType::GetDeprecatedVersion(const StoryboardElementTypeEnum storyboardElementType) + { + return ""; + } + + std::string StoryboardElementType::GetDeprecatedComment(const StoryboardElementTypeEnum storyboardElementType) + { + return ""; + } + + std::string StoryboardElementType::GetLiteral() const + { + return _literal; + } + + StoryboardElementType& StoryboardElementType::operator= (const StoryboardElementTypeEnum &rhs) + { + _storyboardElementTypeEnum = rhs; + _literal = kStoryboardElementTypeEnumString[_storyboardElementTypeEnum+1]; + return *this; + } + + StoryboardElementType& StoryboardElementType::operator= (const StoryboardElementType &rhs ) + { + _literal = rhs._literal; + _storyboardElementTypeEnum = rhs._storyboardElementTypeEnum; + return *this; + } + + bool StoryboardElementType::operator== (const StoryboardElementTypeEnum &rhs) const + { + return _storyboardElementTypeEnum == rhs; + } + + StoryboardElementType::StoryboardElementTypeEnum StoryboardElementType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map TriggeringEntitiesRule::_stringToEnum = + { + {"all", ALL}, + {"any", ANY}, + }; + + + TriggeringEntitiesRule::TriggeringEntitiesRule() + { + _literal = kTriggeringEntitiesRuleEnumString[0]; + _triggeringEntitiesRuleEnum = GetFromLiteral(_literal); + } + + TriggeringEntitiesRule::TriggeringEntitiesRule(TriggeringEntitiesRuleEnum& triggeringEntitiesRule) + { + _literal = kTriggeringEntitiesRuleEnumString[triggeringEntitiesRule+1]; + _triggeringEntitiesRuleEnum = GetFromLiteral(_literal); + } + + TriggeringEntitiesRule::TriggeringEntitiesRule(const TriggeringEntitiesRuleEnum triggeringEntitiesRule) + { + _literal = kTriggeringEntitiesRuleEnumString[triggeringEntitiesRule+1]; + _triggeringEntitiesRuleEnum = GetFromLiteral(_literal); + } + + TriggeringEntitiesRule::TriggeringEntitiesRule(std::string& literal_):_literal(literal_) + { + _triggeringEntitiesRuleEnum = GetFromLiteral(_literal); + } + + bool TriggeringEntitiesRule::IsDeprecated(const TriggeringEntitiesRuleEnum triggeringEntitiesRule) + { + return false; + } + + std::string TriggeringEntitiesRule::GetDeprecatedVersion(const TriggeringEntitiesRuleEnum triggeringEntitiesRule) + { + return ""; + } + + std::string TriggeringEntitiesRule::GetDeprecatedComment(const TriggeringEntitiesRuleEnum triggeringEntitiesRule) + { + return ""; + } + + std::string TriggeringEntitiesRule::GetLiteral() const + { + return _literal; + } + + TriggeringEntitiesRule& TriggeringEntitiesRule::operator= (const TriggeringEntitiesRuleEnum &rhs) + { + _triggeringEntitiesRuleEnum = rhs; + _literal = kTriggeringEntitiesRuleEnumString[_triggeringEntitiesRuleEnum+1]; + return *this; + } + + TriggeringEntitiesRule& TriggeringEntitiesRule::operator= (const TriggeringEntitiesRule &rhs ) + { + _literal = rhs._literal; + _triggeringEntitiesRuleEnum = rhs._triggeringEntitiesRuleEnum; + return *this; + } + + bool TriggeringEntitiesRule::operator== (const TriggeringEntitiesRuleEnum &rhs) const + { + return _triggeringEntitiesRuleEnum == rhs; + } + + TriggeringEntitiesRule::TriggeringEntitiesRuleEnum TriggeringEntitiesRule::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map VehicleCategory::_stringToEnum = + { + {"bicycle", BICYCLE}, + {"bus", BUS}, + {"car", CAR}, + {"motorbike", MOTORBIKE}, + {"semitrailer", SEMITRAILER}, + {"trailer", TRAILER}, + {"train", TRAIN}, + {"tram", TRAM}, + {"truck", TRUCK}, + {"van", VAN}, + }; + + + VehicleCategory::VehicleCategory() + { + _literal = kVehicleCategoryEnumString[0]; + _vehicleCategoryEnum = GetFromLiteral(_literal); + } + + VehicleCategory::VehicleCategory(VehicleCategoryEnum& vehicleCategory) + { + _literal = kVehicleCategoryEnumString[vehicleCategory+1]; + _vehicleCategoryEnum = GetFromLiteral(_literal); + } + + VehicleCategory::VehicleCategory(const VehicleCategoryEnum vehicleCategory) + { + _literal = kVehicleCategoryEnumString[vehicleCategory+1]; + _vehicleCategoryEnum = GetFromLiteral(_literal); + } + + VehicleCategory::VehicleCategory(std::string& literal_):_literal(literal_) + { + _vehicleCategoryEnum = GetFromLiteral(_literal); + } + + bool VehicleCategory::IsDeprecated(const VehicleCategoryEnum vehicleCategory) + { + return false; + } + + std::string VehicleCategory::GetDeprecatedVersion(const VehicleCategoryEnum vehicleCategory) + { + return ""; + } + + std::string VehicleCategory::GetDeprecatedComment(const VehicleCategoryEnum vehicleCategory) + { + return ""; + } + + std::string VehicleCategory::GetLiteral() const + { + return _literal; + } + + VehicleCategory& VehicleCategory::operator= (const VehicleCategoryEnum &rhs) + { + _vehicleCategoryEnum = rhs; + _literal = kVehicleCategoryEnumString[_vehicleCategoryEnum+1]; + return *this; + } + + VehicleCategory& VehicleCategory::operator= (const VehicleCategory &rhs ) + { + _literal = rhs._literal; + _vehicleCategoryEnum = rhs._vehicleCategoryEnum; + return *this; + } + + bool VehicleCategory::operator== (const VehicleCategoryEnum &rhs) const + { + return _vehicleCategoryEnum == rhs; + } + + VehicleCategory::VehicleCategoryEnum VehicleCategory::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map VehicleComponentType::_stringToEnum = + { + {"doorFrontLeft", DOOR_FRONT_LEFT}, + {"doorFrontRight", DOOR_FRONT_RIGHT}, + {"doorRearLeft", DOOR_REAR_LEFT}, + {"doorRearRight", DOOR_REAR_RIGHT}, + {"hood", HOOD}, + {"sideMirrorLeft", SIDE_MIRROR_LEFT}, + {"sideMirrorRight", SIDE_MIRROR_RIGHT}, + {"sideMirrors", SIDE_MIRRORS}, + {"trunk", TRUNK}, + {"windowFrontLeft", WINDOW_FRONT_LEFT}, + {"windowFrontRight", WINDOW_FRONT_RIGHT}, + {"windowRearLeft", WINDOW_REAR_LEFT}, + {"windowRearRight", WINDOW_REAR_RIGHT}, + }; + + + VehicleComponentType::VehicleComponentType() + { + _literal = kVehicleComponentTypeEnumString[0]; + _vehicleComponentTypeEnum = GetFromLiteral(_literal); + } + + VehicleComponentType::VehicleComponentType(VehicleComponentTypeEnum& vehicleComponentType) + { + _literal = kVehicleComponentTypeEnumString[vehicleComponentType+1]; + _vehicleComponentTypeEnum = GetFromLiteral(_literal); + } + + VehicleComponentType::VehicleComponentType(const VehicleComponentTypeEnum vehicleComponentType) + { + _literal = kVehicleComponentTypeEnumString[vehicleComponentType+1]; + _vehicleComponentTypeEnum = GetFromLiteral(_literal); + } + + VehicleComponentType::VehicleComponentType(std::string& literal_):_literal(literal_) + { + _vehicleComponentTypeEnum = GetFromLiteral(_literal); + } + + bool VehicleComponentType::IsDeprecated(const VehicleComponentTypeEnum vehicleComponentType) + { + return false; + } + + std::string VehicleComponentType::GetDeprecatedVersion(const VehicleComponentTypeEnum vehicleComponentType) + { + return ""; + } + + std::string VehicleComponentType::GetDeprecatedComment(const VehicleComponentTypeEnum vehicleComponentType) + { + return ""; + } + + std::string VehicleComponentType::GetLiteral() const + { + return _literal; + } + + VehicleComponentType& VehicleComponentType::operator= (const VehicleComponentTypeEnum &rhs) + { + _vehicleComponentTypeEnum = rhs; + _literal = kVehicleComponentTypeEnumString[_vehicleComponentTypeEnum+1]; + return *this; + } + + VehicleComponentType& VehicleComponentType::operator= (const VehicleComponentType &rhs ) + { + _literal = rhs._literal; + _vehicleComponentTypeEnum = rhs._vehicleComponentTypeEnum; + return *this; + } + + bool VehicleComponentType::operator== (const VehicleComponentTypeEnum &rhs) const + { + return _vehicleComponentTypeEnum == rhs; + } + + VehicleComponentType::VehicleComponentTypeEnum VehicleComponentType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map VehicleLightType::_stringToEnum = + { + {"brakeLights", BRAKE_LIGHTS}, + {"daytimeRunningLights", DAYTIME_RUNNING_LIGHTS}, + {"fogLights", FOG_LIGHTS}, + {"fogLightsFront", FOG_LIGHTS_FRONT}, + {"fogLightsRear", FOG_LIGHTS_REAR}, + {"highBeam", HIGH_BEAM}, + {"indicatorLeft", INDICATOR_LEFT}, + {"indicatorRight", INDICATOR_RIGHT}, + {"licensePlateIllumination", LICENSE_PLATE_ILLUMINATION}, + {"lowBeam", LOW_BEAM}, + {"reversingLights", REVERSING_LIGHTS}, + {"specialPurposeLights", SPECIAL_PURPOSE_LIGHTS}, + {"warningLights", WARNING_LIGHTS}, + }; + + + VehicleLightType::VehicleLightType() + { + _literal = kVehicleLightTypeEnumString[0]; + _vehicleLightTypeEnum = GetFromLiteral(_literal); + } + + VehicleLightType::VehicleLightType(VehicleLightTypeEnum& vehicleLightType) + { + _literal = kVehicleLightTypeEnumString[vehicleLightType+1]; + _vehicleLightTypeEnum = GetFromLiteral(_literal); + } + + VehicleLightType::VehicleLightType(const VehicleLightTypeEnum vehicleLightType) + { + _literal = kVehicleLightTypeEnumString[vehicleLightType+1]; + _vehicleLightTypeEnum = GetFromLiteral(_literal); + } + + VehicleLightType::VehicleLightType(std::string& literal_):_literal(literal_) + { + _vehicleLightTypeEnum = GetFromLiteral(_literal); + } + + bool VehicleLightType::IsDeprecated(const VehicleLightTypeEnum vehicleLightType) + { + return false; + } + + std::string VehicleLightType::GetDeprecatedVersion(const VehicleLightTypeEnum vehicleLightType) + { + return ""; + } + + std::string VehicleLightType::GetDeprecatedComment(const VehicleLightTypeEnum vehicleLightType) + { + return ""; + } + + std::string VehicleLightType::GetLiteral() const + { + return _literal; + } + + VehicleLightType& VehicleLightType::operator= (const VehicleLightTypeEnum &rhs) + { + _vehicleLightTypeEnum = rhs; + _literal = kVehicleLightTypeEnumString[_vehicleLightTypeEnum+1]; + return *this; + } + + VehicleLightType& VehicleLightType::operator= (const VehicleLightType &rhs ) + { + _literal = rhs._literal; + _vehicleLightTypeEnum = rhs._vehicleLightTypeEnum; + return *this; + } + + bool VehicleLightType::operator== (const VehicleLightTypeEnum &rhs) const + { + return _vehicleLightTypeEnum == rhs; + } + + VehicleLightType::VehicleLightTypeEnum VehicleLightType::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + std::map Wetness::_stringToEnum = + { + {"dry", DRY}, + {"highFlooded", HIGH_FLOODED}, + {"lowFlooded", LOW_FLOODED}, + {"moist", MOIST}, + {"wetWithPuddles", WET_WITH_PUDDLES}, + }; + + + Wetness::Wetness() + { + _literal = kWetnessEnumString[0]; + _wetnessEnum = GetFromLiteral(_literal); + } + + Wetness::Wetness(WetnessEnum& wetness) + { + _literal = kWetnessEnumString[wetness+1]; + _wetnessEnum = GetFromLiteral(_literal); + } + + Wetness::Wetness(const WetnessEnum wetness) + { + _literal = kWetnessEnumString[wetness+1]; + _wetnessEnum = GetFromLiteral(_literal); + } + + Wetness::Wetness(std::string& literal_):_literal(literal_) + { + _wetnessEnum = GetFromLiteral(_literal); + } + + bool Wetness::IsDeprecated(const WetnessEnum wetness) + { + return false; + } + + std::string Wetness::GetDeprecatedVersion(const WetnessEnum wetness) + { + return ""; + } + + std::string Wetness::GetDeprecatedComment(const WetnessEnum wetness) + { + return ""; + } + + std::string Wetness::GetLiteral() const + { + return _literal; + } + + Wetness& Wetness::operator= (const WetnessEnum &rhs) + { + _wetnessEnum = rhs; + _literal = kWetnessEnumString[_wetnessEnum+1]; + return *this; + } + + Wetness& Wetness::operator= (const Wetness &rhs ) + { + _literal = rhs._literal; + _wetnessEnum = rhs._wetnessEnum; + return *this; + } + + bool Wetness::operator== (const WetnessEnum &rhs) const + { + return _wetnessEnum == rhs; + } + + Wetness::WetnessEnum Wetness::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.h new file mode 100644 index 00000000..d646d887 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/EnumerationsV1_3.h @@ -0,0 +1,3431 @@ + +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include +#include +#include "DateTime.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Angular coordinate. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Select the heading angle. + *
  • Select the pitch angle. + *
  • Select the roll angle. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AngleType + { + public: + enum AngleTypeEnum + { + UNKNOWN = -1, + HEADING, + PITCH, + ROLL, + }; + + private: + std::string _literal; + AngleTypeEnum _angleTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kAngleTypeEnumString + { + "UNKNOWN", + "heading", + "pitch", + "roll", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP AngleType(); + + OPENSCENARIOLIB_EXP AngleType(AngleTypeEnum& angleType); + + OPENSCENARIOLIB_EXP AngleType(const AngleTypeEnum angleType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const AngleTypeEnum angleType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const AngleTypeEnum angleType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const AngleTypeEnum angleType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP AngleType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP AngleType& operator= (const AngleTypeEnum &rhs); + + OPENSCENARIOLIB_EXP AngleType& operator= (const AngleType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const AngleTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static AngleTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Types for automatic gear description. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Drive position (D). + *
  • Neutral position (N). + *
  • Park position (P). + *
  • Reverse position (R). + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AutomaticGearType + { + public: + enum AutomaticGearTypeEnum + { + UNKNOWN = -1, + D, + N, + P, + R, + }; + + private: + std::string _literal; + AutomaticGearTypeEnum _automaticGearTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kAutomaticGearTypeEnumString + { + "UNKNOWN", + "d", + "n", + "p", + "r", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP AutomaticGearType(); + + OPENSCENARIOLIB_EXP AutomaticGearType(AutomaticGearTypeEnum& automaticGearType); + + OPENSCENARIOLIB_EXP AutomaticGearType(const AutomaticGearTypeEnum automaticGearType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const AutomaticGearTypeEnum automaticGearType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const AutomaticGearTypeEnum automaticGearType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const AutomaticGearTypeEnum automaticGearType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP AutomaticGearType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP AutomaticGearType& operator= (const AutomaticGearTypeEnum &rhs); + + OPENSCENARIOLIB_EXP AutomaticGearType& operator= (const AutomaticGearType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const AutomaticGearTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static AutomaticGearTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of cloud states. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Cloudy. There are more clouds than sunshine. + *
  • Cloud free conditions. + *
  • Overcast sky. Dull and gray looking. + *
  • Rain clouds. + *
  • Turns off the sky visualization. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CloudState + { + public: + enum CloudStateEnum + { + UNKNOWN = -1, + CLOUDY, + FREE, + OVERCAST, + RAINY, + SKY_OFF, + }; + + private: + std::string _literal; + CloudStateEnum _cloudStateEnum; + static std::map _stringToEnum; + + public: + const std::vector kCloudStateEnumString + { + "UNKNOWN", + "cloudy", + "free", + "overcast", + "rainy", + "skyOff", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP CloudState(); + + OPENSCENARIOLIB_EXP CloudState(CloudStateEnum& cloudState); + + OPENSCENARIOLIB_EXP CloudState(const CloudStateEnum cloudState); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const CloudStateEnum cloudState); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const CloudStateEnum cloudState); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const CloudStateEnum cloudState); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP CloudState(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP CloudState& operator= (const CloudStateEnum &rhs); + + OPENSCENARIOLIB_EXP CloudState& operator= (const CloudState &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const CloudStateEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static CloudStateEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Semantic value of a color. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Black color. + *
  • Blue color. + *
  • Brown color. + *
  • Green color. + *
  • Grey color. + *
  • Orange color. + *
  • Other (unspecified but known) color. + *
  • Red color. + *
  • Violet color. + *
  • White color. + *
  • Yellow color. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorType + { + public: + enum ColorTypeEnum + { + UNKNOWN = -1, + BLACK, + BLUE, + BROWN, + GREEN, + GREY, + ORANGE, + OTHER, + RED, + VIOLET, + WHITE, + YELLOW, + }; + + private: + std::string _literal; + ColorTypeEnum _colorTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kColorTypeEnumString + { + "UNKNOWN", + "black", + "blue", + "brown", + "green", + "grey", + "orange", + "other", + "red", + "violet", + "white", + "yellow", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ColorType(); + + OPENSCENARIOLIB_EXP ColorType(ColorTypeEnum& colorType); + + OPENSCENARIOLIB_EXP ColorType(const ColorTypeEnum colorType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ColorTypeEnum colorType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ColorTypeEnum colorType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ColorTypeEnum colorType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ColorType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ColorType& operator= (const ColorTypeEnum &rhs); + + OPENSCENARIOLIB_EXP ColorType& operator= (const ColorType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ColorTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ColorTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Edge types that can be used for conditions. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • A condition defined with a falling edge shall return true at discrete time t if its logical expression is false at + * discrete time t and its logical expression was true at discrete time t-ts, where ts is the simulation sampling time. + *
  • A condition defined with a 'none' edge shall return true at discrete time t if its logical expression is true at + * discrete time t. + *
  • A condition defined with a rising edge shall return true at discrete time t if its logical expression is true at + * discrete time t and its logical expression was false at discrete time t-ts, where ts is the simulation sampling time. + *
  • A condition defined with a 'risingOrFalling' edge shall return true at discrete time t if its logical expression is + * true at discrete time t and its logical expression was false at discrete time t-ts OR if its logical expression is false + * at discrete time t and its logical expression was true at discrete time t-ts. ts is the simulation sampling time. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionEdge + { + public: + enum ConditionEdgeEnum + { + UNKNOWN = -1, + FALLING, + NONE, + RISING, + RISING_OR_FALLING, + }; + + private: + std::string _literal; + ConditionEdgeEnum _conditionEdgeEnum; + static std::map _stringToEnum; + + public: + const std::vector kConditionEdgeEnumString + { + "UNKNOWN", + "falling", + "none", + "rising", + "risingOrFalling", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ConditionEdge(); + + OPENSCENARIOLIB_EXP ConditionEdge(ConditionEdgeEnum& conditionEdge); + + OPENSCENARIOLIB_EXP ConditionEdge(const ConditionEdgeEnum conditionEdge); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ConditionEdgeEnum conditionEdge); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ConditionEdgeEnum conditionEdge); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ConditionEdgeEnum conditionEdge); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ConditionEdge(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ConditionEdge& operator= (const ConditionEdgeEnum &rhs); + + OPENSCENARIOLIB_EXP ConditionEdge& operator= (const ConditionEdge &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ConditionEdgeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ConditionEdgeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type of operational domains for a Controller + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • The controller can affect all possible domains of the object. + *
  • The controller can only affect an animation of the object. + *
  • The controller can affect both the lighting and the animation of the object. + *
  • The controller can only affect in the lateral movement of the object. + *
  • The controller can only affect the lighting of the object. + *
  • The controller can only affect in the longitudinal movement of the object. + *
  • The controller can affect both the lateral and longitudinal movement of the object (same as version 1.1). + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerType + { + public: + enum ControllerTypeEnum + { + UNKNOWN = -1, + ALL, + ANIMATION, + APPEARANCE, + LATERAL, + LIGHTING, + LONGITUDINAL, + MOVEMENT, + }; + + private: + std::string _literal; + ControllerTypeEnum _controllerTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kControllerTypeEnumString + { + "UNKNOWN", + "all", + "animation", + "appearance", + "lateral", + "lighting", + "longitudinal", + "movement", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ControllerType(); + + OPENSCENARIOLIB_EXP ControllerType(ControllerTypeEnum& controllerType); + + OPENSCENARIOLIB_EXP ControllerType(const ControllerTypeEnum controllerType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ControllerTypeEnum controllerType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ControllerTypeEnum controllerType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ControllerTypeEnum controllerType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ControllerType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ControllerType& operator= (const ControllerTypeEnum &rhs); + + OPENSCENARIOLIB_EXP ControllerType& operator= (const ControllerType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ControllerTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ControllerTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If used in a condition, then the coordinate system + * relates to the triggering entity. If used in an action, the coordinate system relates to the actor. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Cartesian XYZ coordinate system (origin is the origin of the entity´s local coordinate system.) + *
  • Road-based s,t coordinate system (s-axis is the lane center line of the lane, on which the entity is located). + *
  • Road-based s,t coordinate system (s-axis is the road center line of the road, on which the entity is located). + *
  • Trajectory-based s,t coordinate system (s-axis is the trajectory-arc, which the entity follows). + *
  • Cartesian XYZ world coordinate system. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CoordinateSystem + { + public: + enum CoordinateSystemEnum + { + UNKNOWN = -1, + ENTITY, + LANE, + ROAD, + TRAJECTORY, + WORLD, + }; + + private: + std::string _literal; + CoordinateSystemEnum _coordinateSystemEnum; + static std::map _stringToEnum; + + public: + const std::vector kCoordinateSystemEnumString + { + "UNKNOWN", + "entity", + "lane", + "road", + "trajectory", + "world", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP CoordinateSystem(); + + OPENSCENARIOLIB_EXP CoordinateSystem(CoordinateSystemEnum& coordinateSystem); + + OPENSCENARIOLIB_EXP CoordinateSystem(const CoordinateSystemEnum coordinateSystem); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const CoordinateSystemEnum coordinateSystem); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const CoordinateSystemEnum coordinateSystem); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const CoordinateSystemEnum coordinateSystem); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP CoordinateSystem(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP CoordinateSystem& operator= (const CoordinateSystemEnum &rhs); + + OPENSCENARIOLIB_EXP CoordinateSystem& operator= (const CoordinateSystem &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const CoordinateSystemEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static CoordinateSystemEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines the directions in the entity coordinate system. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Lateral direction (along the y-axis). + *
  • Longitudinal direction (along the x-axis). + *
  • Vertical direction (along the z-axis). + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectionalDimension + { + public: + enum DirectionalDimensionEnum + { + UNKNOWN = -1, + LATERAL, + LONGITUDINAL, + VERTICAL, + }; + + private: + std::string _literal; + DirectionalDimensionEnum _directionalDimensionEnum; + static std::map _stringToEnum; + + public: + const std::vector kDirectionalDimensionEnumString + { + "UNKNOWN", + "lateral", + "longitudinal", + "vertical", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP DirectionalDimension(); + + OPENSCENARIOLIB_EXP DirectionalDimension(DirectionalDimensionEnum& directionalDimension); + + OPENSCENARIOLIB_EXP DirectionalDimension(const DirectionalDimensionEnum directionalDimension); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const DirectionalDimensionEnum directionalDimension); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const DirectionalDimensionEnum directionalDimension); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const DirectionalDimensionEnum directionalDimension); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP DirectionalDimension(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP DirectionalDimension& operator= (const DirectionalDimensionEnum &rhs); + + OPENSCENARIOLIB_EXP DirectionalDimension& operator= (const DirectionalDimension &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const DirectionalDimensionEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static DirectionalDimensionEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Defines how a target value will be acquired (with a constant rate, in a defined distance, within a defined time). + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • A predefined distance used to acquire the target value. + *
  • A predefined constant rate is used to acquire the target value. + *
  • A predefined time (duration) is used to acquire the target value. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DynamicsDimension + { + public: + enum DynamicsDimensionEnum + { + UNKNOWN = -1, + DISTANCE, + RATE, + TIME, + }; + + private: + std::string _literal; + DynamicsDimensionEnum _dynamicsDimensionEnum; + static std::map _stringToEnum; + + public: + const std::vector kDynamicsDimensionEnumString + { + "UNKNOWN", + "distance", + "rate", + "time", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP DynamicsDimension(); + + OPENSCENARIOLIB_EXP DynamicsDimension(DynamicsDimensionEnum& dynamicsDimension); + + OPENSCENARIOLIB_EXP DynamicsDimension(const DynamicsDimensionEnum dynamicsDimension); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const DynamicsDimensionEnum dynamicsDimension); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const DynamicsDimensionEnum dynamicsDimension); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const DynamicsDimensionEnum dynamicsDimension); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP DynamicsDimension(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP DynamicsDimension& operator= (const DynamicsDimensionEnum &rhs); + + OPENSCENARIOLIB_EXP DynamicsDimension& operator= (const DynamicsDimension &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const DynamicsDimensionEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static DynamicsDimensionEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Function type used to represent the change of a given variable over time or distance. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Cubical transition f(x)=A*x^3+B*x^2+C*x+D with the constraint that the gradient must be zero at start and end. + *
  • Value changes in a linear function: f(x) = f_0 + rate * x. + *
  • Sinusoidal transition f(x)=A*sin(x)+B with the constraint that the gradient must be zero at start and end. + *
  • The target value is set instantaneously. Does not consume simulation time. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DynamicsShape + { + public: + enum DynamicsShapeEnum + { + UNKNOWN = -1, + CUBIC, + LINEAR, + SINUSOIDAL, + STEP, + }; + + private: + std::string _literal; + DynamicsShapeEnum _dynamicsShapeEnum; + static std::map _stringToEnum; + + public: + const std::vector kDynamicsShapeEnumString + { + "UNKNOWN", + "cubic", + "linear", + "sinusoidal", + "step", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP DynamicsShape(); + + OPENSCENARIOLIB_EXP DynamicsShape(DynamicsShapeEnum& dynamicsShape); + + OPENSCENARIOLIB_EXP DynamicsShape(const DynamicsShapeEnum dynamicsShape); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const DynamicsShapeEnum dynamicsShape); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const DynamicsShapeEnum dynamicsShape); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const DynamicsShapeEnum dynamicsShape); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP DynamicsShape(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP DynamicsShape& operator= (const DynamicsShapeEnum &rhs); + + OPENSCENARIOLIB_EXP DynamicsShape& operator= (const DynamicsShape &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const DynamicsShapeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static DynamicsShapeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type of control actuation when following a lateral or longitudinal trajectory, shape or profile. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Follow the lateral and/or longitudinal target value as good as possible by observing the dynamic constraints of the + * entity (e.g. for a driver model). + *
  • Follow the trajectory, shape or profile exactly by ignoring the dynamic constraints of the entity. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FollowingMode + { + public: + enum FollowingModeEnum + { + UNKNOWN = -1, + FOLLOW, + POSITION, + }; + + private: + std::string _literal; + FollowingModeEnum _followingModeEnum; + static std::map _stringToEnum; + + public: + const std::vector kFollowingModeEnumString + { + "UNKNOWN", + "follow", + "position", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP FollowingMode(); + + OPENSCENARIOLIB_EXP FollowingMode(FollowingModeEnum& followingMode); + + OPENSCENARIOLIB_EXP FollowingMode(const FollowingModeEnum followingMode); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const FollowingModeEnum followingMode); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const FollowingModeEnum followingMode); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const FollowingModeEnum followingMode); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP FollowingMode(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP FollowingMode& operator= (const FollowingModeEnum &rhs); + + OPENSCENARIOLIB_EXP FollowingMode& operator= (const FollowingMode &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const FollowingModeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static FollowingModeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of cloud states using the fractional cloud cover in oktas. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • 8/8 of the sky is covered with clouds (equivalent to the deprecated 'overcast' CloudState) + *
  • 5/8 of the sky is covered with clouds + *
  • 4/8 of the sky is covered with clouds (equivalent to the deprecated 'cloudy' CloudState) + *
  • sky obscured, e.g. in dense fog (equivalent to the deprecated 'skyOff' CloudState) + *
  • 1/8 of the sky is covered with clouds + *
  • 7/8 of the sky is covered with clouds + *
  • 6/8 of the sky is covered with clouds (equivalent to the deprecated 'rainy' CloudState) + *
  • 3/8 of the sky is covered with clouds + *
  • 2/8 of the sky is covered with clouds + *
  • 0/8 of the sky is covered with clouds (equivalent to the deprecated 'free' CloudState) + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FractionalCloudCover + { + public: + enum FractionalCloudCoverEnum + { + UNKNOWN = -1, + EIGHT_OKTAS, + FIVE_OKTAS, + FOUR_OKTAS, + NINE_OKTAS, + ONE_OKTAS, + SEVEN_OKTAS, + SIX_OKTAS, + THREE_OKTAS, + TWO_OKTAS, + ZERO_OKTAS, + }; + + private: + std::string _literal; + FractionalCloudCoverEnum _fractionalCloudCoverEnum; + static std::map _stringToEnum; + + public: + const std::vector kFractionalCloudCoverEnumString + { + "UNKNOWN", + "eightOktas", + "fiveOktas", + "fourOktas", + "nineOktas", + "oneOktas", + "sevenOktas", + "sixOktas", + "threeOktas", + "twoOktas", + "zeroOktas", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP FractionalCloudCover(); + + OPENSCENARIOLIB_EXP FractionalCloudCover(FractionalCloudCoverEnum& fractionalCloudCover); + + OPENSCENARIOLIB_EXP FractionalCloudCover(const FractionalCloudCoverEnum fractionalCloudCover); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const FractionalCloudCoverEnum fractionalCloudCover); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const FractionalCloudCoverEnum fractionalCloudCover); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const FractionalCloudCoverEnum fractionalCloudCover); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP FractionalCloudCover(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP FractionalCloudCover& operator= (const FractionalCloudCoverEnum &rhs); + + OPENSCENARIOLIB_EXP FractionalCloudCover& operator= (const FractionalCloudCover &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const FractionalCloudCoverEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static FractionalCloudCoverEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A displacement relative to an entity along a lateral axis (e.g. the y axis of the entity coordinate system) + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Either left or right to the entity along the lateral dimension. + *
  • Left to the entity along the lateral dimension. + *
  • Right to the entity along the lateral dimension. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralDisplacement + { + public: + enum LateralDisplacementEnum + { + UNKNOWN = -1, + ANY, + LEFT_TO_REFERENCED_ENTITY, + RIGHT_TO_REFERENCED_ENTITY, + }; + + private: + std::string _literal; + LateralDisplacementEnum _lateralDisplacementEnum; + static std::map _stringToEnum; + + public: + const std::vector kLateralDisplacementEnumString + { + "UNKNOWN", + "any", + "leftToReferencedEntity", + "rightToReferencedEntity", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP LateralDisplacement(); + + OPENSCENARIOLIB_EXP LateralDisplacement(LateralDisplacementEnum& lateralDisplacement); + + OPENSCENARIOLIB_EXP LateralDisplacement(const LateralDisplacementEnum lateralDisplacement); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const LateralDisplacementEnum lateralDisplacement); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const LateralDisplacementEnum lateralDisplacement); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const LateralDisplacementEnum lateralDisplacement); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP LateralDisplacement(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP LateralDisplacement& operator= (const LateralDisplacementEnum &rhs); + + OPENSCENARIOLIB_EXP LateralDisplacement& operator= (const LateralDisplacement &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const LateralDisplacementEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static LateralDisplacementEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the light mode. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Light is flashing. Therefore, flashingOnDuration and flashingOffDuration have to be set. + *
  • Light is switched off. + *
  • Light is switched on. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightMode + { + public: + enum LightModeEnum + { + UNKNOWN = -1, + FLASHING, + OFF, + ON, + }; + + private: + std::string _literal; + LightModeEnum _lightModeEnum; + static std::map _stringToEnum; + + public: + const std::vector kLightModeEnumString + { + "UNKNOWN", + "flashing", + "off", + "on", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP LightMode(); + + OPENSCENARIOLIB_EXP LightMode(LightModeEnum& lightMode); + + OPENSCENARIOLIB_EXP LightMode(const LightModeEnum lightMode); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const LightModeEnum lightMode); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const LightModeEnum lightMode); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const LightModeEnum lightMode); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP LightMode(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP LightMode& operator= (const LightModeEnum &rhs); + + OPENSCENARIOLIB_EXP LightMode& operator= (const LightMode &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const LightModeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static LightModeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * A displacement relative to an entity along a longitudinal axis (e.g. the x axis of the entity coordinate system) + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Either ahead or behind the entity along the longitudinal dimension. + *
  • Ahead of the entity along the longitudinal dimension. + *
  • Behind the entity along the longitudinal dimension. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalDisplacement + { + public: + enum LongitudinalDisplacementEnum + { + UNKNOWN = -1, + ANY, + LEADING_REFERENCED_ENTITY, + TRAILING_REFERENCED_ENTITY, + }; + + private: + std::string _literal; + LongitudinalDisplacementEnum _longitudinalDisplacementEnum; + static std::map _stringToEnum; + + public: + const std::vector kLongitudinalDisplacementEnumString + { + "UNKNOWN", + "any", + "leadingReferencedEntity", + "trailingReferencedEntity", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP LongitudinalDisplacement(); + + OPENSCENARIOLIB_EXP LongitudinalDisplacement(LongitudinalDisplacementEnum& longitudinalDisplacement); + + OPENSCENARIOLIB_EXP LongitudinalDisplacement(const LongitudinalDisplacementEnum longitudinalDisplacement); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const LongitudinalDisplacementEnum longitudinalDisplacement); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const LongitudinalDisplacementEnum longitudinalDisplacement); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const LongitudinalDisplacementEnum longitudinalDisplacement); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP LongitudinalDisplacement(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP LongitudinalDisplacement& operator= (const LongitudinalDisplacementEnum &rhs); + + OPENSCENARIOLIB_EXP LongitudinalDisplacement& operator= (const LongitudinalDisplacement &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const LongitudinalDisplacementEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static LongitudinalDisplacementEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Categories for entity objects which are not pedestrians or vehicles. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • A barrier. + *
  • A building. + *
  • A crosswalk. + *
  • A gantry. + *
  • None, other + *
  • Not further defined obstacle + *
  • A parking space. + *
  • A patch. + *
  • A pole + *
  • A railing or guard rail. + *
  • Not further defined road mark. + *
  • A sound barrier. + *
  • A street lamp. + *
  • A traffic island. + *
  • A tree + *
  • Not further defined vegetation. + *
  • Wind. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectCategory + { + public: + enum MiscObjectCategoryEnum + { + UNKNOWN = -1, + BARRIER, + BUILDING, + CROSSWALK, + GANTRY, + NONE, + OBSTACLE, + PARKING_SPACE, + PATCH, + POLE, + RAILING, + ROAD_MARK, + SOUND_BARRIER, + STREET_LAMP, + TRAFFIC_ISLAND, + TREE, + VEGETATION, + WIND, + }; + + private: + std::string _literal; + MiscObjectCategoryEnum _miscObjectCategoryEnum; + static std::map _stringToEnum; + static std::map _enumToDeprecated; + static std::map _enumToDeprecatedVersion; + static std::map _enumToDeprecatedComment; + + public: + const std::vector kMiscObjectCategoryEnumString + { + "UNKNOWN", + "barrier", + "building", + "crosswalk", + "gantry", + "none", + "obstacle", + "parkingSpace", + "patch", + "pole", + "railing", + "roadMark", + "soundBarrier", + "streetLamp", + "trafficIsland", + "tree", + "vegetation", + "wind", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP MiscObjectCategory(); + + OPENSCENARIOLIB_EXP MiscObjectCategory(MiscObjectCategoryEnum& miscObjectCategory); + + OPENSCENARIOLIB_EXP MiscObjectCategory(const MiscObjectCategoryEnum miscObjectCategory); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const MiscObjectCategoryEnum miscObjectCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const MiscObjectCategoryEnum miscObjectCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const MiscObjectCategoryEnum miscObjectCategory); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP MiscObjectCategory(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP MiscObjectCategory& operator= (const MiscObjectCategoryEnum &rhs); + + OPENSCENARIOLIB_EXP MiscObjectCategory& operator= (const MiscObjectCategory &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const MiscObjectCategoryEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static MiscObjectCategoryEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Types of entity objects available in a scenario. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • An external object reference. + *
  • Miscellaneous object. + *
  • A Pedestrian. + *
  • A Vehicle. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ObjectType + { + public: + enum ObjectTypeEnum + { + UNKNOWN = -1, + EXTERNAL, + MISCELLANEOUS, + PEDESTRIAN, + VEHICLE, + }; + + private: + std::string _literal; + ObjectTypeEnum _objectTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kObjectTypeEnumString + { + "UNKNOWN", + "external", + "miscellaneous", + "pedestrian", + "vehicle", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ObjectType(); + + OPENSCENARIOLIB_EXP ObjectType(ObjectTypeEnum& objectType); + + OPENSCENARIOLIB_EXP ObjectType(const ObjectTypeEnum objectType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ObjectTypeEnum objectType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ObjectTypeEnum objectType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ObjectTypeEnum objectType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ObjectType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ObjectType& operator= (const ObjectTypeEnum &rhs); + + OPENSCENARIOLIB_EXP ObjectType& operator= (const ObjectType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ObjectTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ObjectTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Allowed data types for parameters defined in a parameter declaration. The types mentioned here match the corresponding + * datatypes the W3C XML Schema defines. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Boolean - true or false. + *
  • DateTime - Instant of time (Gregorian calendar). + *
  • Double - IEEE 64-bit floating-point. + *
  • Int - 32-bit signed integer. + *
  • Integer (32-bit signed integer, equivalent to "int"). + *
  • String. + *
  • UnsignedInt - Unsigned integer of 32 bits. + *
  • UnsignedShort - Unsigned integer of 16 bits. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterType + { + public: + enum ParameterTypeEnum + { + UNKNOWN = -1, + BOOLEAN, + DATE_TIME, + DOUBLE, + INT, + INTEGER, + STRING, + UNSIGNED_INT, + UNSIGNED_SHORT, + }; + + private: + std::string _literal; + ParameterTypeEnum _parameterTypeEnum; + static std::map _stringToEnum; + static std::map _enumToDeprecated; + static std::map _enumToDeprecatedVersion; + static std::map _enumToDeprecatedComment; + + public: + const std::vector kParameterTypeEnumString + { + "UNKNOWN", + "boolean", + "dateTime", + "double", + "int", + "integer", + "string", + "unsignedInt", + "unsignedShort", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ParameterType(); + + OPENSCENARIOLIB_EXP ParameterType(ParameterTypeEnum& parameterType); + + OPENSCENARIOLIB_EXP ParameterType(const ParameterTypeEnum parameterType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ParameterTypeEnum parameterType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ParameterTypeEnum parameterType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ParameterTypeEnum parameterType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ParameterType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ParameterType& operator= (const ParameterTypeEnum &rhs); + + OPENSCENARIOLIB_EXP ParameterType& operator= (const ParameterType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ParameterTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ParameterTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Categories for entity objects of type pedestrian. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • An animal. + *
  • A pedestrian. + *
  • A wheelchair. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianCategory + { + public: + enum PedestrianCategoryEnum + { + UNKNOWN = -1, + ANIMAL, + PEDESTRIAN, + WHEELCHAIR, + }; + + private: + std::string _literal; + PedestrianCategoryEnum _pedestrianCategoryEnum; + static std::map _stringToEnum; + + public: + const std::vector kPedestrianCategoryEnumString + { + "UNKNOWN", + "animal", + "pedestrian", + "wheelchair", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP PedestrianCategory(); + + OPENSCENARIOLIB_EXP PedestrianCategory(PedestrianCategoryEnum& pedestrianCategory); + + OPENSCENARIOLIB_EXP PedestrianCategory(const PedestrianCategoryEnum pedestrianCategory); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const PedestrianCategoryEnum pedestrianCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const PedestrianCategoryEnum pedestrianCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const PedestrianCategoryEnum pedestrianCategory); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP PedestrianCategory(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP PedestrianCategory& operator= (const PedestrianCategoryEnum &rhs); + + OPENSCENARIOLIB_EXP PedestrianCategory& operator= (const PedestrianCategory &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const PedestrianCategoryEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static PedestrianCategoryEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a pedestrian's gesture. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Pedestrian is drinking a coffee with left hand. + *
  • Pedestrian is drinking a coffee with the right hand. + *
  • Pedestrian is crossing both arms. + *
  • Pedestrian is holding a phone in the left hand for a call. + *
  • Pedestrian is holding a phone in the right hand for a call. + *
  • Pedestrian is holding a phone in the left hand for texting. + *
  • Pedestrian is holding a phone in the right hand for texting. + *
  • Pedestrian is holding a sandwich with the left hand. + *
  • Pedestrian is holding a sandwich with the right hand. + *
  • Pedestrian is holding a umbrella in the left hand. + *
  • Pedestrian is holding a umbrella in the right hand. + *
  • Pedestrian is waving with the left arm. + *
  • Pedestrian is waving with the right arm. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianGestureType + { + public: + enum PedestrianGestureTypeEnum + { + UNKNOWN = -1, + COFFEE_LEFT_HAND, + COFFEE_RIGHT_HAND, + CROSS_ARMS, + PHONE_CALL_LEFT_HAND, + PHONE_CALL_RIGHT_HAND, + PHONE_TEXT_LEFT_HAND, + PHONE_TEXT_RIGHT_HAND, + SANDWICH_LEFT_HAND, + SANDWICH_RIGHT_HAND, + UMBRELLA_LEFT_HAND, + UMBRELLA_RIGHT_HAND, + WAVING_LEFT_ARM, + WAVING_RIGHT_ARM, + }; + + private: + std::string _literal; + PedestrianGestureTypeEnum _pedestrianGestureTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kPedestrianGestureTypeEnumString + { + "UNKNOWN", + "coffeeLeftHand", + "coffeeRightHand", + "crossArms", + "phoneCallLeftHand", + "phoneCallRightHand", + "phoneTextLeftHand", + "phoneTextRightHand", + "sandwichLeftHand", + "sandwichRightHand", + "umbrellaLeftHand", + "umbrellaRightHand", + "wavingLeftArm", + "wavingRightArm", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP PedestrianGestureType(); + + OPENSCENARIOLIB_EXP PedestrianGestureType(PedestrianGestureTypeEnum& pedestrianGestureType); + + OPENSCENARIOLIB_EXP PedestrianGestureType(const PedestrianGestureTypeEnum pedestrianGestureType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const PedestrianGestureTypeEnum pedestrianGestureType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const PedestrianGestureTypeEnum pedestrianGestureType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const PedestrianGestureTypeEnum pedestrianGestureType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP PedestrianGestureType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP PedestrianGestureType& operator= (const PedestrianGestureTypeEnum &rhs); + + OPENSCENARIOLIB_EXP PedestrianGestureType& operator= (const PedestrianGestureType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const PedestrianGestureTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static PedestrianGestureTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of a pedestrian's motion. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Pedestrian is bending down. + *
  • Pedestrian is crawling. + *
  • Pedestrian is cycling. + *
  • Pedestrian is ducking. + *
  • Pedestrian is jumping. + *
  • Pedestrian is lying down. + *
  • Pedestrian is reeling. + *
  • Pedestrian is running. + *
  • Pedestrian is sitting. + *
  • Pedestrian is crouching/squatting. + *
  • Pedestrian is standing. + *
  • Pedestrian is walking. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianMotionType + { + public: + enum PedestrianMotionTypeEnum + { + UNKNOWN = -1, + BENDING_DOWN, + CRAWLING, + CYCLING, + DUCKING, + JUMPING, + LYING, + REELING, + RUNNING, + SITTING, + SQUATTING, + STANDING, + WALKING, + }; + + private: + std::string _literal; + PedestrianMotionTypeEnum _pedestrianMotionTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kPedestrianMotionTypeEnumString + { + "UNKNOWN", + "bendingDown", + "crawling", + "cycling", + "ducking", + "jumping", + "lying", + "reeling", + "running", + "sitting", + "squatting", + "standing", + "walking", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP PedestrianMotionType(); + + OPENSCENARIOLIB_EXP PedestrianMotionType(PedestrianMotionTypeEnum& pedestrianMotionType); + + OPENSCENARIOLIB_EXP PedestrianMotionType(const PedestrianMotionTypeEnum pedestrianMotionType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const PedestrianMotionTypeEnum pedestrianMotionType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const PedestrianMotionTypeEnum pedestrianMotionType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const PedestrianMotionTypeEnum pedestrianMotionType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP PedestrianMotionType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP PedestrianMotionType& operator= (const PedestrianMotionTypeEnum &rhs); + + OPENSCENARIOLIB_EXP PedestrianMotionType& operator= (const PedestrianMotionType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const PedestrianMotionTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static PedestrianMotionTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Types of precipitation. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • No precipitation. + *
  • Rain. + *
  • Snow. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrecipitationType + { + public: + enum PrecipitationTypeEnum + { + UNKNOWN = -1, + DRY, + RAIN, + SNOW, + }; + + private: + std::string _literal; + PrecipitationTypeEnum _precipitationTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kPrecipitationTypeEnumString + { + "UNKNOWN", + "dry", + "rain", + "snow", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP PrecipitationType(); + + OPENSCENARIOLIB_EXP PrecipitationType(PrecipitationTypeEnum& precipitationType); + + OPENSCENARIOLIB_EXP PrecipitationType(const PrecipitationTypeEnum precipitationType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const PrecipitationTypeEnum precipitationType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const PrecipitationTypeEnum precipitationType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const PrecipitationTypeEnum precipitationType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP PrecipitationType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP PrecipitationType& operator= (const PrecipitationTypeEnum &rhs); + + OPENSCENARIOLIB_EXP PrecipitationType& operator= (const PrecipitationType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const PrecipitationTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static PrecipitationTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Rules that govern interaction between events that belong to the same maneuver. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • If a starting event has priority Override, all events in running state, within the same scope (maneuver) as the + * starting event, should be issued a stop command (stop transition). + *
  • If a starting event has priority Overwrite, all events in running state, within the same scope (maneuver) as the + * starting event, should be issued a stop command (stop transition). + *
  • Execute in parallel to other events. + *
  • If a starting event has priority Skip, then it will not be ran if there is any other event in the same scope + * (maneuver) in the running state. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class Priority + { + public: + enum PriorityEnum + { + UNKNOWN = -1, + OVERRIDE, + OVERWRITE, + PARALLEL, + SKIP, + }; + + private: + std::string _literal; + PriorityEnum _priorityEnum; + static std::map _stringToEnum; + static std::map _enumToDeprecated; + static std::map _enumToDeprecatedVersion; + static std::map _enumToDeprecatedComment; + + public: + const std::vector kPriorityEnumString + { + "UNKNOWN", + "override", + "overwrite", + "parallel", + "skip", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP Priority(); + + OPENSCENARIOLIB_EXP Priority(PriorityEnum& priority); + + OPENSCENARIOLIB_EXP Priority(const PriorityEnum priority); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const PriorityEnum priority); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const PriorityEnum priority); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const PriorityEnum priority); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP Priority(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP Priority& operator= (const PriorityEnum &rhs); + + OPENSCENARIOLIB_EXP Priority& operator= (const Priority &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const PriorityEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static PriorityEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the nature for a given signal, or variable, in terms of absolute or relative. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Absolute reference. + *
  • Relative reference. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ReferenceContext + { + public: + enum ReferenceContextEnum + { + UNKNOWN = -1, + ABSOLUTE, + RELATIVE, + }; + + private: + std::string _literal; + ReferenceContextEnum _referenceContextEnum; + static std::map _stringToEnum; + + public: + const std::vector kReferenceContextEnumString + { + "UNKNOWN", + "absolute", + "relative", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP ReferenceContext(); + + OPENSCENARIOLIB_EXP ReferenceContext(ReferenceContextEnum& referenceContext); + + OPENSCENARIOLIB_EXP ReferenceContext(const ReferenceContextEnum referenceContext); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const ReferenceContextEnum referenceContext); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const ReferenceContextEnum referenceContext); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const ReferenceContextEnum referenceContext); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP ReferenceContext(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP ReferenceContext& operator= (const ReferenceContextEnum &rhs); + + OPENSCENARIOLIB_EXP ReferenceContext& operator= (const ReferenceContext &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const ReferenceContextEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static ReferenceContextEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Cartesian distance offset. If used together with CoordinateSystem, then the value of the CoordinateSystem is not + * considered. + *
  • +Absolute magnitude of the euclidean distance vector. CoordinateSystem defaults to entity. If CoordinateSystem is + * defined by user, that value is overridden. + *
  • +Smallest lateral distance (y for cartesian coordinate systems, t for road-based coordinate systems). + *
  • Smallest longitudinal distance (x for cartesian coordinate systems, s for road-based coordinate systems). + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeDistanceType + { + public: + enum RelativeDistanceTypeEnum + { + UNKNOWN = -1, + CARTESIAN_DISTANCE, + EUCLIDIAN_DISTANCE, + LATERAL, + LONGITUDINAL, + }; + + private: + std::string _literal; + RelativeDistanceTypeEnum _relativeDistanceTypeEnum; + static std::map _stringToEnum; + static std::map _enumToDeprecated; + static std::map _enumToDeprecatedVersion; + static std::map _enumToDeprecatedComment; + + public: + const std::vector kRelativeDistanceTypeEnumString + { + "UNKNOWN", + "cartesianDistance", + "euclidianDistance", + "lateral", + "longitudinal", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP RelativeDistanceType(); + + OPENSCENARIOLIB_EXP RelativeDistanceType(RelativeDistanceTypeEnum& relativeDistanceType); + + OPENSCENARIOLIB_EXP RelativeDistanceType(const RelativeDistanceTypeEnum relativeDistanceType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const RelativeDistanceTypeEnum relativeDistanceType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const RelativeDistanceTypeEnum relativeDistanceType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const RelativeDistanceTypeEnum relativeDistanceType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP RelativeDistanceType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP RelativeDistanceType& operator= (const RelativeDistanceTypeEnum &rhs); + + OPENSCENARIOLIB_EXP RelativeDistanceType& operator= (const RelativeDistanceType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const RelativeDistanceTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static RelativeDistanceTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Roles for entity objects of type Vehicle or Pedestrian. The default role if not specified is None. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • The entity role is ambulance. + *
  • The entity role is civil. + *
  • The entity role is fire fighting, e.g. fire engine. + *
  • The entity role is military, e.g. camouflaged truck. + *
  • The entity has no specific role. + *
  • The entity role is police. + *
  • The entity role is public transport, e.g. a school bus. + *
  • The entity role is roadside assistance, e.g. tow truck. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class Role + { + public: + enum RoleEnum + { + UNKNOWN = -1, + AMBULANCE, + CIVIL, + FIRE, + MILITARY, + NONE, + POLICE, + PUBLIC_TRANSPORT, + ROAD_ASSISTANCE, + }; + + private: + std::string _literal; + RoleEnum _roleEnum; + static std::map _stringToEnum; + + public: + const std::vector kRoleEnumString + { + "UNKNOWN", + "ambulance", + "civil", + "fire", + "military", + "none", + "police", + "publicTransport", + "roadAssistance", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP Role(); + + OPENSCENARIOLIB_EXP Role(RoleEnum& role); + + OPENSCENARIOLIB_EXP Role(const RoleEnum role); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const RoleEnum role); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const RoleEnum role); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const RoleEnum role); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP Role(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP Role& operator= (const RoleEnum &rhs); + + OPENSCENARIOLIB_EXP Role& operator= (const Role &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const RoleEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static RoleEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Strategy for path selection between waypoints in a route. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Fastest route. + *
  • Route with least number of intersections. + *
  • Random route. + *
  • Shortest route. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteStrategy + { + public: + enum RouteStrategyEnum + { + UNKNOWN = -1, + FASTEST, + LEAST_INTERSECTIONS, + RANDOM, + SHORTEST, + }; + + private: + std::string _literal; + RouteStrategyEnum _routeStrategyEnum; + static std::map _stringToEnum; + + public: + const std::vector kRouteStrategyEnumString + { + "UNKNOWN", + "fastest", + "leastIntersections", + "random", + "shortest", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP RouteStrategy(); + + OPENSCENARIOLIB_EXP RouteStrategy(RouteStrategyEnum& routeStrategy); + + OPENSCENARIOLIB_EXP RouteStrategy(const RouteStrategyEnum routeStrategy); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const RouteStrategyEnum routeStrategy); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const RouteStrategyEnum routeStrategy); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const RouteStrategyEnum routeStrategy); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP RouteStrategy(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP RouteStrategy& operator= (const RouteStrategyEnum &rhs); + + OPENSCENARIOLIB_EXP RouteStrategy& operator= (const RouteStrategy &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const RouteStrategyEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static RouteStrategyEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. To be used for distance calculations in + * road/lane coordinates during runtime. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Use the route which has already been assigned to the entity at the start position at the point in time when the + * distance shall be calculated. + *
  • Calculate the route with the shortest travelling time between start and target position. + *
  • Calculate the route with as few junctions as possible between start and target position. + *
  • Calculate the route with the shortest path between start and target position. + *
  • It is up to the simulator how to calculate the route between the start and target positions. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutingAlgorithm + { + public: + enum RoutingAlgorithmEnum + { + UNKNOWN = -1, + ASSIGNED_ROUTE, + FASTEST, + LEAST_INTERSECTIONS, + SHORTEST, + UNDEFINED, + }; + + private: + std::string _literal; + RoutingAlgorithmEnum _routingAlgorithmEnum; + static std::map _stringToEnum; + + public: + const std::vector kRoutingAlgorithmEnumString + { + "UNKNOWN", + "assignedRoute", + "fastest", + "leastIntersections", + "shortest", + "undefined", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP RoutingAlgorithm(); + + OPENSCENARIOLIB_EXP RoutingAlgorithm(RoutingAlgorithmEnum& routingAlgorithm); + + OPENSCENARIOLIB_EXP RoutingAlgorithm(const RoutingAlgorithmEnum routingAlgorithm); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const RoutingAlgorithmEnum routingAlgorithm); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const RoutingAlgorithmEnum routingAlgorithm); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const RoutingAlgorithmEnum routingAlgorithm); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP RoutingAlgorithm(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP RoutingAlgorithm& operator= (const RoutingAlgorithmEnum &rhs); + + OPENSCENARIOLIB_EXP RoutingAlgorithm& operator= (const RoutingAlgorithm &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const RoutingAlgorithmEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static RoutingAlgorithmEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Rules (operators) used to compare quantitative variables or signals. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • 'Equal to' operator. + *
  • 'Greater or equal' operator. + *
  • 'Greater than' operator. + *
  • 'Less or equal' operator. + *
  • 'Less than' operator. + *
  • 'Not equal' operator. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class Rule + { + public: + enum RuleEnum + { + UNKNOWN = -1, + EQUAL_TO, + GREATER_OR_EQUAL, + GREATER_THAN, + LESS_OR_EQUAL, + LESS_THAN, + NOT_EQUAL_TO, + }; + + private: + std::string _literal; + RuleEnum _ruleEnum; + static std::map _stringToEnum; + + public: + const std::vector kRuleEnumString + { + "UNKNOWN", + "equalTo", + "greaterOrEqual", + "greaterThan", + "lessOrEqual", + "lessThan", + "notEqualTo", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP Rule(); + + OPENSCENARIOLIB_EXP Rule(RuleEnum& rule); + + OPENSCENARIOLIB_EXP Rule(const RuleEnum rule); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const RuleEnum rule); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const RuleEnum rule); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const RuleEnum rule); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP Rule(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP Rule& operator= (const RuleEnum &rhs); + + OPENSCENARIOLIB_EXP Rule& operator= (const Rule &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const RuleEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static RuleEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Type definition that relates a speed value relative to another one. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • The relative value is interpreted as a difference to a referenced value. Unit: [m/s]. As an example, a speed value + * of 10 equals a speed that's 10m/s faster than the reference speed. + *
  • The relative value is interpreted as a factor to a referenced value. No unit. As an example, a speed value of 1.1 + * equals a speed that's 10% faster than the reference speed. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedTargetValueType + { + public: + enum SpeedTargetValueTypeEnum + { + UNKNOWN = -1, + DELTA, + FACTOR, + }; + + private: + std::string _literal; + SpeedTargetValueTypeEnum _speedTargetValueTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kSpeedTargetValueTypeEnumString + { + "UNKNOWN", + "delta", + "factor", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP SpeedTargetValueType(); + + OPENSCENARIOLIB_EXP SpeedTargetValueType(SpeedTargetValueTypeEnum& speedTargetValueType); + + OPENSCENARIOLIB_EXP SpeedTargetValueType(const SpeedTargetValueTypeEnum speedTargetValueType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const SpeedTargetValueTypeEnum speedTargetValueType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const SpeedTargetValueTypeEnum speedTargetValueType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const SpeedTargetValueTypeEnum speedTargetValueType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP SpeedTargetValueType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP SpeedTargetValueType& operator= (const SpeedTargetValueTypeEnum &rhs); + + OPENSCENARIOLIB_EXP SpeedTargetValueType& operator= (const SpeedTargetValueType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const SpeedTargetValueTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static SpeedTargetValueTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * The states and the transitions that can be used to define a StoryboardElementStateCondition. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • State from which the Storyboard element cannot return to the running state without external interference (forced by + * a parent element). + *
  • Transition between the running state and the standby state. The moment the referenced StoryboardElement terminates + * its execution by completing its goal. + *
  • State in which the storyboard element is executing its actions. + *
  • Transition marking the moment an element is asked to move to the running state but is instead skipped so it remains + * in the standby state (Only for Event instances). + *
  • State in which the storyboard element could move to the running state given a start trigger. + *
  • Transition between the standby and running state. The moment the referenced StoryboardElement instance starts its + * execution. + *
  • Transition between the running or standby states to the complete state. Occurs when the execution of the referenced + * StoryboardElement instance is stopped via a stop trigger or overriding. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardElementState + { + public: + enum StoryboardElementStateEnum + { + UNKNOWN = -1, + COMPLETE_STATE, + END_TRANSITION, + RUNNING_STATE, + SKIP_TRANSITION, + STANDBY_STATE, + START_TRANSITION, + STOP_TRANSITION, + }; + + private: + std::string _literal; + StoryboardElementStateEnum _storyboardElementStateEnum; + static std::map _stringToEnum; + + public: + const std::vector kStoryboardElementStateEnumString + { + "UNKNOWN", + "completeState", + "endTransition", + "runningState", + "skipTransition", + "standbyState", + "startTransition", + "stopTransition", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP StoryboardElementState(); + + OPENSCENARIOLIB_EXP StoryboardElementState(StoryboardElementStateEnum& storyboardElementState); + + OPENSCENARIOLIB_EXP StoryboardElementState(const StoryboardElementStateEnum storyboardElementState); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const StoryboardElementStateEnum storyboardElementState); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const StoryboardElementStateEnum storyboardElementState); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const StoryboardElementStateEnum storyboardElementState); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP StoryboardElementState(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP StoryboardElementState& operator= (const StoryboardElementStateEnum &rhs); + + OPENSCENARIOLIB_EXP StoryboardElementState& operator= (const StoryboardElementState &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const StoryboardElementStateEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static StoryboardElementStateEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Types of storyboard elements in a scenario. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • The referenced StoryboardElement instance is an Act. + *
  • The referenced StoryboardElement instance is an Action. + *
  • The referenced StoryboardElement instance is an Event. + *
  • The referenced StoryboardElement instance is a Maneuver. + *
  • The referenced StoryboardElement instance is a ManeuverGroup. + *
  • The referenced StoryboardElement instance is a Story. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardElementType + { + public: + enum StoryboardElementTypeEnum + { + UNKNOWN = -1, + ACT, + ACTION, + EVENT, + MANEUVER, + MANEUVER_GROUP, + STORY, + }; + + private: + std::string _literal; + StoryboardElementTypeEnum _storyboardElementTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kStoryboardElementTypeEnumString + { + "UNKNOWN", + "act", + "action", + "event", + "maneuver", + "maneuverGroup", + "story", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP StoryboardElementType(); + + OPENSCENARIOLIB_EXP StoryboardElementType(StoryboardElementTypeEnum& storyboardElementType); + + OPENSCENARIOLIB_EXP StoryboardElementType(const StoryboardElementTypeEnum storyboardElementType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const StoryboardElementTypeEnum storyboardElementType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const StoryboardElementTypeEnum storyboardElementType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const StoryboardElementTypeEnum storyboardElementType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP StoryboardElementType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP StoryboardElementType& operator= (const StoryboardElementTypeEnum &rhs); + + OPENSCENARIOLIB_EXP StoryboardElementType& operator= (const StoryboardElementType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const StoryboardElementTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static StoryboardElementTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Rules which determine how triggering entities are used to verify a given condition. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • All listed triggering entities must reach the specifies position in order to start the lane change. + *
  • One of the triggering entities reaching the position is enough to trigger the lane change. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggeringEntitiesRule + { + public: + enum TriggeringEntitiesRuleEnum + { + UNKNOWN = -1, + ALL, + ANY, + }; + + private: + std::string _literal; + TriggeringEntitiesRuleEnum _triggeringEntitiesRuleEnum; + static std::map _stringToEnum; + + public: + const std::vector kTriggeringEntitiesRuleEnumString + { + "UNKNOWN", + "all", + "any", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP TriggeringEntitiesRule(); + + OPENSCENARIOLIB_EXP TriggeringEntitiesRule(TriggeringEntitiesRuleEnum& triggeringEntitiesRule); + + OPENSCENARIOLIB_EXP TriggeringEntitiesRule(const TriggeringEntitiesRuleEnum triggeringEntitiesRule); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const TriggeringEntitiesRuleEnum triggeringEntitiesRule); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const TriggeringEntitiesRuleEnum triggeringEntitiesRule); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const TriggeringEntitiesRuleEnum triggeringEntitiesRule); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP TriggeringEntitiesRule(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP TriggeringEntitiesRule& operator= (const TriggeringEntitiesRuleEnum &rhs); + + OPENSCENARIOLIB_EXP TriggeringEntitiesRule& operator= (const TriggeringEntitiesRule &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const TriggeringEntitiesRuleEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static TriggeringEntitiesRuleEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Categories for entity objects of type vehicle. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • The vehicle is a bicycle. + *
  • The vehicle is a bus. + *
  • The vehicle is a car. + *
  • The vehicle is a motor bike. + *
  • The vehicle is a semi trailer. + *
  • The vehicle is a trailer. + *
  • The vehicle is a train. + *
  • The vehicle is a tram. + *
  • The vehicle is a truck. + *
  • The vehicle is a van. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategory + { + public: + enum VehicleCategoryEnum + { + UNKNOWN = -1, + BICYCLE, + BUS, + CAR, + MOTORBIKE, + SEMITRAILER, + TRAILER, + TRAIN, + TRAM, + TRUCK, + VAN, + }; + + private: + std::string _literal; + VehicleCategoryEnum _vehicleCategoryEnum; + static std::map _stringToEnum; + + public: + const std::vector kVehicleCategoryEnumString + { + "UNKNOWN", + "bicycle", + "bus", + "car", + "motorbike", + "semitrailer", + "trailer", + "train", + "tram", + "truck", + "van", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP VehicleCategory(); + + OPENSCENARIOLIB_EXP VehicleCategory(VehicleCategoryEnum& vehicleCategory); + + OPENSCENARIOLIB_EXP VehicleCategory(const VehicleCategoryEnum vehicleCategory); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const VehicleCategoryEnum vehicleCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const VehicleCategoryEnum vehicleCategory); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const VehicleCategoryEnum vehicleCategory); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP VehicleCategory(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP VehicleCategory& operator= (const VehicleCategoryEnum &rhs); + + OPENSCENARIOLIB_EXP VehicleCategory& operator= (const VehicleCategory &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const VehicleCategoryEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static VehicleCategoryEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of vehicle component types. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Front left door of a vehicle. + *
  • Front right door of a vehicle. + *
  • Rear left door of a vehicle. + *
  • Rear right door of a vehicle. + *
  • Hood of a vehicle. + *
  • All left side mirrors of a vehicle. + *
  • All right side mirrors of a vehicle. + *
  • All side mirrors of a vehicle. + *
  • Trunk of a vehicle. + *
  • Front left window of a vehicle. + *
  • Front right window of a vehicle. + *
  • Rear left window of a vehicle. + *
  • Rear right window of a vehicle. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleComponentType + { + public: + enum VehicleComponentTypeEnum + { + UNKNOWN = -1, + DOOR_FRONT_LEFT, + DOOR_FRONT_RIGHT, + DOOR_REAR_LEFT, + DOOR_REAR_RIGHT, + HOOD, + SIDE_MIRROR_LEFT, + SIDE_MIRROR_RIGHT, + SIDE_MIRRORS, + TRUNK, + WINDOW_FRONT_LEFT, + WINDOW_FRONT_RIGHT, + WINDOW_REAR_LEFT, + WINDOW_REAR_RIGHT, + }; + + private: + std::string _literal; + VehicleComponentTypeEnum _vehicleComponentTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kVehicleComponentTypeEnumString + { + "UNKNOWN", + "doorFrontLeft", + "doorFrontRight", + "doorRearLeft", + "doorRearRight", + "hood", + "sideMirrorLeft", + "sideMirrorRight", + "sideMirrors", + "trunk", + "windowFrontLeft", + "windowFrontRight", + "windowRearLeft", + "windowRearRight", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP VehicleComponentType(); + + OPENSCENARIOLIB_EXP VehicleComponentType(VehicleComponentTypeEnum& vehicleComponentType); + + OPENSCENARIOLIB_EXP VehicleComponentType(const VehicleComponentTypeEnum vehicleComponentType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const VehicleComponentTypeEnum vehicleComponentType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const VehicleComponentTypeEnum vehicleComponentType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const VehicleComponentTypeEnum vehicleComponentType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP VehicleComponentType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP VehicleComponentType& operator= (const VehicleComponentTypeEnum &rhs); + + OPENSCENARIOLIB_EXP VehicleComponentType& operator= (const VehicleComponentType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const VehicleComponentTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static VehicleComponentTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of vehicle light types. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Brake lights of a vehicle. + *
  • Daytime running lights of a vehicle. + *
  • All fog lights of a vehicle. + *
  • Front fog lights of a vehicle. + *
  • Rear fog lights of a vehicle. + *
  • High beam of a vehicle. + *
  • Left indicators of a vehicle. + *
  • Right indicators of a vehicle. + *
  • License plate illumination of a vehicle. + *
  • Low beam of a vehicle. + *
  • Reversing lights of a vehicle. + *
  • E.g. emergency light of a emergency-, police-, ... vehicle or service lights. + *
  • Warning lights of a vehicle. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleLightType + { + public: + enum VehicleLightTypeEnum + { + UNKNOWN = -1, + BRAKE_LIGHTS, + DAYTIME_RUNNING_LIGHTS, + FOG_LIGHTS, + FOG_LIGHTS_FRONT, + FOG_LIGHTS_REAR, + HIGH_BEAM, + INDICATOR_LEFT, + INDICATOR_RIGHT, + LICENSE_PLATE_ILLUMINATION, + LOW_BEAM, + REVERSING_LIGHTS, + SPECIAL_PURPOSE_LIGHTS, + WARNING_LIGHTS, + }; + + private: + std::string _literal; + VehicleLightTypeEnum _vehicleLightTypeEnum; + static std::map _stringToEnum; + + public: + const std::vector kVehicleLightTypeEnumString + { + "UNKNOWN", + "brakeLights", + "daytimeRunningLights", + "fogLights", + "fogLightsFront", + "fogLightsRear", + "highBeam", + "indicatorLeft", + "indicatorRight", + "licensePlateIllumination", + "lowBeam", + "reversingLights", + "specialPurposeLights", + "warningLights", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP VehicleLightType(); + + OPENSCENARIOLIB_EXP VehicleLightType(VehicleLightTypeEnum& vehicleLightType); + + OPENSCENARIOLIB_EXP VehicleLightType(const VehicleLightTypeEnum vehicleLightType); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const VehicleLightTypeEnum vehicleLightType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const VehicleLightTypeEnum vehicleLightType); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const VehicleLightTypeEnum vehicleLightType); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP VehicleLightType(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP VehicleLightType& operator= (const VehicleLightTypeEnum &rhs); + + OPENSCENARIOLIB_EXP VehicleLightType& operator= (const VehicleLightType &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const VehicleLightTypeEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static VehicleLightTypeEnum GetFromLiteral(const std::string literal_); + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Definition of the wetness of the road. + * + * Values from OpenSCENARIO class model specification: + *

    + *
  • Not wet. + *
  • Road completely covered with water. Water depth > 5cm. + *
  • Road completely covered with water. No puddles anymore. + *
  • Wet but no puddles are formed. + *
  • Wet, puddles are formed. + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class Wetness + { + public: + enum WetnessEnum + { + UNKNOWN = -1, + DRY, + HIGH_FLOODED, + LOW_FLOODED, + MOIST, + WET_WITH_PUDDLES, + }; + + private: + std::string _literal; + WetnessEnum _wetnessEnum; + static std::map _stringToEnum; + + public: + const std::vector kWetnessEnumString + { + "UNKNOWN", + "dry", + "highFlooded", + "lowFlooded", + "moist", + "wetWithPuddles", + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP Wetness(); + + OPENSCENARIOLIB_EXP Wetness(WetnessEnum& wetness); + + OPENSCENARIOLIB_EXP Wetness(const WetnessEnum wetness); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const WetnessEnum wetness); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const WetnessEnum wetness); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const WetnessEnum wetness); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP Wetness(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP Wetness& operator= (const WetnessEnum &rhs); + + OPENSCENARIOLIB_EXP Wetness& operator= (const Wetness &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const WetnessEnum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static WetnessEnum GetFromLiteral(const std::string literal_); + + }; + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/OscInterfacesV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/OscInterfacesV1_3.h new file mode 100644 index 00000000..ce0cfecc --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/OscInterfacesV1_3.h @@ -0,0 +1,106 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Instances of the types Controller, Environment, Maneuver, MiscObject, Pedestrian, Route, Trajectory and Vehicle are + * considered as instances of type CatalogElement. Or less formal: controller, environments, maneuvers, miscellaneous + * objects, pedestrians, routes, trajectories and vehicles are catalog elements. A catalog element is either a controller, + * an environment, a maneuver, a miscellaneous object, a pedestrian, a route, a trajectory or a vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogElement + { + public: + ICatalogElement() = default; + virtual ~ICatalogElement() = default; + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Instances of the types ScenarioObject, ScenarioObjectTemplate, EntitySelection and SpawnedObject are considered to be + * instances of type Entity. Or less formal: scenario objects and entity selections are both entities. An entity is either + * a scenario object or an entity selection. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntity + { + public: + IEntity() = default; + virtual ~IEntity() = default; + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Some private actions affect motion control and therefore imply a control strategy. These actions are considered + * instances of MotionControlAction such as LaneChangeAction, LateralDistanceAction or SynchronizeAction. Others like + * TeleportAction don’t imply such a dynamic behavior. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMotionControlAction + { + public: + IMotionControlAction() = default; + virtual ~IMotionControlAction() = default; + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * An instances of SpawnedObject is considered an instance of Entity. SpawnedObject represents objects that are spawned + * dynamically during runtime by sources and swarms. It is transient which means that it is not represented in the XSD. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpawnedObject + { + public: + ISpawnedObject() = default; + virtual ~ISpawnedObject() = default; + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * From OpenSCENARIO class model specification: + * Instances of the types Story, Act, Action, Event and Maneuver are considered to be instances of type StoryboardElement. + * Or less formal: story, acts, actions, events, maneuvers are storyboard elements. A storyboard element is either a story, + * an act, an event, an action or a maneuver. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboardElement + { + public: + IStoryboardElement() = default; + virtual ~IStoryboardElement() = default; + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/writer/ApiClassWriterInterfacesV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/writer/ApiClassWriterInterfacesV1_3.h new file mode 100644 index 00000000..a2f93239 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/writer/ApiClassWriterInterfacesV1_3.h @@ -0,0 +1,27083 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include "INamedReference.h" +#include "IOpenScenarioModelElement.h" +#include "EnumerationsV1_3.h" +#include "OscInterfacesV1_3.h" +#include "ApiClassInterfacesV1_3.h" +#include "ApiWriterInterfacesV1_3.h" +#include "IOpenScenarioElementWriter.h" +#include "MemLeakDetection.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + class IAbsoluteSpeedWriter; + class IAbsoluteTargetLaneWriter; + class IAbsoluteTargetLaneOffsetWriter; + class IAbsoluteTargetSpeedWriter; + class IAccelerationConditionWriter; + class IAcquirePositionActionWriter; + class IActWriter; + class IActionWriter; + class IActivateControllerActionWriter; + class IActorsWriter; + class IAddEntityActionWriter; + class IAngleConditionWriter; + class IAnimationActionWriter; + class IAnimationFileWriter; + class IAnimationStateWriter; + class IAnimationTypeWriter; + class IAppearanceActionWriter; + class IAssignControllerActionWriter; + class IAssignRouteActionWriter; + class IAutomaticGearWriter; + class IAxleWriter; + class IAxlesWriter; + class IBoundingBoxWriter; + class IBrakeWriter; + class IBrakeInputWriter; + class IByEntityConditionWriter; + class IByObjectTypeWriter; + class IByTypeWriter; + class IByValueConditionWriter; + class ICatalogWriter; + class ICatalogDefinitionWriter; + class ICatalogLocationsWriter; + class ICatalogReferenceWriter; + class ICenterWriter; + class ICentralSwarmObjectWriter; + class IClothoidWriter; + class IClothoidSplineWriter; + class IClothoidSplineSegmentWriter; + class ICollisionConditionWriter; + class IColorWriter; + class IColorCmykWriter; + class IColorRgbWriter; + class IComponentAnimationWriter; + class IConditionWriter; + class IConditionGroupWriter; + class IConnectTrailerActionWriter; + class IControlPointWriter; + class IControllerWriter; + class IControllerActionWriter; + class IControllerCatalogLocationWriter; + class IControllerDistributionWriter; + class IControllerDistributionEntryWriter; + class ICustomCommandActionWriter; + class ICustomContentWriter; + class IDeleteEntityActionWriter; + class IDeterministicWriter; + class IDeterministicMultiParameterDistributionWriter; + class IDeterministicMultiParameterDistributionTypeWriter; + class IDeterministicParameterDistributionWriter; + class IDeterministicSingleParameterDistributionWriter; + class IDeterministicSingleParameterDistributionTypeWriter; + class IDimensionsWriter; + class IDirectionOfTravelDistributionWriter; + class IDirectoryWriter; + class IDisconnectTrailerActionWriter; + class IDistanceConditionWriter; + class IDistributionDefinitionWriter; + class IDistributionRangeWriter; + class IDistributionSetWriter; + class IDistributionSetElementWriter; + class IDomeImageWriter; + class IDynamicConstraintsWriter; + class IEndOfRoadConditionWriter; + class IEntitiesWriter; + class IEntityActionWriter; + class IEntityConditionWriter; + class IEntityDistributionWriter; + class IEntityDistributionEntryWriter; + class IEntityObjectWriter; + class IEntityRefWriter; + class IEntitySelectionWriter; + class IEnvironmentWriter; + class IEnvironmentActionWriter; + class IEnvironmentCatalogLocationWriter; + class IEventWriter; + class IExternalObjectReferenceWriter; + class IFileWriter; + class IFileHeaderWriter; + class IFinalSpeedWriter; + class IFogWriter; + class IFollowTrajectoryActionWriter; + class IGearWriter; + class IGeoPositionWriter; + class IGlobalActionWriter; + class IHistogramWriter; + class IHistogramBinWriter; + class IInRoutePositionWriter; + class IInfrastructureActionWriter; + class IInitWriter; + class IInitActionsWriter; + class IKnotWriter; + class ILaneWriter; + class ILaneChangeActionWriter; + class ILaneChangeTargetWriter; + class ILaneOffsetActionWriter; + class ILaneOffsetActionDynamicsWriter; + class ILaneOffsetTargetWriter; + class ILanePositionWriter; + class ILateralActionWriter; + class ILateralDistanceActionWriter; + class ILicenseWriter; + class ILightStateWriter; + class ILightStateActionWriter; + class ILightTypeWriter; + class ILogNormalDistributionWriter; + class ILongitudinalActionWriter; + class ILongitudinalDistanceActionWriter; + class IManeuverWriter; + class IManeuverCatalogLocationWriter; + class IManeuverGroupWriter; + class IManualGearWriter; + class IMiscObjectWriter; + class IMiscObjectCatalogLocationWriter; + class IModifyRuleWriter; + class IMonitorDeclarationWriter; + class INoneWriter; + class INormalDistributionWriter; + class INurbsWriter; + class IObjectControllerWriter; + class IOffroadConditionWriter; + class IOpenScenarioWriter; + class IOpenScenarioCategoryWriter; + class IOrientationWriter; + class IOverrideBrakeActionWriter; + class IOverrideClutchActionWriter; + class IOverrideControllerValueActionWriter; + class IOverrideGearActionWriter; + class IOverrideParkingBrakeActionWriter; + class IOverrideSteeringWheelActionWriter; + class IOverrideThrottleActionWriter; + class IParameterActionWriter; + class IParameterAddValueRuleWriter; + class IParameterAssignmentWriter; + class IParameterConditionWriter; + class IParameterDeclarationWriter; + class IParameterModifyActionWriter; + class IParameterMultiplyByValueRuleWriter; + class IParameterSetActionWriter; + class IParameterValueDistributionWriter; + class IParameterValueDistributionDefinitionWriter; + class IParameterValueSetWriter; + class IPedestrianWriter; + class IPedestrianAnimationWriter; + class IPedestrianCatalogLocationWriter; + class IPedestrianGestureWriter; + class IPerformanceWriter; + class IPhaseWriter; + class IPoissonDistributionWriter; + class IPolygonWriter; + class IPolylineWriter; + class IPositionWriter; + class IPositionInLaneCoordinatesWriter; + class IPositionInRoadCoordinatesWriter; + class IPositionOfCurrentEntityWriter; + class IPrecipitationWriter; + class IPrivateWriter; + class IPrivateActionWriter; + class IProbabilityDistributionSetWriter; + class IProbabilityDistributionSetElementWriter; + class IPropertiesWriter; + class IPropertyWriter; + class IRandomRouteActionWriter; + class IRangeWriter; + class IReachPositionConditionWriter; + class IRelativeAngleConditionWriter; + class IRelativeClearanceConditionWriter; + class IRelativeDistanceConditionWriter; + class IRelativeLanePositionWriter; + class IRelativeLaneRangeWriter; + class IRelativeObjectPositionWriter; + class IRelativeRoadPositionWriter; + class IRelativeSpeedConditionWriter; + class IRelativeSpeedToMasterWriter; + class IRelativeTargetLaneWriter; + class IRelativeTargetLaneOffsetWriter; + class IRelativeTargetSpeedWriter; + class IRelativeWorldPositionWriter; + class IRoadConditionWriter; + class IRoadCursorWriter; + class IRoadNetworkWriter; + class IRoadPositionWriter; + class IRoadRangeWriter; + class IRouteWriter; + class IRouteCatalogLocationWriter; + class IRoutePositionWriter; + class IRouteRefWriter; + class IRoutingActionWriter; + class IScenarioDefinitionWriter; + class IScenarioObjectWriter; + class IScenarioObjectTemplateWriter; + class ISelectedEntitiesWriter; + class ISensorReferenceWriter; + class ISensorReferenceSetWriter; + class ISetMonitorActionWriter; + class IShapeWriter; + class ISimulationTimeConditionWriter; + class ISpeedActionWriter; + class ISpeedActionTargetWriter; + class ISpeedConditionWriter; + class ISpeedProfileActionWriter; + class ISpeedProfileEntryWriter; + class IStandStillConditionWriter; + class ISteadyStateWriter; + class IStochasticWriter; + class IStochasticDistributionWriter; + class IStochasticDistributionTypeWriter; + class IStoryWriter; + class IStoryboardWriter; + class IStoryboardElementStateConditionWriter; + class ISunWriter; + class ISynchronizeActionWriter; + class ITargetDistanceSteadyStateWriter; + class ITargetTimeSteadyStateWriter; + class ITeleportActionWriter; + class ITimeHeadwayConditionWriter; + class ITimeOfDayWriter; + class ITimeOfDayConditionWriter; + class ITimeReferenceWriter; + class ITimeToCollisionConditionWriter; + class ITimeToCollisionConditionTargetWriter; + class ITimingWriter; + class ITrafficActionWriter; + class ITrafficAreaWriter; + class ITrafficAreaActionWriter; + class ITrafficDefinitionWriter; + class ITrafficDistributionWriter; + class ITrafficDistributionEntryWriter; + class ITrafficSignalActionWriter; + class ITrafficSignalConditionWriter; + class ITrafficSignalControllerWriter; + class ITrafficSignalControllerActionWriter; + class ITrafficSignalControllerConditionWriter; + class ITrafficSignalGroupStateWriter; + class ITrafficSignalStateWriter; + class ITrafficSignalStateActionWriter; + class ITrafficSinkActionWriter; + class ITrafficSourceActionWriter; + class ITrafficStopActionWriter; + class ITrafficSwarmActionWriter; + class ITrailerWriter; + class ITrailerActionWriter; + class ITrailerCouplerWriter; + class ITrailerHitchWriter; + class ITrajectoryWriter; + class ITrajectoryCatalogLocationWriter; + class ITrajectoryFollowingModeWriter; + class ITrajectoryPositionWriter; + class ITrajectoryRefWriter; + class ITransitionDynamicsWriter; + class ITraveledDistanceConditionWriter; + class ITriggerWriter; + class ITriggeringEntitiesWriter; + class IUniformDistributionWriter; + class IUsedAreaWriter; + class IUserDefinedActionWriter; + class IUserDefinedAnimationWriter; + class IUserDefinedComponentWriter; + class IUserDefinedDistributionWriter; + class IUserDefinedLightWriter; + class IUserDefinedValueConditionWriter; + class IValueConstraintWriter; + class IValueConstraintGroupWriter; + class IValueSetDistributionWriter; + class IVariableActionWriter; + class IVariableAddValueRuleWriter; + class IVariableConditionWriter; + class IVariableDeclarationWriter; + class IVariableModifyActionWriter; + class IVariableModifyRuleWriter; + class IVariableMultiplyByValueRuleWriter; + class IVariableSetActionWriter; + class IVehicleWriter; + class IVehicleCatalogLocationWriter; + class IVehicleCategoryDistributionWriter; + class IVehicleCategoryDistributionEntryWriter; + class IVehicleComponentWriter; + class IVehicleLightWriter; + class IVehicleRoleDistributionWriter; + class IVehicleRoleDistributionEntryWriter; + class IVertexWriter; + class IVisibilityActionWriter; + class IWaypointWriter; + class IWeatherWriter; + class IWindWriter; + class IWorldPositionWriter; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AbsoluteSpeed' + * From OpenSCENARIO class model specification: + * Absolute speed definition. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteSpeedWriter : public IOpenScenarioElementWriter, public IAbsoluteSpeed + { + public: + virtual ~IAbsoluteSpeedWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Absolute speed. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return value of model property steadyState + */ + virtual void SetSteadyState(std::shared_ptr steadyState) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return a writer for model property steadyState + */ + virtual std::shared_ptr GetWriterSteadyState() const = 0; + + /** + * Resets the optional property (IsSetSteadyState() will return false); + */ + virtual void ResetSteadyState() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AbsoluteTargetLane' + * From OpenSCENARIO class model specification: + * Defines the number (ID) of the target lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetLaneWriter : public IOpenScenarioElementWriter, public IAbsoluteTargetLane + { + public: + virtual ~IAbsoluteTargetLaneWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Number (ID) of the target lane the entity will change to. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AbsoluteTargetLaneOffset' + * From OpenSCENARIO class model specification: + * Lane offset with respect to the entity's current lane's center line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetLaneOffsetWriter : public IOpenScenarioElementWriter, public IAbsoluteTargetLaneOffset + { + public: + virtual ~IAbsoluteTargetLaneOffsetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Signed number in meters the vehicle should respect as an offset from the center of the current lane. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AbsoluteTargetSpeed' + * From OpenSCENARIO class model specification: + * Absolute speed defined as a target for a SpeedAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAbsoluteTargetSpeedWriter : public IOpenScenarioElementWriter, public IAbsoluteTargetSpeed + { + public: + virtual ~IAbsoluteTargetSpeedWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Target speed the vehicle should change to. Unit: [m/s]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AccelerationCondition' + * From OpenSCENARIO class model specification: + * Compares the entity's acceleration to a reference value. The logical operator used for comparison is defined by the rule + * attribute (less, greater, equal). If direction is used, only the projection to that direction is used in the comparison. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAccelerationConditionWriter : public IOpenScenarioElementWriter, public IAccelerationCondition + { + public: + virtual ~IAccelerationConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Direction of the acceleration (if not given, the total acceleration is considered). + * + * @return value of model property direction + */ + virtual void SetDirection(const DirectionalDimension direction) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Acceleration value. Unit: [m/s²]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute direction + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDirection(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute direction + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDirection() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute direction is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDirectionParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetDirection() will return false); + */ + virtual void ResetDirection() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AcquirePositionAction' + * From OpenSCENARIO class model specification: + * Controls the entity to acquire a target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAcquirePositionActionWriter : public IOpenScenarioElementWriter, public IAcquirePositionAction + { + public: + virtual ~IAcquirePositionActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A position to acquire. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A position to acquire. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Act' + * From OpenSCENARIO class model specification: + * A container for maneuver groups. An Act can be only executed once, whereby the included maneuver groups can be executed + * several times depending on the maximum execution count within the maneuver groups. New executions are only allowed to + * start when all contained maneuver groups are either in the complete or standby state and the start trigger evaluates to + * true. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActWriter : public IOpenScenarioElementWriter, public IAct, public IStoryboardElementWriter + { + public: + virtual ~IActWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of this act. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of maneuver groups representing the act. + * + * @return value of model property maneuverGroups + */ + virtual void SetManeuverGroups(std::vector>& maneuverGroups) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that starts the act. If no trigger is defined, the act starts when the Storyboard enters runningState. + * + * @return value of model property startTrigger + */ + virtual void SetStartTrigger(std::shared_ptr startTrigger) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that stops the act. + * + * @return value of model property stopTrigger + */ + virtual void SetStopTrigger(std::shared_ptr stopTrigger) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that starts the act. If no trigger is defined, the act starts when the Storyboard enters runningState. + * + * @return a writer for model property startTrigger + */ + virtual std::shared_ptr GetWriterStartTrigger() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a trigger that stops the act. + * + * @return a writer for model property stopTrigger + */ + virtual std::shared_ptr GetWriterStopTrigger() const = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of maneuver groups representing the act. + * + * @return a list of writers for model property maneuverGroups + */ + virtual std::vector> GetWriterManeuverGroups() const = 0; + /** + * Resets the optional property (IsSetStartTrigger() will return false); + */ + virtual void ResetStartTrigger() = 0; + + /** + * Resets the optional property (IsSetStopTrigger() will return false); + */ + virtual void ResetStopTrigger() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Action' + * From OpenSCENARIO class model specification: + * An action serves to create or modify all dynamic elements of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActionWriter : public IOpenScenarioElementWriter, public IAction, public IStoryboardElementWriter + { + public: + virtual ~IActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of this action. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * The GlobalAction to be executed when the enclosing Action is started. + * + * @return value of model property globalAction + */ + virtual void SetGlobalAction(std::shared_ptr globalAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * The UserDefinedAction to be executed when the enclosing Action is started. + * + * @return value of model property userDefinedAction + */ + virtual void SetUserDefinedAction(std::shared_ptr userDefinedAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * The PrivateAction to be executed when the enclosing Action is started. + * + * @return value of model property privateAction + */ + virtual void SetPrivateAction(std::shared_ptr privateAction) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The GlobalAction to be executed when the enclosing Action is started. + * + * @return a writer for model property globalAction + */ + virtual std::shared_ptr GetWriterGlobalAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * The UserDefinedAction to be executed when the enclosing Action is started. + * + * @return a writer for model property userDefinedAction + */ + virtual std::shared_ptr GetWriterUserDefinedAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * The PrivateAction to be executed when the enclosing Action is started. + * + * @return a writer for model property privateAction + */ + virtual std::shared_ptr GetWriterPrivateAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ActivateControllerAction' + * From OpenSCENARIO class model specification: + * This action activates or deactivates a user-defined controller which must be assigned to the specified entity. A + * controller cannot be activated in a domain in which it is not defined. + +Note: Although it is allowed to omit the + * objectControllerRef attribute for the sake of a backward compatibility if only a single user-defined controller is + * assigned to the concerned Entity, it is considered unmeaningful in case of multiple controllers are assigned. This is + * expected to be addressed in one of the follow-up major versions, where the attribute shall be defined as mandatory to + * exclude an ambiguity in specifying the reference controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActivateControllerActionWriter : public IOpenScenarioElementWriter, public IActivateControllerAction + { + public: + virtual ~IActivateControllerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * In animation domain: Activate or deactivate an animation. If not specified: No change for controlling the animation + * domain is applied. + * + * @return value of model property animation + */ + virtual void SetAnimation(const bool animation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to a controller assigned to the entity. + * + * @return value of model property controllerRef + */ + virtual void SetControllerRef(std::shared_ptr> controllerRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * In lateral domain: Activate or deactivate controller defined (e.g. automated, autonomous) behavior. If not specified: No + * change for controlling the lateral domain is applied. + * + * @return value of model property lateral + */ + virtual void SetLateral(const bool lateral) = 0; + + /** + * From OpenSCENARIO class model specification: + * In lighting domain: Activate or deactivate lights. If not specified: No change for controlling the lighting domain is + * applied. + * + * @return value of model property lighting + */ + virtual void SetLighting(const bool lighting) = 0; + + /** + * From OpenSCENARIO class model specification: + * In longitudinal domain: Activate or deactivate autonomous behavior. If not specified: No change for controlling the + * longitudinal domain is applied. + * + * @return value of model property longitudinal + */ + virtual void SetLongitudinal(const bool longitudinal) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to an object controller which is assigned to the entity. + * + * @return value of model property objectControllerRef + */ + virtual void SetObjectControllerRef(std::shared_ptr> objectControllerRef) = 0; + + /** + * Set a parameter for the attribute animation + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAnimation(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute controllerRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToControllerRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute lateral + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLateral(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute lighting + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLighting(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute longitudinal + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLongitudinal(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute objectControllerRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToObjectControllerRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute animation + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAnimation() const = 0; + /** + * Get the parameter for the attribute controllerRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromControllerRef() const = 0; + /** + * Get the parameter for the attribute lateral + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLateral() const = 0; + /** + * Get the parameter for the attribute lighting + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLighting() const = 0; + /** + * Get the parameter for the attribute longitudinal + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLongitudinal() const = 0; + /** + * Get the parameter for the attribute objectControllerRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromObjectControllerRef() const = 0; + + /** + * Retrieves whether the attribute animation is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAnimationParameterized() = 0; + /** + * Retrieves whether the attribute controllerRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsControllerRefParameterized() = 0; + /** + * Retrieves whether the attribute lateral is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLateralParameterized() = 0; + /** + * Retrieves whether the attribute lighting is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLightingParameterized() = 0; + /** + * Retrieves whether the attribute longitudinal is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLongitudinalParameterized() = 0; + /** + * Retrieves whether the attribute objectControllerRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsObjectControllerRefParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetAnimation() will return false); + */ + virtual void ResetAnimation() = 0; + + /** + * Resets the optional property (IsSetControllerRef() will return false); + */ + virtual void ResetControllerRef() = 0; + + /** + * Resets the optional property (IsSetLateral() will return false); + */ + virtual void ResetLateral() = 0; + + /** + * Resets the optional property (IsSetLighting() will return false); + */ + virtual void ResetLighting() = 0; + + /** + * Resets the optional property (IsSetLongitudinal() will return false); + */ + virtual void ResetLongitudinal() = 0; + + /** + * Resets the optional property (IsSetObjectControllerRef() will return false); + */ + virtual void ResetObjectControllerRef() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Actors' + * From OpenSCENARIO class model specification: + * A set of entities representing the actors in a maneuver group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IActorsWriter : public IOpenScenarioElementWriter, public IActors + { + public: + virtual ~IActorsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Indicates whether the triggering entities are considered actors. + * + * @return value of model property selectTriggeringEntities + */ + virtual void SetSelectTriggeringEntities(const bool selectTriggeringEntities) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of entities this actor is referencing. + * + * @return value of model property entityRefs + */ + virtual void SetEntityRefs(std::vector>& entityRefs) = 0; + + /** + * Set a parameter for the attribute selectTriggeringEntities + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSelectTriggeringEntities(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute selectTriggeringEntities + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSelectTriggeringEntities() const = 0; + + /** + * Retrieves whether the attribute selectTriggeringEntities is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSelectTriggeringEntitiesParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * A list of entities this actor is referencing. + * + * @return a list of writers for model property entityRefs + */ + virtual std::vector> GetWriterEntityRefs() const = 0; + /** + * Resets the optional property (IsSetEntityRefs() will return false); + */ + virtual void ResetEntityRefs() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AddEntityAction' + * From OpenSCENARIO class model specification: + * Adds an entity to the scenario, at a predefined position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAddEntityActionWriter : public IOpenScenarioElementWriter, public IAddEntityAction + { + public: + virtual ~IAddEntityActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Adds an entity at the specified position. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Adds an entity at the specified position. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AngleCondition' + * From OpenSCENARIO class model specification: + * Checks if a triggering entity has reached a given angle in a specific angular coordinate, within some user-specified + * angle tolerance. + +The angle can be measured in the global world coordinate system or in s-t coordinates like road, lane + * or trajectory coordinates. In case of s-t coordinates, the orientation is measured at the local s-coordinate of the + * triggering entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAngleConditionWriter : public IOpenScenarioElementWriter, public IAngleCondition + { + public: + virtual ~IAngleConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The angle value that will be compared to the triggering entity's orientation. Unit: [rad]. Range: [-pi..pi]. + * + * @return value of model property angle + */ + virtual void SetAngle(const double angle) = 0; + + /** + * From OpenSCENARIO class model specification: + * Tolerance around the given angle value. Unit: [rad]. Range: [0..pi]. + * + * @return value of model property angleTolerance + */ + virtual void SetAngleTolerance(const double angleTolerance) = 0; + + /** + * From OpenSCENARIO class model specification: + * The angular coordinate to be used for the condition. + * + * @return value of model property angleType + */ + virtual void SetAngleType(const AngleType angleType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Define which coordinate system is used to measure the angle of the triggering entity. Note that using the value entity + * would always result in measuring an angle of zero. Default: world. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * Set a parameter for the attribute angle + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngle(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute angleTolerance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngleTolerance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute angleType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngleType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute angle + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngle() const = 0; + /** + * Get the parameter for the attribute angleTolerance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngleTolerance() const = 0; + /** + * Get the parameter for the attribute angleType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngleType() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + + /** + * Retrieves whether the attribute angle is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleParameterized() = 0; + /** + * Retrieves whether the attribute angleTolerance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleToleranceParameterized() = 0; + /** + * Retrieves whether the attribute angleType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleTypeParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AnimationAction' + * From OpenSCENARIO class model specification: + * This action describes the transition of a current component state to the target component state or more complex + * animations like pedestrian motions and gestures as well as animations with a referenced file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationActionWriter : public IOpenScenarioElementWriter, public IAnimationAction + { + public: + virtual ~IAnimationActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Duration of an animation. Default if omitted: depending on the animation itself and the implementation of the simulator. + * Unit: [s]. + * + * @return value of model property animationDuration + */ + virtual void SetAnimationDuration(const double animationDuration) = 0; + + /** + * From OpenSCENARIO class model specification: + * If set to true, the animation will be looped. Default if omitted: false. + * + * @return value of model property loop + */ + virtual void SetLoop(const bool loop) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to the type of animation that will be addressed in this AnimationAction. + * + * @return value of model property animationType + */ + virtual void SetAnimationType(std::shared_ptr animationType) = 0; + + /** + * From OpenSCENARIO class model specification: + * AnimationState after execution of the AnimationAction. Only required for AnimationType componentAnimation. + * + * @return value of model property animationState + */ + virtual void SetAnimationState(std::shared_ptr animationState) = 0; + + /** + * Set a parameter for the attribute animationDuration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAnimationDuration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute loop + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLoop(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute animationDuration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAnimationDuration() const = 0; + /** + * Get the parameter for the attribute loop + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLoop() const = 0; + + /** + * Retrieves whether the attribute animationDuration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAnimationDurationParameterized() = 0; + /** + * Retrieves whether the attribute loop is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLoopParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Reference to the type of animation that will be addressed in this AnimationAction. + * + * @return a writer for model property animationType + */ + virtual std::shared_ptr GetWriterAnimationType() const = 0; + /** + * From OpenSCENARIO class model specification: + * AnimationState after execution of the AnimationAction. Only required for AnimationType componentAnimation. + * + * @return a writer for model property animationState + */ + virtual std::shared_ptr GetWriterAnimationState() const = 0; + + /** + * Resets the optional property (IsSetAnimationDuration() will return false); + */ + virtual void ResetAnimationDuration() = 0; + + /** + * Resets the optional property (IsSetLoop() will return false); + */ + virtual void ResetLoop() = 0; + + /** + * Resets the optional property (IsSetAnimationState() will return false); + */ + virtual void ResetAnimationState() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AnimationFile' + * From OpenSCENARIO class model specification: + * Reference to a file which contains an animation / motion definition (e.g. an fbx file containing a motion from motion + * capturing). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationFileWriter : public IOpenScenarioElementWriter, public IAnimationFile + { + public: + virtual ~IAnimationFileWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Time offset from beginning of animation. Unit: [s]. Range: [0..inf[. Default, if omitted is 0 (start from beginning of + * animation). + * + * @return value of model property timeOffset + */ + virtual void SetTimeOffset(const double timeOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Filepath of the animation / motion file. + * + * @return value of model property file + */ + virtual void SetFile(std::shared_ptr file) = 0; + + /** + * Set a parameter for the attribute timeOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTimeOffset(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute timeOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTimeOffset() const = 0; + + /** + * Retrieves whether the attribute timeOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeOffsetParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Filepath of the animation / motion file. + * + * @return a writer for model property file + */ + virtual std::shared_ptr GetWriterFile() const = 0; + + /** + * Resets the optional property (IsSetTimeOffset() will return false); + */ + virtual void ResetTimeOffset() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AnimationState' + * From OpenSCENARIO class model specification: + * Definition of the animation state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationStateWriter : public IOpenScenarioElementWriter, public IAnimationState + { + public: + virtual ~IAnimationStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The goal state of a component after the AnimationStateAction is executed (rotation: 0% -> lower limiting angle / 100% + * -> upper limiting angle; translation: 0% -> lower limiting position on movement axis / 100% -> upper limiting + * position on movement axis). Range: [0..1]. + * + * @return value of model property state + */ + virtual void SetState(const double state) = 0; + + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AnimationType' + * From OpenSCENARIO class model specification: + * Defines the type of the animation. A conflicting animation will override a currently active animation. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAnimationTypeWriter : public IOpenScenarioElementWriter, public IAnimationType + { + public: + virtual ~IAnimationTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Animation of a component along or around one axis. Field animationState in AnimationAction is required. + * + * @return value of model property componentAnimation + */ + virtual void SetComponentAnimation(std::shared_ptr componentAnimation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of a pedestrian's motion and gestures. + * + * @return value of model property pedestrianAnimation + */ + virtual void SetPedestrianAnimation(std::shared_ptr pedestrianAnimation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to a file which contains an animation / motion definition. + * + * @return value of model property animationFile + */ + virtual void SetAnimationFile(std::shared_ptr animationFile) = 0; + + /** + * From OpenSCENARIO class model specification: + * The animation type is not covered by the above options and is therefore user defined. + * + * @return value of model property userDefinedAnimation + */ + virtual void SetUserDefinedAnimation(std::shared_ptr userDefinedAnimation) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Animation of a component along or around one axis. Field animationState in AnimationAction is required. + * + * @return a writer for model property componentAnimation + */ + virtual std::shared_ptr GetWriterComponentAnimation() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of a pedestrian's motion and gestures. + * + * @return a writer for model property pedestrianAnimation + */ + virtual std::shared_ptr GetWriterPedestrianAnimation() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference to a file which contains an animation / motion definition. + * + * @return a writer for model property animationFile + */ + virtual std::shared_ptr GetWriterAnimationFile() const = 0; + /** + * From OpenSCENARIO class model specification: + * The animation type is not covered by the above options and is therefore user defined. + * + * @return a writer for model property userDefinedAnimation + */ + virtual std::shared_ptr GetWriterUserDefinedAnimation() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AppearanceAction' + * From OpenSCENARIO class model specification: + * Actions defining the behaviour of an entity without moving it in the world, e.g. turning on a light or opening a door. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAppearanceActionWriter : public IOpenScenarioElementWriter, public IAppearanceAction + { + public: + virtual ~IAppearanceActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines a target light state for a certain light. + * + * @return value of model property lightStateAction + */ + virtual void SetLightStateAction(std::shared_ptr lightStateAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines an animation based on the animation type. + * + * @return value of model property animationAction + */ + virtual void SetAnimationAction(std::shared_ptr animationAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a target light state for a certain light. + * + * @return a writer for model property lightStateAction + */ + virtual std::shared_ptr GetWriterLightStateAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines an animation based on the animation type. + * + * @return a writer for model property animationAction + */ + virtual std::shared_ptr GetWriterAnimationAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AssignControllerAction' + * From OpenSCENARIO class model specification: + * This action assigns an object controller to the given entity defined in the enclosing PrivateAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAssignControllerActionWriter : public IOpenScenarioElementWriter, public IAssignControllerAction + { + public: + virtual ~IAssignControllerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated the animation domain. False: the assigned animation controller gets + * deactivated. If not specified: No change for controlling the animation domain is applied. + * + * @return value of model property activateAnimation + */ + virtual void SetActivateAnimation(const bool activateAnimation) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated for the lateral dimension. False: the assigned controller gets deactivated + * for the lateral dimension. If not specified: No change for controlling the lateral dimension is applied. + * + * @return value of model property activateLateral + */ + virtual void SetActivateLateral(const bool activateLateral) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated the lighting domain. False: the assigned lighting controller gets + * deactivated. If not specified: No change for controlling the lighting domain is applied. + * + * @return value of model property activateLighting + */ + virtual void SetActivateLighting(const bool activateLighting) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: The assigned controller gets activated for the longitudinal dimension. False: the assigned controller gets + * deactivated for the longitudinal dimension. If not specified: No change for controlling the longitudinal dimension is + * applied. + * + * @return value of model property activateLongitudinal + */ + virtual void SetActivateLongitudinal(const bool activateLongitudinal) = 0; + + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to a given entity. + * + * @return value of model property controller + */ + virtual void SetController(std::shared_ptr controller) = 0; + + /** + * From OpenSCENARIO class model specification: + * Uses a CatalogReference to assign a controller to a given entity. CatalogReference must point to a Controller type. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + /** + * From OpenSCENARIO class model specification: + * Specifies the object controller to be assigned. + * + * @return value of model property objectController + */ + virtual void SetObjectController(std::shared_ptr objectController) = 0; + + /** + * Set a parameter for the attribute activateAnimation + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActivateAnimation(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute activateLateral + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActivateLateral(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute activateLighting + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActivateLighting(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute activateLongitudinal + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActivateLongitudinal(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute activateAnimation + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActivateAnimation() const = 0; + /** + * Get the parameter for the attribute activateLateral + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActivateLateral() const = 0; + /** + * Get the parameter for the attribute activateLighting + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActivateLighting() const = 0; + /** + * Get the parameter for the attribute activateLongitudinal + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActivateLongitudinal() const = 0; + + /** + * Retrieves whether the attribute activateAnimation is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActivateAnimationParameterized() = 0; + /** + * Retrieves whether the attribute activateLateral is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActivateLateralParameterized() = 0; + /** + * Retrieves whether the attribute activateLighting is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActivateLightingParameterized() = 0; + /** + * Retrieves whether the attribute activateLongitudinal is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActivateLongitudinalParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to a given entity. + * + * @return a writer for model property controller + */ + virtual std::shared_ptr GetWriterController() const = 0; + /** + * From OpenSCENARIO class model specification: + * Uses a CatalogReference to assign a controller to a given entity. CatalogReference must point to a Controller type. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + /** + * From OpenSCENARIO class model specification: + * Specifies the object controller to be assigned. + * + * @return a writer for model property objectController + */ + virtual std::shared_ptr GetWriterObjectController() const = 0; + + /** + * Resets the optional property (IsSetActivateAnimation() will return false); + */ + virtual void ResetActivateAnimation() = 0; + + /** + * Resets the optional property (IsSetActivateLateral() will return false); + */ + virtual void ResetActivateLateral() = 0; + + /** + * Resets the optional property (IsSetActivateLighting() will return false); + */ + virtual void ResetActivateLighting() = 0; + + /** + * Resets the optional property (IsSetActivateLongitudinal() will return false); + */ + virtual void ResetActivateLongitudinal() = 0; + + /** + * Resets the optional property (IsSetController() will return false); + */ + virtual void ResetController() = 0; + + /** + * Resets the optional property (IsSetCatalogReference() will return false); + */ + virtual void ResetCatalogReference() = 0; + + /** + * Resets the optional property (IsSetObjectController() will return false); + */ + virtual void ResetObjectController() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AssignRouteAction' + * From OpenSCENARIO class model specification: + * Controls an entity to follow a route using waypoints on the road network. The corresponding route can be instantiated + * from a catalog type, or defined within this declaration. This action does not override any action that controls either + * lateral or longitudinal domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAssignRouteActionWriter : public IOpenScenarioElementWriter, public IAssignRouteAction + { + public: + virtual ~IAssignRouteActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The route definition. + * + * @return value of model property route + */ + virtual void SetRoute(std::shared_ptr route) = 0; + + /** + * From OpenSCENARIO class model specification: + * A reference to the route definition in a catalog. The reference must point to a route. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The route definition. + * + * @return a writer for model property route + */ + virtual std::shared_ptr GetWriterRoute() const = 0; + /** + * From OpenSCENARIO class model specification: + * A reference to the route definition in a catalog. The reference must point to a route. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'AutomaticGear' + * From OpenSCENARIO class model specification: + * Automatic gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAutomaticGearWriter : public IOpenScenarioElementWriter, public IAutomaticGear + { + public: + virtual ~IAutomaticGearWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Gear type. + * + * @return value of model property gear + */ + virtual void SetGear(const AutomaticGearType gear) = 0; + + /** + * Set a parameter for the attribute gear + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToGear(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute gear + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromGear() const = 0; + + /** + * Retrieves whether the attribute gear is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsGearParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Axle' + * From OpenSCENARIO class model specification: + * The definition of vehicle axle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAxleWriter : public IOpenScenarioElementWriter, public IAxle + { + public: + virtual ~IAxleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Maximum steering angle which can be performed by the wheels on this axle. Unit: [rad]. Range: [0..PI], symmetrical. + * + * @return value of model property maxSteering + */ + virtual void SetMaxSteering(const double maxSteering) = 0; + + /** + * From OpenSCENARIO class model specification: + * Longitudinal position of the axle with respect to the vehicles reference point. Unit: [m]. Range: [0..inf[. + * + * @return value of model property positionX + */ + virtual void SetPositionX(const double positionX) = 0; + + /** + * From OpenSCENARIO class model specification: + * Z-position of the axle with respect to the vehicles reference point. Usually this is half of wheel diameter. Unit: [m]. + * Range: [0..inf[. + * + * @return value of model property positionZ + */ + virtual void SetPositionZ(const double positionZ) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distance of the wheels center lines at zero steering. Unit: [m]. Range: [0..inf[. + * + * @return value of model property trackWidth + */ + virtual void SetTrackWidth(const double trackWidth) = 0; + + /** + * From OpenSCENARIO class model specification: + * Diameter of the wheels on this axle. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property wheelDiameter + */ + virtual void SetWheelDiameter(const double wheelDiameter) = 0; + + /** + * Set a parameter for the attribute maxSteering + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxSteering(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute positionX + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPositionX(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute positionZ + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPositionZ(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute trackWidth + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrackWidth(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute wheelDiameter + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWheelDiameter(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maxSteering + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxSteering() const = 0; + /** + * Get the parameter for the attribute positionX + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPositionX() const = 0; + /** + * Get the parameter for the attribute positionZ + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPositionZ() const = 0; + /** + * Get the parameter for the attribute trackWidth + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrackWidth() const = 0; + /** + * Get the parameter for the attribute wheelDiameter + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWheelDiameter() const = 0; + + /** + * Retrieves whether the attribute maxSteering is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxSteeringParameterized() = 0; + /** + * Retrieves whether the attribute positionX is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPositionXParameterized() = 0; + /** + * Retrieves whether the attribute positionZ is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPositionZParameterized() = 0; + /** + * Retrieves whether the attribute trackWidth is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrackWidthParameterized() = 0; + /** + * Retrieves whether the attribute wheelDiameter is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWheelDiameterParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Axles' + * From OpenSCENARIO class model specification: + * A set of the axles of a vehicle. A vehicle must have a front axle and a rear axle except for trailers which may also + * only have a rear axle. It might have additional axles. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IAxlesWriter : public IOpenScenarioElementWriter, public IAxles + { + public: + virtual ~IAxlesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Front axle. + * + * @return value of model property frontAxle + */ + virtual void SetFrontAxle(std::shared_ptr frontAxle) = 0; + + /** + * From OpenSCENARIO class model specification: + * Rear axle. + * + * @return value of model property rearAxle + */ + virtual void SetRearAxle(std::shared_ptr rearAxle) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of optional additional axles. + * + * @return value of model property additionalAxles + */ + virtual void SetAdditionalAxles(std::vector>& additionalAxles) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Front axle. + * + * @return a writer for model property frontAxle + */ + virtual std::shared_ptr GetWriterFrontAxle() const = 0; + /** + * From OpenSCENARIO class model specification: + * Rear axle. + * + * @return a writer for model property rearAxle + */ + virtual std::shared_ptr GetWriterRearAxle() const = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of optional additional axles. + * + * @return a list of writers for model property additionalAxles + */ + virtual std::vector> GetWriterAdditionalAxles() const = 0; + /** + * Resets the optional property (IsSetFrontAxle() will return false); + */ + virtual void ResetFrontAxle() = 0; + + /** + * Resets the optional property (IsSetAdditionalAxles() will return false); + */ + virtual void ResetAdditionalAxles() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'BoundingBox' + * From OpenSCENARIO class model specification: + * Defines geometric properties of the entities as a simplified three dimensional bounding box. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBoundingBoxWriter : public IOpenScenarioElementWriter, public IBoundingBox + { + public: + virtual ~IBoundingBoxWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of + * the entity (e.g. the vehicle coordinate system). + * + * @return value of model property center + */ + virtual void SetCenter(std::shared_ptr center) = 0; + + /** + * From OpenSCENARIO class model specification: + * Width, length and height of the bounding box. + * + * @return value of model property dimensions + */ + virtual void SetDimensions(std::shared_ptr dimensions) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of + * the entity (e.g. the vehicle coordinate system). + * + * @return a writer for model property center + */ + virtual std::shared_ptr GetWriterCenter() const = 0; + /** + * From OpenSCENARIO class model specification: + * Width, length and height of the bounding box. + * + * @return a writer for model property dimensions + */ + virtual std::shared_ptr GetWriterDimensions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Brake' + * From OpenSCENARIO class model specification: + * Defines a brake input + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBrakeWriter : public IOpenScenarioElementWriter, public IBrake + { + public: + virtual ~IBrakeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Rate of the change. Unit: [%/s] if used by as BrakePercent, [N/s] if used as BrakeForce. + * + * @return value of model property maxRate + */ + virtual void SetMaxRate(const double maxRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Wanted value of the brake. Unit: [%] if used by as BrakePercent, [N] if used as BrakeForce. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute maxRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maxRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxRate() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute maxRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxRateParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxRate() will return false); + */ + virtual void ResetMaxRate() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'BrakeInput' + * From OpenSCENARIO class model specification: + * An action serves to create or modify all dynamic elements of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IBrakeInputWriter : public IOpenScenarioElementWriter, public IBrakeInput + { + public: + virtual ~IBrakeInputWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Percent + * + * @return value of model property brakePercent + */ + virtual void SetBrakePercent(std::shared_ptr brakePercent) = 0; + + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Force + * + * @return value of model property brakeForce + */ + virtual void SetBrakeForce(std::shared_ptr brakeForce) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Percent + * + * @return a writer for model property brakePercent + */ + virtual std::shared_ptr GetWriterBrakePercent() const = 0; + /** + * From OpenSCENARIO class model specification: + * Used if the brake input should be interpret as Force + * + * @return a writer for model property brakeForce + */ + virtual std::shared_ptr GetWriterBrakeForce() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ByEntityCondition' + * From OpenSCENARIO class model specification: + * Conditions referring an entity need to know which entity shall trigger the condition. TriggeringEntities is a collection + * of entities whose states are used to verify the given condition. An additional attribute needs to specify if one of the + * entities is enough for the condition to become true, or if all of them are required. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByEntityConditionWriter : public IOpenScenarioElementWriter, public IByEntityCondition + { + public: + virtual ~IByEntityConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A list of entities triggering this condition. + * + * @return value of model property triggeringEntities + */ + virtual void SetTriggeringEntities(std::shared_ptr triggeringEntities) = 0; + + /** + * From OpenSCENARIO class model specification: + * The condition which is related to the triggering entities. + * + * @return value of model property entityCondition + */ + virtual void SetEntityCondition(std::shared_ptr entityCondition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A list of entities triggering this condition. + * + * @return a writer for model property triggeringEntities + */ + virtual std::shared_ptr GetWriterTriggeringEntities() const = 0; + /** + * From OpenSCENARIO class model specification: + * The condition which is related to the triggering entities. + * + * @return a writer for model property entityCondition + */ + virtual std::shared_ptr GetWriterEntityCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ByObjectType' + * From OpenSCENARIO class model specification: + * Defines an object type to select entities. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByObjectTypeWriter : public IOpenScenarioElementWriter, public IByObjectType + { + public: + virtual ~IByObjectTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the type. + * + * @return value of model property type + */ + virtual void SetType(const ObjectType type) = 0; + + /** + * Set a parameter for the attribute type + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute type + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromType() const = 0; + + /** + * Retrieves whether the attribute type is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ByType' + * From OpenSCENARIO class model specification: + * A definition of a type, e. g. to be used to define members in an entity selection. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByTypeWriter : public IOpenScenarioElementWriter, public IByType + { + public: + virtual ~IByTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If a scenario object's entity object is of this type, it is part of the entity selection. + * + * @return value of model property objectType + */ + virtual void SetObjectType(const ObjectType objectType) = 0; + + /** + * Set a parameter for the attribute objectType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToObjectType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute objectType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromObjectType() const = 0; + + /** + * Retrieves whether the attribute objectType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsObjectTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ByValueCondition' + * From OpenSCENARIO class model specification: + * Conditions referring a runtime value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IByValueConditionWriter : public IOpenScenarioElementWriter, public IByValueCondition + { + public: + virtual ~IByValueConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A current parameter value is compared to a reference value. + * + * @return value of model property parameterCondition + */ + virtual void SetParameterCondition(std::shared_ptr parameterCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * The current time of day is compared to a reference value. + * + * @return value of model property timeOfDayCondition + */ + virtual void SetTimeOfDayCondition(std::shared_ptr timeOfDayCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * The current simulation time is compared to a reference value. + * + * @return value of model property simulationTimeCondition + */ + virtual void SetSimulationTimeCondition(std::shared_ptr simulationTimeCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced StoryboardElement terminates according to the given rule. + * + * @return value of model property storyboardElementStateCondition + */ + virtual void SetStoryboardElementStateCondition(std::shared_ptr storyboardElementStateCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * The current value of an externally defined named value is compared to a reference value (less, greater, equal). + * + * @return value of model property userDefinedValueCondition + */ + virtual void SetUserDefinedValueCondition(std::shared_ptr userDefinedValueCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal reaches the indicated state. + * + * @return value of model property trafficSignalCondition + */ + virtual void SetTrafficSignalCondition(std::shared_ptr trafficSignalCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal controller reaches the indicated state. + * + * @return value of model property trafficSignalControllerCondition + */ + virtual void SetTrafficSignalControllerCondition(std::shared_ptr trafficSignalControllerCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * A current variable value is compared to a reference value. + * + * @return value of model property variableCondition + */ + virtual void SetVariableCondition(std::shared_ptr variableCondition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A current parameter value is compared to a reference value. + * + * @return a writer for model property parameterCondition + */ + virtual std::shared_ptr GetWriterParameterCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * The current time of day is compared to a reference value. + * + * @return a writer for model property timeOfDayCondition + */ + virtual std::shared_ptr GetWriterTimeOfDayCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * The current simulation time is compared to a reference value. + * + * @return a writer for model property simulationTimeCondition + */ + virtual std::shared_ptr GetWriterSimulationTimeCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced StoryboardElement terminates according to the given rule. + * + * @return a writer for model property storyboardElementStateCondition + */ + virtual std::shared_ptr GetWriterStoryboardElementStateCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * The current value of an externally defined named value is compared to a reference value (less, greater, equal). + * + * @return a writer for model property userDefinedValueCondition + */ + virtual std::shared_ptr GetWriterUserDefinedValueCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal reaches the indicated state. + * + * @return a writer for model property trafficSignalCondition + */ + virtual std::shared_ptr GetWriterTrafficSignalCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition becomes true if the referenced signal controller reaches the indicated state. + * + * @return a writer for model property trafficSignalControllerCondition + */ + virtual std::shared_ptr GetWriterTrafficSignalControllerCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * A current variable value is compared to a reference value. + * + * @return a writer for model property variableCondition + */ + virtual std::shared_ptr GetWriterVariableCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Catalog' + * From OpenSCENARIO class model specification: + * A catalog may be used to make certain OpenSCENARIO elements reusable. In a catalog parameterizable types are maintained + * and can be referenced to create runtime instances of those types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogWriter : public IOpenScenarioElementWriter, public ICatalog + { + public: + virtual ~ICatalogWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the catalog. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of vehicle types that can be reused in a scenario. + * + * @return value of model property vehicles + */ + virtual void SetVehicles(std::vector>& vehicles) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of controller types that can be reused in a scenario. + * + * @return value of model property controllers + */ + virtual void SetControllers(std::vector>& controllers) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of pedestrian types that can be reused in a scenario. + * + * @return value of model property pedestrians + */ + virtual void SetPedestrians(std::vector>& pedestrians) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of miscellaneous object type that that can be reused in a scenario. + * + * @return value of model property miscObjects + */ + virtual void SetMiscObjects(std::vector>& miscObjects) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of environment types that can be reused in a scenario. + * + * @return value of model property environments + */ + virtual void SetEnvironments(std::vector>& environments) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of maneuver types that can be reused in a scenario. + * + * @return value of model property maneuvers + */ + virtual void SetManeuvers(std::vector>& maneuvers) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of trajectory types that can be reused in a scenario. + * + * @return value of model property trajectories + */ + virtual void SetTrajectories(std::vector>& trajectories) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of route types that can be reused in a scenario. + * + * @return value of model property routes + */ + virtual void SetRoutes(std::vector>& routes) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * A list of vehicle types that can be reused in a scenario. + * + * @return a list of writers for model property vehicles + */ + virtual std::vector> GetWriterVehicles() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of controller types that can be reused in a scenario. + * + * @return a list of writers for model property controllers + */ + virtual std::vector> GetWriterControllers() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of pedestrian types that can be reused in a scenario. + * + * @return a list of writers for model property pedestrians + */ + virtual std::vector> GetWriterPedestrians() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of miscellaneous object type that that can be reused in a scenario. + * + * @return a list of writers for model property miscObjects + */ + virtual std::vector> GetWriterMiscObjects() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of environment types that can be reused in a scenario. + * + * @return a list of writers for model property environments + */ + virtual std::vector> GetWriterEnvironments() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of maneuver types that can be reused in a scenario. + * + * @return a list of writers for model property maneuvers + */ + virtual std::vector> GetWriterManeuvers() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of trajectory types that can be reused in a scenario. + * + * @return a list of writers for model property trajectories + */ + virtual std::vector> GetWriterTrajectories() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of route types that can be reused in a scenario. + * + * @return a list of writers for model property routes + */ + virtual std::vector> GetWriterRoutes() const = 0; + /** + * Resets the optional property (IsSetVehicles() will return false); + */ + virtual void ResetVehicles() = 0; + + /** + * Resets the optional property (IsSetControllers() will return false); + */ + virtual void ResetControllers() = 0; + + /** + * Resets the optional property (IsSetPedestrians() will return false); + */ + virtual void ResetPedestrians() = 0; + + /** + * Resets the optional property (IsSetMiscObjects() will return false); + */ + virtual void ResetMiscObjects() = 0; + + /** + * Resets the optional property (IsSetEnvironments() will return false); + */ + virtual void ResetEnvironments() = 0; + + /** + * Resets the optional property (IsSetManeuvers() will return false); + */ + virtual void ResetManeuvers() = 0; + + /** + * Resets the optional property (IsSetTrajectories() will return false); + */ + virtual void ResetTrajectories() = 0; + + /** + * Resets the optional property (IsSetRoutes() will return false); + */ + virtual void ResetRoutes() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CatalogDefinition' + * From OpenSCENARIO class model specification: + * A marker stating that the OpenSCENARIO file is a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogDefinitionWriter : public IOpenScenarioElementWriter, public ICatalogDefinition + { + public: + virtual ~ICatalogDefinitionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return value of model property catalog + */ + virtual void SetCatalog(std::shared_ptr catalog) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return a writer for model property catalog + */ + virtual std::shared_ptr GetWriterCatalog() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CatalogLocations' + * From OpenSCENARIO class model specification: + * Set of catalogs which are referenced in a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogLocationsWriter : public IOpenScenarioElementWriter, public ICatalogLocations + { + public: + virtual ~ICatalogLocationsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on vehicle types. + * + * @return value of model property vehicleCatalog + */ + virtual void SetVehicleCatalog(std::shared_ptr vehicleCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on controller types. + * + * @return value of model property controllerCatalog + */ + virtual void SetControllerCatalog(std::shared_ptr controllerCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on pedestrian types. + * + * @return value of model property pedestrianCatalog + */ + virtual void SetPedestrianCatalog(std::shared_ptr pedestrianCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on miscellaneous object types. + * + * @return value of model property miscObjectCatalog + */ + virtual void SetMiscObjectCatalog(std::shared_ptr miscObjectCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on environment types. + * + * @return value of model property environmentCatalog + */ + virtual void SetEnvironmentCatalog(std::shared_ptr environmentCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on maneuver types. + * + * @return value of model property maneuverCatalog + */ + virtual void SetManeuverCatalog(std::shared_ptr maneuverCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on trajectory types. + * + * @return value of model property trajectoryCatalog + */ + virtual void SetTrajectoryCatalog(std::shared_ptr trajectoryCatalog) = 0; + + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on route types. + * + * @return value of model property routeCatalog + */ + virtual void SetRouteCatalog(std::shared_ptr routeCatalog) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on vehicle types. + * + * @return a writer for model property vehicleCatalog + */ + virtual std::shared_ptr GetWriterVehicleCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on controller types. + * + * @return a writer for model property controllerCatalog + */ + virtual std::shared_ptr GetWriterControllerCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on pedestrian types. + * + * @return a writer for model property pedestrianCatalog + */ + virtual std::shared_ptr GetWriterPedestrianCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on miscellaneous object types. + * + * @return a writer for model property miscObjectCatalog + */ + virtual std::shared_ptr GetWriterMiscObjectCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on environment types. + * + * @return a writer for model property environmentCatalog + */ + virtual std::shared_ptr GetWriterEnvironmentCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on maneuver types. + * + * @return a writer for model property maneuverCatalog + */ + virtual std::shared_ptr GetWriterManeuverCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on trajectory types. + * + * @return a writer for model property trajectoryCatalog + */ + virtual std::shared_ptr GetWriterTrajectoryCatalog() const = 0; + /** + * From OpenSCENARIO class model specification: + * This catalog location is the first choice to resolve CatalogReferences on route types. + * + * @return a writer for model property routeCatalog + */ + virtual std::shared_ptr GetWriterRouteCatalog() const = 0; + + /** + * Resets the optional property (IsSetVehicleCatalog() will return false); + */ + virtual void ResetVehicleCatalog() = 0; + + /** + * Resets the optional property (IsSetControllerCatalog() will return false); + */ + virtual void ResetControllerCatalog() = 0; + + /** + * Resets the optional property (IsSetPedestrianCatalog() will return false); + */ + virtual void ResetPedestrianCatalog() = 0; + + /** + * Resets the optional property (IsSetMiscObjectCatalog() will return false); + */ + virtual void ResetMiscObjectCatalog() = 0; + + /** + * Resets the optional property (IsSetEnvironmentCatalog() will return false); + */ + virtual void ResetEnvironmentCatalog() = 0; + + /** + * Resets the optional property (IsSetManeuverCatalog() will return false); + */ + virtual void ResetManeuverCatalog() = 0; + + /** + * Resets the optional property (IsSetTrajectoryCatalog() will return false); + */ + virtual void ResetTrajectoryCatalog() = 0; + + /** + * Resets the optional property (IsSetRouteCatalog() will return false); + */ + virtual void ResetRouteCatalog() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CatalogReference' + * From OpenSCENARIO class model specification: + * A reference to type in a catalog. It is used when importing the type in a scenario. Furthermore, it hands over + * additional parameter values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogReferenceWriter : public IOpenScenarioElementWriter, public ICatalogReference + { + public: + virtual ~ICatalogReferenceWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the catalog. + * + * @return value of model property catalogName + */ + virtual void SetCatalogName(const std::string catalogName) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of catalog entry. + * + * @return value of model property entryName + */ + virtual void SetEntryName(const std::string entryName) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of parameter assignments for instantiation. + * + * @return value of model property parameterAssignments + */ + virtual void SetParameterAssignments(std::vector>& parameterAssignments) = 0; + + /** + * From OpenSCENARIO class model specification: + * The resolved reference to a catalog element (out of the catalogName and entryName). Transient means, that it is not + * mapped to the schema. + * + * @return value of model property ref + */ + virtual void SetRef(const std::shared_ptr ref) = 0; + + /** + * Set a parameter for the attribute catalogName + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCatalogName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entryName + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntryName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute catalogName + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCatalogName() const = 0; + /** + * Get the parameter for the attribute entryName + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntryName() const = 0; + + /** + * Retrieves whether the attribute catalogName is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCatalogNameParameterized() = 0; + /** + * Retrieves whether the attribute entryName is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntryNameParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * List of parameter assignments for instantiation. + * + * @return a list of writers for model property parameterAssignments + */ + virtual std::vector> GetWriterParameterAssignments() const = 0; + /** + * Resets the optional property (IsSetParameterAssignments() will return false); + */ + virtual void ResetParameterAssignments() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Center' + * From OpenSCENARIO class model specification: + * Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of + * the entity (e.g. the vehicle coordinate system). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICenterWriter : public IOpenScenarioElementWriter, public ICenter + { + public: + virtual ~ICenterWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Center offset in x direction. + * + * @return value of model property x + */ + virtual void SetX(const double x) = 0; + + /** + * From OpenSCENARIO class model specification: + * Center offset in y direction. + * + * @return value of model property y + */ + virtual void SetY(const double y) = 0; + + /** + * From OpenSCENARIO class model specification: + * Center offset in z direction. + * + * @return value of model property z + */ + virtual void SetZ(const double z) = 0; + + /** + * Set a parameter for the attribute x + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToX(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute y + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToY(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute z + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToZ(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute x + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromX() const = 0; + /** + * Get the parameter for the attribute y + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromY() const = 0; + /** + * Get the parameter for the attribute z + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromZ() const = 0; + + /** + * Retrieves whether the attribute x is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsXParameterized() = 0; + /** + * Retrieves whether the attribute y is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsYParameterized() = 0; + /** + * Retrieves whether the attribute z is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsZParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CentralSwarmObject' + * From OpenSCENARIO class model specification: + * The entity that represents the center of a swarm. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICentralSwarmObjectWriter : public IOpenScenarioElementWriter, public ICentralSwarmObject + { + public: + virtual ~ICentralSwarmObjectWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the central entity the swarm traffic is created around. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Clothoid' + * From OpenSCENARIO class model specification: + * A shape of the trajectory of an entity. A clothoid is a curve whose curvature changes linearly with its curve length. If + * curvaturePrime is 0, then the resulting trajectory is a circular arc. If curvaturePrime is 0 and additionally curvature + * is 0, then the resulting trajectory is a line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoidWriter : public IOpenScenarioElementWriter, public IClothoid + { + public: + virtual ~IClothoidWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Start curvature of clothoid. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvature + */ + virtual void SetCurvature(const double curvature) = 0; + + /** + * From OpenSCENARIO class model specification: + * Rate of change of the curvature of the clothoid. Unit: [1/s]. Range: [0..inf[. + * + * @return value of model property curvatureDot + */ + virtual void SetCurvatureDot(const double curvatureDot) = 0; + + /** + * From OpenSCENARIO class model specification: + * Rate of change of the curvature of the clothoid. Unit: [1/m²]. Range: ]-inf..inf[. + * + * @return value of model property curvaturePrime + */ + virtual void SetCurvaturePrime(const double curvaturePrime) = 0; + + /** + * From OpenSCENARIO class model specification: + * Length of clothoid. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property length + */ + virtual void SetLength(const double length) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the start of the clothoid. Unit: [s]. Range: [0..inf[. + * + * @return value of model property startTime + */ + virtual void SetStartTime(const double startTime) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the end of the clothoid. Unit: [s]. Range: ]0..inf[. + * + * @return value of model property stopTime + */ + virtual void SetStopTime(const double stopTime) = 0; + + /** + * From OpenSCENARIO class model specification: + * Start position of a clothoid. If in the start position for an orientation dimension no value is provided, then a default + * of 0 is assumed. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute curvature + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCurvature(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute curvatureDot + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCurvatureDot(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute curvaturePrime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCurvaturePrime(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute length + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLength(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute startTime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToStartTime(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute stopTime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToStopTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute curvature + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCurvature() const = 0; + /** + * Get the parameter for the attribute curvatureDot + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCurvatureDot() const = 0; + /** + * Get the parameter for the attribute curvaturePrime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCurvaturePrime() const = 0; + /** + * Get the parameter for the attribute length + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLength() const = 0; + /** + * Get the parameter for the attribute startTime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromStartTime() const = 0; + /** + * Get the parameter for the attribute stopTime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromStopTime() const = 0; + + /** + * Retrieves whether the attribute curvature is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCurvatureParameterized() = 0; + /** + * Retrieves whether the attribute curvatureDot is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCurvatureDotParameterized() = 0; + /** + * Retrieves whether the attribute curvaturePrime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCurvaturePrimeParameterized() = 0; + /** + * Retrieves whether the attribute length is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLengthParameterized() = 0; + /** + * Retrieves whether the attribute startTime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStartTimeParameterized() = 0; + /** + * Retrieves whether the attribute stopTime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStopTimeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Start position of a clothoid. If in the start position for an orientation dimension no value is provided, then a default + * of 0 is assumed. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + /** + * Resets the optional property (IsSetCurvatureDot() will return false); + */ + virtual void ResetCurvatureDot() = 0; + + /** + * Resets the optional property (IsSetCurvaturePrime() will return false); + */ + virtual void ResetCurvaturePrime() = 0; + + /** + * Resets the optional property (IsSetStartTime() will return false); + */ + virtual void ResetStartTime() = 0; + + /** + * Resets the optional property (IsSetStopTime() will return false); + */ + virtual void ResetStopTime() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ClothoidSpline' + * From OpenSCENARIO class model specification: + * A shape specification which consists of one or multiple concatenated clothoids (clothoid spline). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoidSplineWriter : public IOpenScenarioElementWriter, public IClothoidSpline + { + public: + virtual ~IClothoidSplineWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the end of the clothoid spline curve. Required if timeStart in ClothoidSplineSegment is + * specified. Unit: [s]. Range: ].timeStart..inf[. + * + * @return value of model property timeEnd + */ + virtual void SetTimeEnd(const double timeEnd) = 0; + + /** + * From OpenSCENARIO class model specification: + * Clothoid spline segments. + * + * @return value of model property segments + */ + virtual void SetSegments(std::vector>& segments) = 0; + + /** + * Set a parameter for the attribute timeEnd + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTimeEnd(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute timeEnd + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTimeEnd() const = 0; + + /** + * Retrieves whether the attribute timeEnd is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeEndParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Clothoid spline segments. + * + * @return a list of writers for model property segments + */ + virtual std::vector> GetWriterSegments() const = 0; + /** + * Resets the optional property (IsSetTimeEnd() will return false); + */ + virtual void ResetTimeEnd() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ClothoidSplineSegment' + * From OpenSCENARIO class model specification: + * One segment of a clothoid spline. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IClothoidSplineSegmentWriter : public IOpenScenarioElementWriter, public IClothoidSplineSegment + { + public: + virtual ~IClothoidSplineSegmentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * End curvature of the clothoid segment. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvatureEnd + */ + virtual void SetCurvatureEnd(const double curvatureEnd) = 0; + + /** + * From OpenSCENARIO class model specification: + * Start curvature of the clothoid segment. Unit: [1/m]. Range: ]-inf..inf[. + * + * @return value of model property curvatureStart + */ + virtual void SetCurvatureStart(const double curvatureStart) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional heading offset of the clothoid segment relative to end of the previous segment or to positionStart if present. + * A missing value is interpreted as 0. Unit: [rad]. Range: ]-pi..pi[. + * + * @return value of model property hOffset + */ + virtual void SetHOffset(const double hOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Length of the clothoid segment. The length is measured in 2D. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property length + */ + virtual void SetLength(const double length) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional time specification at the start of the clothoid segment. Unit: [s]. Range: [0..inf[. + * + * @return value of model property timeStart + */ + virtual void SetTimeStart(const double timeStart) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional start position of the clothoid segment. If omitted for the first segment, then the current position of the + * entity, which follows this trajectory is used as start position. If omitted for subsequent segments, then the end + * position of the previous segment shall be used as start position. If only the heading component of the position is + * omitted than the heading of the end position of the previous segment shall be used. + * + * @return value of model property positionStart + */ + virtual void SetPositionStart(std::shared_ptr positionStart) = 0; + + /** + * Set a parameter for the attribute curvatureEnd + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCurvatureEnd(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute curvatureStart + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCurvatureStart(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute hOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToHOffset(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute length + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLength(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute timeStart + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTimeStart(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute curvatureEnd + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCurvatureEnd() const = 0; + /** + * Get the parameter for the attribute curvatureStart + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCurvatureStart() const = 0; + /** + * Get the parameter for the attribute hOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromHOffset() const = 0; + /** + * Get the parameter for the attribute length + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLength() const = 0; + /** + * Get the parameter for the attribute timeStart + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTimeStart() const = 0; + + /** + * Retrieves whether the attribute curvatureEnd is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCurvatureEndParameterized() = 0; + /** + * Retrieves whether the attribute curvatureStart is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCurvatureStartParameterized() = 0; + /** + * Retrieves whether the attribute hOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsHOffsetParameterized() = 0; + /** + * Retrieves whether the attribute length is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLengthParameterized() = 0; + /** + * Retrieves whether the attribute timeStart is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeStartParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Optional start position of the clothoid segment. If omitted for the first segment, then the current position of the + * entity, which follows this trajectory is used as start position. If omitted for subsequent segments, then the end + * position of the previous segment shall be used as start position. If only the heading component of the position is + * omitted than the heading of the end position of the previous segment shall be used. + * + * @return a writer for model property positionStart + */ + virtual std::shared_ptr GetWriterPositionStart() const = 0; + + /** + * Resets the optional property (IsSetHOffset() will return false); + */ + virtual void ResetHOffset() = 0; + + /** + * Resets the optional property (IsSetTimeStart() will return false); + */ + virtual void ResetTimeStart() = 0; + + /** + * Resets the optional property (IsSetPositionStart() will return false); + */ + virtual void ResetPositionStart() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CollisionCondition' + * From OpenSCENARIO class model specification: + * Condition becomes true when the triggering entity/entities collide with another given entity or any entity of a specific + * type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICollisionConditionWriter : public IOpenScenarioElementWriter, public ICollisionCondition + { + public: + virtual ~ICollisionConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of a specific entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Entities of this type can trigger the condition when collide. + * + * @return value of model property byType + */ + virtual void SetByType(std::shared_ptr byType) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Name of a specific entity. + * + * @return a writer for model property entityRef + */ + virtual std::shared_ptr GetWriterEntityRef() const = 0; + /** + * From OpenSCENARIO class model specification: + * Entities of this type can trigger the condition when collide. + * + * @return a writer for model property byType + */ + virtual std::shared_ptr GetWriterByType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Color' + * From OpenSCENARIO class model specification: + * Color description with a semantic color value and an optional detailed value for visualization. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColorWriter : public IOpenScenarioElementWriter, public IColor + { + public: + virtual ~IColorWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Semantic value of the color. + * + * @return value of model property colorType + */ + virtual void SetColorType(const ColorType colorType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Color description in RGB schema. + * + * @return value of model property colorRgb + */ + virtual void SetColorRgb(std::shared_ptr colorRgb) = 0; + + /** + * From OpenSCENARIO class model specification: + * Color description in CMYK schema. + * + * @return value of model property colorCmyk + */ + virtual void SetColorCmyk(std::shared_ptr colorCmyk) = 0; + + /** + * Set a parameter for the attribute colorType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToColorType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute colorType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromColorType() const = 0; + + /** + * Retrieves whether the attribute colorType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsColorTypeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Color description in RGB schema. + * + * @return a writer for model property colorRgb + */ + virtual std::shared_ptr GetWriterColorRgb() const = 0; + /** + * From OpenSCENARIO class model specification: + * Color description in CMYK schema. + * + * @return a writer for model property colorCmyk + */ + virtual std::shared_ptr GetWriterColorCmyk() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ColorCmyk' + * From OpenSCENARIO class model specification: + * Color description in CMYK schema. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColorCmykWriter : public IOpenScenarioElementWriter, public IColorCmyk + { + public: + virtual ~IColorCmykWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Cyan component of the color. Range: [0..1]. + * + * @return value of model property cyan + */ + virtual void SetCyan(const double cyan) = 0; + + /** + * From OpenSCENARIO class model specification: + * Black component of the color. Range: [0..1]. + * + * @return value of model property key + */ + virtual void SetKey(const double key) = 0; + + /** + * From OpenSCENARIO class model specification: + * Magenta component of the color. Range: [0..1]. + * + * @return value of model property magenta + */ + virtual void SetMagenta(const double magenta) = 0; + + /** + * From OpenSCENARIO class model specification: + * Yellow component of the color. Range: [0..1]. + * + * @return value of model property yellow + */ + virtual void SetYellow(const double yellow) = 0; + + /** + * Set a parameter for the attribute cyan + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCyan(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute key + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToKey(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute magenta + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMagenta(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute yellow + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToYellow(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute cyan + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCyan() const = 0; + /** + * Get the parameter for the attribute key + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromKey() const = 0; + /** + * Get the parameter for the attribute magenta + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMagenta() const = 0; + /** + * Get the parameter for the attribute yellow + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromYellow() const = 0; + + /** + * Retrieves whether the attribute cyan is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCyanParameterized() = 0; + /** + * Retrieves whether the attribute key is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsKeyParameterized() = 0; + /** + * Retrieves whether the attribute magenta is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMagentaParameterized() = 0; + /** + * Retrieves whether the attribute yellow is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsYellowParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ColorRgb' + * From OpenSCENARIO class model specification: + * Color description in RGB schema. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IColorRgbWriter : public IOpenScenarioElementWriter, public IColorRgb + { + public: + virtual ~IColorRgbWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Blue component of the color. Range: [0..1]. + * + * @return value of model property blue + */ + virtual void SetBlue(const double blue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Green component of the color. Range: [0..1]. + * + * @return value of model property green + */ + virtual void SetGreen(const double green) = 0; + + /** + * From OpenSCENARIO class model specification: + * Red component of the color. Range: [0..1]. + * + * @return value of model property red + */ + virtual void SetRed(const double red) = 0; + + /** + * Set a parameter for the attribute blue + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToBlue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute green + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToGreen(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute red + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRed(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute blue + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromBlue() const = 0; + /** + * Get the parameter for the attribute green + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromGreen() const = 0; + /** + * Get the parameter for the attribute red + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRed() const = 0; + + /** + * Retrieves whether the attribute blue is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsBlueParameterized() = 0; + /** + * Retrieves whether the attribute green is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsGreenParameterized() = 0; + /** + * Retrieves whether the attribute red is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRedParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ComponentAnimation' + * From OpenSCENARIO class model specification: + * Defines an animation of a component along or around one axis. Field animationState in AnimationAction is required. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IComponentAnimationWriter : public IOpenScenarioElementWriter, public IComponentAnimation + { + public: + virtual ~IComponentAnimationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Available components attached to a vehicle. + * + * @return value of model property vehicleComponent + */ + virtual void SetVehicleComponent(std::shared_ptr vehicleComponent) = 0; + + /** + * From OpenSCENARIO class model specification: + * The component type is not covered by the above options and is therefore user defined. + * + * @return value of model property userDefinedComponent + */ + virtual void SetUserDefinedComponent(std::shared_ptr userDefinedComponent) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Available components attached to a vehicle. + * + * @return a writer for model property vehicleComponent + */ + virtual std::shared_ptr GetWriterVehicleComponent() const = 0; + /** + * From OpenSCENARIO class model specification: + * The component type is not covered by the above options and is therefore user defined. + * + * @return a writer for model property userDefinedComponent + */ + virtual std::shared_ptr GetWriterUserDefinedComponent() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Condition' + * From OpenSCENARIO class model specification: + * A condition represents a set of logical expressions that evaluate the relationship of values provided by the user. These + * values may be entity states, scenario properties, scenario states or external signals. Conditions are the main + * components in triggers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IConditionWriter : public IOpenScenarioElementWriter, public ICondition + { + public: + virtual ~IConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Specifies the edge when the condition is evaluated to true (rising, falling, risingOrFalling, none). + * + * @return value of model property conditionEdge + */ + virtual void SetConditionEdge(const ConditionEdge conditionEdge) = 0; + + /** + * From OpenSCENARIO class model specification: + * Time elapsed after the edge condition is verified, until the condition returns true to the scenario. Unit: [s]. Range: + * [0..inf[. + * + * @return value of model property delay + */ + virtual void SetDelay(const double delay) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the condition. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * A condition that refers to an entity. + * + * @return value of model property byEntityCondition + */ + virtual void SetByEntityCondition(std::shared_ptr byEntityCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * A condition that refers to a runtime value. + * + * @return value of model property byValueCondition + */ + virtual void SetByValueCondition(std::shared_ptr byValueCondition) = 0; + + /** + * Set a parameter for the attribute conditionEdge + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToConditionEdge(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute delay + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDelay(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute conditionEdge + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromConditionEdge() const = 0; + /** + * Get the parameter for the attribute delay + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDelay() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute conditionEdge is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsConditionEdgeParameterized() = 0; + /** + * Retrieves whether the attribute delay is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDelayParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * A condition that refers to an entity. + * + * @return a writer for model property byEntityCondition + */ + virtual std::shared_ptr GetWriterByEntityCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * A condition that refers to a runtime value. + * + * @return a writer for model property byValueCondition + */ + virtual std::shared_ptr GetWriterByValueCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ConditionGroup' + * From OpenSCENARIO class model specification: + * A condition group is an association of conditions that is assessed during simulation time and signals true when all + * associated conditions are evaluated to true. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IConditionGroupWriter : public IOpenScenarioElementWriter, public IConditionGroup + { + public: + virtual ~IConditionGroupWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A associated list of conditions. + * + * @return value of model property conditions + */ + virtual void SetConditions(std::vector>& conditions) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * A associated list of conditions. + * + * @return a list of writers for model property conditions + */ + virtual std::vector> GetWriterConditions() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ConnectTrailerAction' + * From OpenSCENARIO class model specification: + * Connect trailer to entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IConnectTrailerActionWriter : public IOpenScenarioElementWriter, public IConnectTrailerAction + { + public: + virtual ~IConnectTrailerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the trailer to connect. + * + * @return value of model property trailerRef + */ + virtual void SetTrailerRef(std::shared_ptr> trailerRef) = 0; + + /** + * Set a parameter for the attribute trailerRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrailerRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute trailerRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrailerRef() const = 0; + + /** + * Retrieves whether the attribute trailerRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrailerRefParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ControlPoint' + * From OpenSCENARIO class model specification: + * Specification of one control point of a NURBS trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControlPointWriter : public IOpenScenarioElementWriter, public IControlPoint + { + public: + virtual ~IControlPointWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Optional specification of the time dimension of the control point. Unit: [s]. Range: [0..inf[. + * + * @return value of model property time + */ + virtual void SetTime(const double time) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional weight specification of the control point. If unspecified, all control points will be equal weighted. Range: + * ]-inf..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position of the control point. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute time + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTime(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute time + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTime() const = 0; + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute time is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeParameterized() = 0; + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Position of the control point. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + /** + * Resets the optional property (IsSetTime() will return false); + */ + virtual void ResetTime() = 0; + + /** + * Resets the optional property (IsSetWeight() will return false); + */ + virtual void ResetWeight() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Controller' + * From OpenSCENARIO class model specification: + * Defines a controller type and parameters for the controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerWriter : public IOpenScenarioElementWriter, public IController, public ICatalogElementWriter + { + public: + virtual ~IControllerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines what domain the controller acts on (Default: movement) + * + * @return value of model property controllerType + */ + virtual void SetControllerType(const ControllerType controllerType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the controller type. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Properties of the controller. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute controllerType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToControllerType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute controllerType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromControllerType() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute controllerType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsControllerTypeParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Properties of the controller. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetControllerType() will return false); + */ + virtual void ResetControllerType() = 0; + + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ControllerAction' + * From OpenSCENARIO class model specification: + * Action that either assigns a new controller, overrides an existing one or activates a controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerActionWriter : public IOpenScenarioElementWriter, public IControllerAction + { + public: + virtual ~IControllerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Assign a controller to an entity. + * + * @return value of model property assignControllerAction + */ + virtual void SetAssignControllerAction(std::shared_ptr assignControllerAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Override values for throttle, brake, clutch, parking brake, steering wheel or gear. + * + * @return value of model property overrideControllerValueAction + */ + virtual void SetOverrideControllerValueAction(std::shared_ptr overrideControllerValueAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Activate/ deactivate a controller on the reference entity/entities. Replaces the deprecated element in PrivateAction in + * 1.1. + * + * @return value of model property activateControllerAction + */ + virtual void SetActivateControllerAction(std::shared_ptr activateControllerAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Assign a controller to an entity. + * + * @return a writer for model property assignControllerAction + */ + virtual std::shared_ptr GetWriterAssignControllerAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Override values for throttle, brake, clutch, parking brake, steering wheel or gear. + * + * @return a writer for model property overrideControllerValueAction + */ + virtual std::shared_ptr GetWriterOverrideControllerValueAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Activate/ deactivate a controller on the reference entity/entities. Replaces the deprecated element in PrivateAction in + * 1.1. + * + * @return a writer for model property activateControllerAction + */ + virtual std::shared_ptr GetWriterActivateControllerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ControllerCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up controller catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerCatalogLocationWriter : public IOpenScenarioElementWriter, public IControllerCatalogLocation + { + public: + virtual ~IControllerCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalog files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalog files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ControllerDistribution' + * From OpenSCENARIO class model specification: + * Defines a distribution which controller should be used in a traffic. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerDistributionWriter : public IOpenScenarioElementWriter, public IControllerDistribution + { + public: + virtual ~IControllerDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The weights of controllers of a specific type in a traffic. + * + * @return value of model property controllerDistributionEntries + */ + virtual void SetControllerDistributionEntries(std::vector>& controllerDistributionEntries) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * The weights of controllers of a specific type in a traffic. + * + * @return a list of writers for model property controllerDistributionEntries + */ + virtual std::vector> GetWriterControllerDistributionEntries() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ControllerDistributionEntry' + * From OpenSCENARIO class model specification: + * Defines that weight in a controller distribution, for the given controller type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IControllerDistributionEntryWriter : public IOpenScenarioElementWriter, public IControllerDistributionEntry + { + public: + virtual ~IControllerDistributionEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The weight of the entry. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * From OpenSCENARIO class model specification: + * The specified controller type. + * + * @return value of model property controller + */ + virtual void SetController(std::shared_ptr controller) = 0; + + /** + * From OpenSCENARIO class model specification: + * A controller type import from a catalog. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The specified controller type. + * + * @return a writer for model property controller + */ + virtual std::shared_ptr GetWriterController() const = 0; + /** + * From OpenSCENARIO class model specification: + * A controller type import from a catalog. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CustomCommandAction' + * From OpenSCENARIO class model specification: + * Used to activate a custom action native to the specific user environment. By using this action, the executability of the + * scenario will be dependent on a specific user environment. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICustomCommandActionWriter : public IOpenScenarioElementWriter, public ICustomCommandAction + { + public: + virtual ~ICustomCommandActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The command that is defined as a contract between the simulation environment provider and the author of a scenario. + * + * @return value of model property content + */ + virtual void SetContent(const std::string content) = 0; + + /** + * From OpenSCENARIO class model specification: + * Type that is defined as a contract between the simulation environment provider and the author of a scenario. + * + * @return value of model property type + */ + virtual void SetType(const std::string type) = 0; + + /** + * Set a parameter for the attribute content + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContent(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute type + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute content + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContent() const = 0; + /** + * Get the parameter for the attribute type + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromType() const = 0; + + /** + * Retrieves whether the attribute content is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContentParameterized() = 0; + /** + * Retrieves whether the attribute type is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CustomContent' + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICustomContentWriter : public IOpenScenarioElementWriter, public ICustomContent + { + public: + virtual ~ICustomContentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property content + */ + virtual void SetContent(const std::string content) = 0; + + /** + * Set a parameter for the attribute content + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContent(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute content + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContent() const = 0; + + /** + * Retrieves whether the attribute content is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContentParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeleteEntityAction' + * From OpenSCENARIO class model specification: + * Deletes an entity at runtime from the simulation (The entity reference is defined in the enclosing GlobalAction). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeleteEntityActionWriter : public IOpenScenarioElementWriter, public IDeleteEntityAction + { + public: + virtual ~IDeleteEntityActionWriter() = default; + + + + + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Deterministic' + * From OpenSCENARIO class model specification: + * Top level container containing all deterministic distribution elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicWriter : public IOpenScenarioElementWriter, public IDeterministic + { + public: + virtual ~IDeterministicWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines deterministic parameter distributions. + * + * @return value of model property deterministicParameterDistributions + */ + virtual void SetDeterministicParameterDistributions(std::vector>& deterministicParameterDistributions) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines deterministic parameter distributions. + * + * @return a list of writers for model property deterministicParameterDistributions + */ + virtual std::vector> GetWriterDeterministicParameterDistributions() const = 0; + /** + * Resets the optional property (IsSetDeterministicParameterDistributions() will return false); + */ + virtual void ResetDeterministicParameterDistributions() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeterministicMultiParameterDistribution' + * From OpenSCENARIO class model specification: + * Container for a deterministic distribution which is applied to multiple parameters. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicMultiParameterDistributionWriter : public IOpenScenarioElementWriter, public IDeterministicMultiParameterDistribution + { + public: + virtual ~IDeterministicMultiParameterDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic multi-parameter distribution. + * + * @return value of model property deterministicMultiParameterDistributionType + */ + virtual void SetDeterministicMultiParameterDistributionType(std::shared_ptr deterministicMultiParameterDistributionType) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic multi-parameter distribution. + * + * @return a writer for model property deterministicMultiParameterDistributionType + */ + virtual std::shared_ptr GetWriterDeterministicMultiParameterDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeterministicMultiParameterDistributionType' + * From OpenSCENARIO class model specification: + * A deterministic distribution type which can be applied to multiple parameters. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicMultiParameterDistributionTypeWriter : public IOpenScenarioElementWriter, public IDeterministicMultiParameterDistributionType + { + public: + virtual ~IDeterministicMultiParameterDistributionTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Deterministic multi-parameter distribution, where one or multiple sets of parameter values can be defined. + * + * @return value of model property valueSetDistribution + */ + virtual void SetValueSetDistribution(std::shared_ptr valueSetDistribution) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Deterministic multi-parameter distribution, where one or multiple sets of parameter values can be defined. + * + * @return a writer for model property valueSetDistribution + */ + virtual std::shared_ptr GetWriterValueSetDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeterministicParameterDistribution' + * From OpenSCENARIO class model specification: + * Either a DeterministicMultiParameterDistribution or a DeterministicSingleParameterDistribution + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicParameterDistributionWriter : public IOpenScenarioElementWriter, public IDeterministicParameterDistribution + { + public: + virtual ~IDeterministicParameterDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A deterministic multi-parameter distribution. + * + * @return value of model property deterministicMultiParameterDistribution + */ + virtual void SetDeterministicMultiParameterDistribution(std::shared_ptr deterministicMultiParameterDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * A deterministic single-parameter distribution. + * + * @return value of model property deterministicSingleParameterDistribution + */ + virtual void SetDeterministicSingleParameterDistribution(std::shared_ptr deterministicSingleParameterDistribution) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A deterministic multi-parameter distribution. + * + * @return a writer for model property deterministicMultiParameterDistribution + */ + virtual std::shared_ptr GetWriterDeterministicMultiParameterDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * A deterministic single-parameter distribution. + * + * @return a writer for model property deterministicSingleParameterDistribution + */ + virtual std::shared_ptr GetWriterDeterministicSingleParameterDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeterministicSingleParameterDistribution' + * From OpenSCENARIO class model specification: + * Container for a deterministic distribution which is applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicSingleParameterDistributionWriter : public IOpenScenarioElementWriter, public IDeterministicSingleParameterDistribution + { + public: + virtual ~IDeterministicSingleParameterDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the parameter name these distribution values should be applied to. + * + * @return value of model property parameterName + */ + virtual void SetParameterName(const std::string parameterName) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic single-parameter distribution. + * + * @return value of model property deterministicSingleParameterDistributionType + */ + virtual void SetDeterministicSingleParameterDistributionType(std::shared_ptr deterministicSingleParameterDistributionType) = 0; + + /** + * Set a parameter for the attribute parameterName + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToParameterName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute parameterName + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromParameterName() const = 0; + + /** + * Retrieves whether the attribute parameterName is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsParameterNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the type of the deterministic single-parameter distribution. + * + * @return a writer for model property deterministicSingleParameterDistributionType + */ + virtual std::shared_ptr GetWriterDeterministicSingleParameterDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DeterministicSingleParameterDistributionType' + * From OpenSCENARIO class model specification: + * A deterministic distribution type which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDeterministicSingleParameterDistributionTypeWriter : public IOpenScenarioElementWriter, public IDeterministicSingleParameterDistributionType + { + public: + virtual ~IDeterministicSingleParameterDistributionTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines a set of values which can be applied to a parameter. + * + * @return value of model property distributionSet + */ + virtual void SetDistributionSet(std::shared_ptr distributionSet) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a range of values which can be applied to a parameter. + * + * @return value of model property distributionRange + */ + virtual void SetDistributionRange(std::shared_ptr distributionRange) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a user defined deterministic distribution. + * + * @return value of model property userDefinedDistribution + */ + virtual void SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a set of values which can be applied to a parameter. + * + * @return a writer for model property distributionSet + */ + virtual std::shared_ptr GetWriterDistributionSet() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a range of values which can be applied to a parameter. + * + * @return a writer for model property distributionRange + */ + virtual std::shared_ptr GetWriterDistributionRange() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a user defined deterministic distribution. + * + * @return a writer for model property userDefinedDistribution + */ + virtual std::shared_ptr GetWriterUserDefinedDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Dimensions' + * From OpenSCENARIO class model specification: + * Dimensions for a three dimensional box. Width, length and height are the absolute extensions in the (y,x,z) coordinate + * system of the entity's local coordinate system. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDimensionsWriter : public IOpenScenarioElementWriter, public IDimensions + { + public: + virtual ~IDimensionsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Height of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property height + */ + virtual void SetHeight(const double height) = 0; + + /** + * From OpenSCENARIO class model specification: + * Length of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property length + */ + virtual void SetLength(const double length) = 0; + + /** + * From OpenSCENARIO class model specification: + * Width of the entity's bounding box. Unit: [m]. Range: [0..inf[. + * + * @return value of model property width + */ + virtual void SetWidth(const double width) = 0; + + /** + * Set a parameter for the attribute height + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToHeight(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute length + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLength(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute width + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWidth(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute height + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromHeight() const = 0; + /** + * Get the parameter for the attribute length + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLength() const = 0; + /** + * Get the parameter for the attribute width + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWidth() const = 0; + + /** + * Retrieves whether the attribute height is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsHeightParameterized() = 0; + /** + * Retrieves whether the attribute length is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLengthParameterized() = 0; + /** + * Retrieves whether the attribute width is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWidthParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DirectionOfTravelDistribution' + * From OpenSCENARIO class model specification: + * Defines a distribution, which direction of travel of the swarm traffic relative to the central object should be used. + * Represents the weight of a given direction of travel. The relative probability for the occurence of this direction of + * travel is defined by the weight devided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDirectionOfTravelDistributionWriter : public IOpenScenarioElementWriter, public IDirectionOfTravelDistribution + { + public: + virtual ~IDirectionOfTravelDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The weight of vehicles moving in the opposite direction as the central object. Range: [0..inf[. + * + * @return value of model property opposite + */ + virtual void SetOpposite(const double opposite) = 0; + + /** + * From OpenSCENARIO class model specification: + * The weight of vehicles moving in the same direction as the central object. Range: [0..inf[. + * + * @return value of model property same + */ + virtual void SetSame(const double same) = 0; + + /** + * Set a parameter for the attribute opposite + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOpposite(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute same + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSame(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute opposite + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOpposite() const = 0; + /** + * Get the parameter for the attribute same + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSame() const = 0; + + /** + * Retrieves whether the attribute opposite is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOppositeParameterized() = 0; + /** + * Retrieves whether the attribute same is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSameParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Directory' + * From OpenSCENARIO class model specification: + * Specifies the path to a directory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDirectoryWriter : public IOpenScenarioElementWriter, public IDirectory + { + public: + virtual ~IDirectoryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * File system path, e.g. path=/home/simulation/. + * + * @return value of model property path + */ + virtual void SetPath(const std::string path) = 0; + + /** + * Set a parameter for the attribute path + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPath(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute path + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPath() const = 0; + + /** + * Retrieves whether the attribute path is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPathParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DisconnectTrailerAction' + * From OpenSCENARIO class model specification: + * Disconnect any trailer from entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDisconnectTrailerActionWriter : public IOpenScenarioElementWriter, public IDisconnectTrailerAction + { + public: + virtual ~IDisconnectTrailerActionWriter() = default; + + + + + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DistanceCondition' + * From OpenSCENARIO class model specification: + * The current distance between an entity and a position is compared to a given distance (less, greater, equal). Several + * additional parameters like free space etc. can be defined. The property "alongRoute" is deprecated. If + * "coordinateSystem" or "relativeDistanceType" are set, "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistanceConditionWriter : public IOpenScenarioElementWriter, public IDistanceCondition + { + public: + virtual ~IDistanceConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. + * + * @return value of model property alongRoute + */ + virtual void SetAlongRoute(const bool alongRoute) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: distance is measured between closest bounding box points. False: reference point distance is used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set, "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * The distance value. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * The given position the distance is related to. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute alongRoute + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAlongRoute(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute relativeDistanceType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRelativeDistanceType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute routingAlgorithm + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoutingAlgorithm(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute alongRoute + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAlongRoute() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + /** + * Get the parameter for the attribute relativeDistanceType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRelativeDistanceType() const = 0; + /** + * Get the parameter for the attribute routingAlgorithm + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoutingAlgorithm() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute alongRoute is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAlongRouteParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + /** + * Retrieves whether the attribute relativeDistanceType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRelativeDistanceTypeParameterized() = 0; + /** + * Retrieves whether the attribute routingAlgorithm is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoutingAlgorithmParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The given position the distance is related to. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + /** + * Resets the optional property (IsSetAlongRoute() will return false); + */ + virtual void ResetAlongRoute() = 0; + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetRelativeDistanceType() will return false); + */ + virtual void ResetRelativeDistanceType() = 0; + + /** + * Resets the optional property (IsSetRoutingAlgorithm() will return false); + */ + virtual void ResetRoutingAlgorithm() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DistributionDefinition' + * From OpenSCENARIO class model specification: + * Indicates whether the content defines a deterministic or stochastic parameter distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionDefinitionWriter : public IOpenScenarioElementWriter, public IDistributionDefinition + { + public: + virtual ~IDistributionDefinitionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines a deterministic distribution for multiple parameters. + * + * @return value of model property deterministic + */ + virtual void SetDeterministic(std::shared_ptr deterministic) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a stochastic distribution for multiple parameters. + * + * @return value of model property stochastic + */ + virtual void SetStochastic(std::shared_ptr stochastic) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a deterministic distribution for multiple parameters. + * + * @return a writer for model property deterministic + */ + virtual std::shared_ptr GetWriterDeterministic() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a stochastic distribution for multiple parameters. + * + * @return a writer for model property stochastic + */ + virtual std::shared_ptr GetWriterStochastic() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DistributionRange' + * From OpenSCENARIO class model specification: + * A range of values used for a deterministic distribution. The range starts with lower limit, Each additional value is + * defined by adding the step value to the previous value until the value is greater than upper limit. Upper limit can be + * part of the range. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionRangeWriter : public IOpenScenarioElementWriter, public IDistributionRange + { + public: + virtual ~IDistributionRangeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The steps between the lower limit and upper limit. + * + * @return value of model property stepWidth + */ + virtual void SetStepWidth(const double stepWidth) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the upper limit and lower limit in range. + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + /** + * Set a parameter for the attribute stepWidth + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToStepWidth(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute stepWidth + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromStepWidth() const = 0; + + /** + * Retrieves whether the attribute stepWidth is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStepWidthParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the upper limit and lower limit in range. + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DistributionSet' + * From OpenSCENARIO class model specification: + * A set of possible values which can occur in a deterministic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionSetWriter : public IOpenScenarioElementWriter, public IDistributionSet + { + public: + virtual ~IDistributionSetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Possible values in the deterministic distribution. + * + * @return value of model property elements + */ + virtual void SetElements(std::vector>& elements) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Possible values in the deterministic distribution. + * + * @return a list of writers for model property elements + */ + virtual std::vector> GetWriterElements() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DistributionSetElement' + * From OpenSCENARIO class model specification: + * Indicates an element for a deterministic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDistributionSetElementWriter : public IOpenScenarioElementWriter, public IDistributionSetElement + { + public: + virtual ~IDistributionSetElementWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A possible value in a deterministic distribution. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DomeImage' + * From OpenSCENARIO class model specification: + * Image reference to represent the sky and optionally the lighting if the image also contains lighting information. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDomeImageWriter : public IOpenScenarioElementWriter, public IDomeImage + { + public: + virtual ~IDomeImageWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Offset to north / y-axis of world coordinate system (counter-clockwise). Unit: [rad]. Range: [0..2*PI]. 0 means the left + * and right borders of the image are aligned with the y-axis of the world coordinate system. Default if omitted: 0. + * + * @return value of model property azimuthOffset + */ + virtual void SetAzimuthOffset(const double azimuthOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Filepath to the dome file. + * + * @return value of model property domeFile + */ + virtual void SetDomeFile(std::shared_ptr domeFile) = 0; + + /** + * Set a parameter for the attribute azimuthOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAzimuthOffset(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute azimuthOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAzimuthOffset() const = 0; + + /** + * Retrieves whether the attribute azimuthOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAzimuthOffsetParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Filepath to the dome file. + * + * @return a writer for model property domeFile + */ + virtual std::shared_ptr GetWriterDomeFile() const = 0; + + /** + * Resets the optional property (IsSetAzimuthOffset() will return false); + */ + virtual void ResetAzimuthOffset() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'DynamicConstraints' + * From OpenSCENARIO class model specification: + * Constraints that are limiting the acceleration, the deceleration and the speed. Used in lateral or longitudinal actions. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IDynamicConstraintsWriter : public IOpenScenarioElementWriter, public IDynamicConstraints + { + public: + virtual ~IDynamicConstraintsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration the distance controller is allowed to use for keeping the distance. Missing value is interpreted as + * 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxAcceleration + */ + virtual void SetMaxAcceleration(const double maxAcceleration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration rate the distance controller is allowed to use for keeping the distance. Missing value is + * interpreted as 'inf'. Unit: [m/s³]. Range: [0..inf[. + * + * @return value of model property maxAccelerationRate + */ + virtual void SetMaxAccelerationRate(const double maxAccelerationRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration the distance controller is allowed to use for keeping the distance. Missing value is interpreted as + * 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxDeceleration + */ + virtual void SetMaxDeceleration(const double maxDeceleration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration rate the distance controller is allowed to use for keeping the distance. Missing value is + * interpreted as 'inf'. Unit: [m/s³]. Range: [0..inf[. + * + * @return value of model property maxDecelerationRate + */ + virtual void SetMaxDecelerationRate(const double maxDecelerationRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum speed the distance controller is allowed to use for keeping the distance. Missing value is interpreted as 'inf'. + * Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property maxSpeed + */ + virtual void SetMaxSpeed(const double maxSpeed) = 0; + + /** + * Set a parameter for the attribute maxAcceleration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxAcceleration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxAccelerationRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxAccelerationRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxDeceleration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxDeceleration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxDecelerationRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxDecelerationRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxSpeed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxSpeed(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maxAcceleration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxAcceleration() const = 0; + /** + * Get the parameter for the attribute maxAccelerationRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxAccelerationRate() const = 0; + /** + * Get the parameter for the attribute maxDeceleration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxDeceleration() const = 0; + /** + * Get the parameter for the attribute maxDecelerationRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxDecelerationRate() const = 0; + /** + * Get the parameter for the attribute maxSpeed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxSpeed() const = 0; + + /** + * Retrieves whether the attribute maxAcceleration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxAccelerationParameterized() = 0; + /** + * Retrieves whether the attribute maxAccelerationRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxAccelerationRateParameterized() = 0; + /** + * Retrieves whether the attribute maxDeceleration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxDecelerationParameterized() = 0; + /** + * Retrieves whether the attribute maxDecelerationRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxDecelerationRateParameterized() = 0; + /** + * Retrieves whether the attribute maxSpeed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxSpeedParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxAcceleration() will return false); + */ + virtual void ResetMaxAcceleration() = 0; + + /** + * Resets the optional property (IsSetMaxAccelerationRate() will return false); + */ + virtual void ResetMaxAccelerationRate() = 0; + + /** + * Resets the optional property (IsSetMaxDeceleration() will return false); + */ + virtual void ResetMaxDeceleration() = 0; + + /** + * Resets the optional property (IsSetMaxDecelerationRate() will return false); + */ + virtual void ResetMaxDecelerationRate() = 0; + + /** + * Resets the optional property (IsSetMaxSpeed() will return false); + */ + virtual void ResetMaxSpeed() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EndOfRoadCondition' + * From OpenSCENARIO class model specification: + * Condition becomes true after the triggering entity/entities has reached the end of a road network for a given amount of + * time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEndOfRoadConditionWriter : public IOpenScenarioElementWriter, public IEndOfRoadCondition + { + public: + virtual ~IEndOfRoadConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Amount of time at end of road. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual void SetDuration(const double duration) = 0; + + /** + * Set a parameter for the attribute duration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDuration(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute duration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDuration() const = 0; + + /** + * Retrieves whether the attribute duration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDurationParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Entities' + * From OpenSCENARIO class model specification: + * Definition of entities (scenario objects or entity selections) in a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntitiesWriter : public IOpenScenarioElementWriter, public IEntities + { + public: + virtual ~IEntitiesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A list of scenario object definitions that pairs an entity object and a controller. + * + * @return value of model property scenarioObjects + */ + virtual void SetScenarioObjects(std::vector>& scenarioObjects) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of entity selection definitions. + * + * @return value of model property entitySelections + */ + virtual void SetEntitySelections(std::vector>& entitySelections) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * A list of scenario object definitions that pairs an entity object and a controller. + * + * @return a list of writers for model property scenarioObjects + */ + virtual std::vector> GetWriterScenarioObjects() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of entity selection definitions. + * + * @return a list of writers for model property entitySelections + */ + virtual std::vector> GetWriterEntitySelections() const = 0; + /** + * Resets the optional property (IsSetScenarioObjects() will return false); + */ + virtual void ResetScenarioObjects() = 0; + + /** + * Resets the optional property (IsSetEntitySelections() will return false); + */ + virtual void ResetEntitySelections() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityAction' + * From OpenSCENARIO class model specification: + * Defines an action that adds or deletes a referred entity. +Entities to be added or deleted must be defined in the + * Entities section. +An entity can only exist in one copy. Adding an already active entity will have no effect, neither + * will deleting an already inactive entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityActionWriter : public IOpenScenarioElementWriter, public IEntityAction + { + public: + virtual ~IEntityActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Action that adds the reference entity to the scenario. + * + * @return value of model property addEntityAction + */ + virtual void SetAddEntityAction(std::shared_ptr addEntityAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Action that deletes the reference entity from the scenario. + * + * @return value of model property deleteEntityAction + */ + virtual void SetDeleteEntityAction(std::shared_ptr deleteEntityAction) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Action that adds the reference entity to the scenario. + * + * @return a writer for model property addEntityAction + */ + virtual std::shared_ptr GetWriterAddEntityAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Action that deletes the reference entity from the scenario. + * + * @return a writer for model property deleteEntityAction + */ + virtual std::shared_ptr GetWriterDeleteEntityAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityCondition' + * From OpenSCENARIO class model specification: + * Defines a specific condition on an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityConditionWriter : public IOpenScenarioElementWriter, public IEntityCondition + { + public: + virtual ~IEntityConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has reached the end of the road. + * + * @return value of model property endOfRoadCondition + */ + virtual void SetEndOfRoadCondition(std::shared_ptr endOfRoadCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity was involved in a collision. + * + * @return value of model property collisionCondition + */ + virtual void SetCollisionCondition(std::shared_ptr collisionCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has left the road. + * + * @return value of model property offroadCondition + */ + virtual void SetOffroadCondition(std::shared_ptr offroadCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the time headway between two entities. + * + * @return value of model property timeHeadwayCondition + */ + virtual void SetTimeHeadwayCondition(std::shared_ptr timeHeadwayCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the time to collision between two entities. + * + * @return value of model property timeToCollisionCondition + */ + virtual void SetTimeToCollisionCondition(std::shared_ptr timeToCollisionCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the current acceleration of an entity. + * + * @return value of model property accelerationCondition + */ + virtual void SetAccelerationCondition(std::shared_ptr accelerationCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has not moved. + * + * @return value of model property standStillCondition + */ + virtual void SetStandStillCondition(std::shared_ptr standStillCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the current speed of the referenced entities. + * + * @return value of model property speedCondition + */ + virtual void SetSpeedCondition(std::shared_ptr speedCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative speed between two entity. + * + * @return value of model property relativeSpeedCondition + */ + virtual void SetRelativeSpeedCondition(std::shared_ptr relativeSpeedCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the total traveled distance of the reference entity since the start of the scenario. + * + * @return value of model property traveledDistanceCondition + */ + virtual void SetTraveledDistanceCondition(std::shared_ptr traveledDistanceCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity has reached a given position within a given uncertainty. + * + * @return value of model property reachPositionCondition + */ + virtual void SetReachPositionCondition(std::shared_ptr reachPositionCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the distance between two entities or an entity and a position. + * + * @return value of model property distanceCondition + */ + virtual void SetDistanceCondition(std::shared_ptr distanceCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative distance between two entities. + * + * @return value of model property relativeDistanceCondition + */ + virtual void SetRelativeDistanceCondition(std::shared_ptr relativeDistanceCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative clearance of an entity. + * + * @return value of model property relativeClearanceCondition + */ + virtual void SetRelativeClearanceCondition(std::shared_ptr relativeClearanceCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity. + * + * @return value of model property angleCondition + */ + virtual void SetAngleCondition(std::shared_ptr angleCondition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity relative to a reference entity. + * + * @return value of model property relativeAngleCondition + */ + virtual void SetRelativeAngleCondition(std::shared_ptr relativeAngleCondition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has reached the end of the road. + * + * @return a writer for model property endOfRoadCondition + */ + virtual std::shared_ptr GetWriterEndOfRoadCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity was involved in a collision. + * + * @return a writer for model property collisionCondition + */ + virtual std::shared_ptr GetWriterCollisionCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has left the road. + * + * @return a writer for model property offroadCondition + */ + virtual std::shared_ptr GetWriterOffroadCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the time headway between two entities. + * + * @return a writer for model property timeHeadwayCondition + */ + virtual std::shared_ptr GetWriterTimeHeadwayCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the time to collision between two entities. + * + * @return a writer for model property timeToCollisionCondition + */ + virtual std::shared_ptr GetWriterTimeToCollisionCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the current acceleration of an entity. + * + * @return a writer for model property accelerationCondition + */ + virtual std::shared_ptr GetWriterAccelerationCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking for how long the reference entity has not moved. + * + * @return a writer for model property standStillCondition + */ + virtual std::shared_ptr GetWriterStandStillCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the current speed of the referenced entities. + * + * @return a writer for model property speedCondition + */ + virtual std::shared_ptr GetWriterSpeedCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative speed between two entity. + * + * @return a writer for model property relativeSpeedCondition + */ + virtual std::shared_ptr GetWriterRelativeSpeedCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the total traveled distance of the reference entity since the start of the scenario. + * + * @return a writer for model property traveledDistanceCondition + */ + virtual std::shared_ptr GetWriterTraveledDistanceCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking whether the reference entity has reached a given position within a given uncertainty. + * + * @return a writer for model property reachPositionCondition + */ + virtual std::shared_ptr GetWriterReachPositionCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the distance between two entities or an entity and a position. + * + * @return a writer for model property distanceCondition + */ + virtual std::shared_ptr GetWriterDistanceCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative distance between two entities. + * + * @return a writer for model property relativeDistanceCondition + */ + virtual std::shared_ptr GetWriterRelativeDistanceCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the relative clearance of an entity. + * + * @return a writer for model property relativeClearanceCondition + */ + virtual std::shared_ptr GetWriterRelativeClearanceCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity. + * + * @return a writer for model property angleCondition + */ + virtual std::shared_ptr GetWriterAngleCondition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Condition checking the angle of an entity relative to a reference entity. + * + * @return a writer for model property relativeAngleCondition + */ + virtual std::shared_ptr GetWriterRelativeAngleCondition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityDistribution' + * From OpenSCENARIO class model specification: + * An entity group within a traffic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityDistributionWriter : public IOpenScenarioElementWriter, public IEntityDistribution + { + public: + virtual ~IEntityDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted specific vehicle/pedestrian entity profiles as part of an entity group. + * + * @return value of model property entityDistributionEntry + */ + virtual void SetEntityDistributionEntry(std::vector>& entityDistributionEntry) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted specific vehicle/pedestrian entity profiles as part of an entity group. + * + * @return a list of writers for model property entityDistributionEntry + */ + virtual std::vector> GetWriterEntityDistributionEntry() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityDistributionEntry' + * From OpenSCENARIO class model specification: + * Defines one weighted specific vehicle/pedestrian entity profile as part of an entity group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityDistributionEntryWriter : public IOpenScenarioElementWriter, public IEntityDistributionEntry + { + public: + virtual ~IEntityDistributionEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The weight of this entity profile within the entity group. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * From OpenSCENARIO class model specification: + * The entity profile that shall appear in the entity group. + * + * @return value of model property scenarioObjectTemplate + */ + virtual void SetScenarioObjectTemplate(std::shared_ptr scenarioObjectTemplate) = 0; + + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The entity profile that shall appear in the entity group. + * + * @return a writer for model property scenarioObjectTemplate + */ + virtual std::shared_ptr GetWriterScenarioObjectTemplate() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityObject' + * From OpenSCENARIO class model specification: + * A vehicle type, pedestrian type or miscellaneous object type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityObjectWriter : public IOpenScenarioElementWriter, public IEntityObject + { + public: + virtual ~IEntityObjectWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type MiscObject, Vehicle or Pedestrian. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + /** + * From OpenSCENARIO class model specification: + * Vehicle definition. + * + * @return value of model property vehicle + */ + virtual void SetVehicle(std::shared_ptr vehicle) = 0; + + /** + * From OpenSCENARIO class model specification: + * Pedestrian definition. + * + * @return value of model property pedestrian + */ + virtual void SetPedestrian(std::shared_ptr pedestrian) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of a MiscObject. + * + * @return value of model property miscObject + */ + virtual void SetMiscObject(std::shared_ptr miscObject) = 0; + + /** + * From OpenSCENARIO class model specification: + * An reference to an external object that is defined outside of a scenario or catalog (e.g. in the road network) + * + * @return value of model property externalObjectReference + */ + virtual void SetExternalObjectReference(std::shared_ptr externalObjectReference) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type MiscObject, Vehicle or Pedestrian. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + /** + * From OpenSCENARIO class model specification: + * Vehicle definition. + * + * @return a writer for model property vehicle + */ + virtual std::shared_ptr GetWriterVehicle() const = 0; + /** + * From OpenSCENARIO class model specification: + * Pedestrian definition. + * + * @return a writer for model property pedestrian + */ + virtual std::shared_ptr GetWriterPedestrian() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of a MiscObject. + * + * @return a writer for model property miscObject + */ + virtual std::shared_ptr GetWriterMiscObject() const = 0; + /** + * From OpenSCENARIO class model specification: + * An reference to an external object that is defined outside of a scenario or catalog (e.g. in the road network) + * + * @return a writer for model property externalObjectReference + */ + virtual std::shared_ptr GetWriterExternalObjectReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntityRef' + * From OpenSCENARIO class model specification: + * Unambiguous reference to an entity represented as its name. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityRefWriter : public IOpenScenarioElementWriter, public IEntityRef + { + public: + virtual ~IEntityRefWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EntitySelection' + * From OpenSCENARIO class model specification: + * Grouping of scenario objects by name and/or type. An instance of EntitySelection is considered also an instance of + * Entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntitySelectionWriter : public IOpenScenarioElementWriter, public IEntitySelection, public IEntityWriter + { + public: + virtual ~IEntitySelectionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the entity selection. By this name, a selection can be referenced as an entity. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Selected entities as members of the entity selection. + * + * @return value of model property members + */ + virtual void SetMembers(std::shared_ptr members) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Selected entities as members of the entity selection. + * + * @return a writer for model property members + */ + virtual std::shared_ptr GetWriterMembers() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Environment' + * From OpenSCENARIO class model specification: + * Defines the environment conditions of a scenario, e.g. time of day, weather and road condition. If one of the conditions + * is missing it means that it doesn't change. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironmentWriter : public IOpenScenarioElementWriter, public IEnvironment, public ICatalogElementWriter + { + public: + virtual ~IEnvironmentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the environment. If used in catalog name is required. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Time of the day during the simulation. + * + * @return value of model property timeOfDay + */ + virtual void SetTimeOfDay(std::shared_ptr timeOfDay) = 0; + + /** + * From OpenSCENARIO class model specification: + * Weather conditions during the simulation. + * + * @return value of model property weather + */ + virtual void SetWeather(std::shared_ptr weather) = 0; + + /** + * From OpenSCENARIO class model specification: + * Road conditions during the simulation. + * + * @return value of model property roadCondition + */ + virtual void SetRoadCondition(std::shared_ptr roadCondition) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Time of the day during the simulation. + * + * @return a writer for model property timeOfDay + */ + virtual std::shared_ptr GetWriterTimeOfDay() const = 0; + /** + * From OpenSCENARIO class model specification: + * Weather conditions during the simulation. + * + * @return a writer for model property weather + */ + virtual std::shared_ptr GetWriterWeather() const = 0; + /** + * From OpenSCENARIO class model specification: + * Road conditions during the simulation. + * + * @return a writer for model property roadCondition + */ + virtual std::shared_ptr GetWriterRoadCondition() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetTimeOfDay() will return false); + */ + virtual void ResetTimeOfDay() = 0; + + /** + * Resets the optional property (IsSetWeather() will return false); + */ + virtual void ResetWeather() = 0; + + /** + * Resets the optional property (IsSetRoadCondition() will return false); + */ + virtual void ResetRoadCondition() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EnvironmentAction' + * From OpenSCENARIO class model specification: + * Setting weather state, road conditions, and time of the day. An environment can be defined or an environment type from a + * catalog can be used to instantiate an environment. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironmentActionWriter : public IOpenScenarioElementWriter, public IEnvironmentAction + { + public: + virtual ~IEnvironmentActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * New environment definition. + * + * @return value of model property environment + */ + virtual void SetEnvironment(std::shared_ptr environment) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type Environment. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * New environment definition. + * + * @return a writer for model property environment + */ + virtual std::shared_ptr GetWriterEnvironment() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference to a catalog entry of type Environment. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'EnvironmentCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up environment catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEnvironmentCatalogLocationWriter : public IOpenScenarioElementWriter, public IEnvironmentCatalogLocation + { + public: + virtual ~IEnvironmentCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Event' + * From OpenSCENARIO class model specification: + * Container for Actions. Its priority settings determine how to interact with other events within the same scope + * (maneuver). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEventWriter : public IOpenScenarioElementWriter, public IEvent, public IStoryboardElementWriter + { + public: + virtual ~IEventWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Maximum number of executions. Default value is 1. Range: [1..inf[. + * + * @return value of model property maximumExecutionCount + */ + virtual void SetMaximumExecutionCount(const uint32_t maximumExecutionCount) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the event. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Priority of each event. + * + * @return value of model property priority + */ + virtual void SetPriority(const Priority priority) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of actions in an event. + * + * @return value of model property actions + */ + virtual void SetActions(std::vector>& actions) = 0; + + /** + * From OpenSCENARIO class model specification: + * Actions are executed as soon as the start trigger fires. This point in time represents the start of the event. If this + * optional field is missing, the event starts as soon as the start trigger of the enclosing act starts. + * + * @return value of model property startTrigger + */ + virtual void SetStartTrigger(std::shared_ptr startTrigger) = 0; + + /** + * Set a parameter for the attribute maximumExecutionCount + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaximumExecutionCount(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute priority + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPriority(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maximumExecutionCount + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaximumExecutionCount() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute priority + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPriority() const = 0; + + /** + * Retrieves whether the attribute maximumExecutionCount is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaximumExecutionCountParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute priority is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPriorityParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Actions are executed as soon as the start trigger fires. This point in time represents the start of the event. If this + * optional field is missing, the event starts as soon as the start trigger of the enclosing act starts. + * + * @return a writer for model property startTrigger + */ + virtual std::shared_ptr GetWriterStartTrigger() const = 0; + + /** + * From OpenSCENARIO class model specification: + * List of actions in an event. + * + * @return a list of writers for model property actions + */ + virtual std::vector> GetWriterActions() const = 0; + /** + * Resets the optional property (IsSetMaximumExecutionCount() will return false); + */ + virtual void ResetMaximumExecutionCount() = 0; + + /** + * Resets the optional property (IsSetStartTrigger() will return false); + */ + virtual void ResetStartTrigger() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ExternalObjectReference' + * From OpenSCENARIO class model specification: + * Reference to an external object that is defined beyond OpenSCENARIO files and catalogs, i.e. in the road network (= + * road object or traffic signal). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IExternalObjectReferenceWriter : public IOpenScenarioElementWriter, public IExternalObjectReference + { + public: + virtual ~IExternalObjectReferenceWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Unique identifier of the referenced external object in the road network. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'File' + * From OpenSCENARIO class model specification: + * File on the file system, including its file path. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFileWriter : public IOpenScenarioElementWriter, public IFile + { + public: + virtual ~IFileWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Filepath e.g. filepath=/home/simulator/customDriverSpecification.xml. + * + * @return value of model property filepath + */ + virtual void SetFilepath(const std::string filepath) = 0; + + /** + * Set a parameter for the attribute filepath + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFilepath(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute filepath + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFilepath() const = 0; + + /** + * Retrieves whether the attribute filepath is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFilepathParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'FileHeader' + * From OpenSCENARIO class model specification: + * File header used in OpenSCENARIO files, e.g. scenario file or catalog files. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFileHeaderWriter : public IOpenScenarioElementWriter, public IFileHeader + { + public: + virtual ~IFileHeaderWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Author of the scenario or the catalog. + * + * @return value of model property author + */ + virtual void SetAuthor(const std::string author) = 0; + + /** + * From OpenSCENARIO class model specification: + * User specific date and time recommended: YYYY-MM-DDThh:mm:ss. + * + * @return value of model property date + */ + virtual void SetDate(const DateTime date) = 0; + + /** + * From OpenSCENARIO class model specification: + * User specific description. + * + * @return value of model property description + */ + virtual void SetDescription(const std::string description) = 0; + + /** + * From OpenSCENARIO class model specification: + * Major OpenSCENARIO revision, this file conforms to Range: [0..inf[. + * + * @return value of model property revMajor + */ + virtual void SetRevMajor(const uint16_t revMajor) = 0; + + /** + * From OpenSCENARIO class model specification: + * Minor OpenSCENARIO revision, this file conforms to Range: [0..inf[. + * + * @return value of model property revMinor + */ + virtual void SetRevMinor(const uint16_t revMinor) = 0; + + /** + * From OpenSCENARIO class model specification: + * Licensing information. + * + * @return value of model property license + */ + virtual void SetLicense(std::shared_ptr license) = 0; + + /** + * From OpenSCENARIO class model specification: + * Additional custom information about the scenario. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute author + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAuthor(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute date + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute description + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDescription(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute revMajor + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRevMajor(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute revMinor + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRevMinor(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute author + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAuthor() const = 0; + /** + * Get the parameter for the attribute date + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDate() const = 0; + /** + * Get the parameter for the attribute description + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDescription() const = 0; + /** + * Get the parameter for the attribute revMajor + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRevMajor() const = 0; + /** + * Get the parameter for the attribute revMinor + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRevMinor() const = 0; + + /** + * Retrieves whether the attribute author is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAuthorParameterized() = 0; + /** + * Retrieves whether the attribute date is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDateParameterized() = 0; + /** + * Retrieves whether the attribute description is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDescriptionParameterized() = 0; + /** + * Retrieves whether the attribute revMajor is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRevMajorParameterized() = 0; + /** + * Retrieves whether the attribute revMinor is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRevMinorParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Licensing information. + * + * @return a writer for model property license + */ + virtual std::shared_ptr GetWriterLicense() const = 0; + /** + * From OpenSCENARIO class model specification: + * Additional custom information about the scenario. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * Resets the optional property (IsSetLicense() will return false); + */ + virtual void ResetLicense() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'FinalSpeed' + * From OpenSCENARIO class model specification: + * Final speed definition for a SynchronizeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFinalSpeedWriter : public IOpenScenarioElementWriter, public IFinalSpeed + { + public: + virtual ~IFinalSpeedWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The absolute speed a synchronized entity should have at its target position. + * + * @return value of model property absoluteSpeed + */ + virtual void SetAbsoluteSpeed(std::shared_ptr absoluteSpeed) = 0; + + /** + * From OpenSCENARIO class model specification: + * The speed a synchronized entity should have relative to its master entity at its target position. + * + * @return value of model property relativeSpeedToMaster + */ + virtual void SetRelativeSpeedToMaster(std::shared_ptr relativeSpeedToMaster) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The absolute speed a synchronized entity should have at its target position. + * + * @return a writer for model property absoluteSpeed + */ + virtual std::shared_ptr GetWriterAbsoluteSpeed() const = 0; + /** + * From OpenSCENARIO class model specification: + * The speed a synchronized entity should have relative to its master entity at its target position. + * + * @return a writer for model property relativeSpeedToMaster + */ + virtual std::shared_ptr GetWriterRelativeSpeedToMaster() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Fog' + * From OpenSCENARIO class model specification: + * Defines fog at simulation runtime. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFogWriter : public IOpenScenarioElementWriter, public IFog + { + public: + virtual ~IFogWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Unit: [m]. Range: [0..inf[. + * + * @return value of model property visualRange + */ + virtual void SetVisualRange(const double visualRange) = 0; + + /** + * From OpenSCENARIO class model specification: + * Dimensions and center of fog in fixed coordinates. + * + * @return value of model property boundingBox + */ + virtual void SetBoundingBox(std::shared_ptr boundingBox) = 0; + + /** + * Set a parameter for the attribute visualRange + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVisualRange(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute visualRange + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVisualRange() const = 0; + + /** + * Retrieves whether the attribute visualRange is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVisualRangeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Dimensions and center of fog in fixed coordinates. + * + * @return a writer for model property boundingBox + */ + virtual std::shared_ptr GetWriterBoundingBox() const = 0; + + /** + * Resets the optional property (IsSetBoundingBox() will return false); + */ + virtual void ResetBoundingBox() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'FollowTrajectoryAction' + * From OpenSCENARIO class model specification: + * Controls an entity to follow a trajectory using vertices, timings (optionally) and a corresponding interpolation + * strategy. The trajectory can be instantiated from a catalog type, or defined within this declaration. Use trajectoryRef + * to define a trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IFollowTrajectoryActionWriter : public IOpenScenarioElementWriter, public IFollowTrajectoryAction, public IMotionControlActionWriter + { + public: + virtual ~IFollowTrajectoryActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * An offset into the trajectory. This has the effect of logically truncating the trajectory, so the resulting new + * trajectory starts at that distance offset. Where a timing TimeReference fields is provided, the time that would be + * taken to reach this point is deducted from all calculated waypoint time values. Unit: [m]. Range: [0..arclength of the + * trajectory]. + * + * @return value of model property initialDistanceOffset + */ + virtual void SetInitialDistanceOffset(const double initialDistanceOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Trajectory definition. Must not be used when catalogReference or trajectoryRef is set. + * + * @return value of model property trajectory + */ + virtual void SetTrajectory(std::shared_ptr trajectory) = 0; + + /** + * From OpenSCENARIO class model specification: + * A reference to the trajectory type in a catalog. Must not be used when trajectory or trajectoryRef is set. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines if time information provided within the trajectory should be considered. If so, it may be used as either + * absolute or relative time along the trajectory in order to define longitudinal velocity of the actor. Moreover, a time + * offset or time scaling may be applied. + * + * @return value of model property timeReference + */ + virtual void SetTimeReference(std::shared_ptr timeReference) = 0; + + /** + * From OpenSCENARIO class model specification: + * The mode how to follow the given trajectory. + * + * @return value of model property trajectoryFollowingMode + */ + virtual void SetTrajectoryFollowingMode(std::shared_ptr trajectoryFollowingMode) = 0; + + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory to be followed. + * + * @return value of model property trajectoryRef + */ + virtual void SetTrajectoryRef(std::shared_ptr trajectoryRef) = 0; + + /** + * Set a parameter for the attribute initialDistanceOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToInitialDistanceOffset(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute initialDistanceOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromInitialDistanceOffset() const = 0; + + /** + * Retrieves whether the attribute initialDistanceOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsInitialDistanceOffsetParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Trajectory definition. Must not be used when catalogReference or trajectoryRef is set. + * + * @return a writer for model property trajectory + */ + virtual std::shared_ptr GetWriterTrajectory() const = 0; + /** + * From OpenSCENARIO class model specification: + * A reference to the trajectory type in a catalog. Must not be used when trajectory or trajectoryRef is set. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines if time information provided within the trajectory should be considered. If so, it may be used as either + * absolute or relative time along the trajectory in order to define longitudinal velocity of the actor. Moreover, a time + * offset or time scaling may be applied. + * + * @return a writer for model property timeReference + */ + virtual std::shared_ptr GetWriterTimeReference() const = 0; + /** + * From OpenSCENARIO class model specification: + * The mode how to follow the given trajectory. + * + * @return a writer for model property trajectoryFollowingMode + */ + virtual std::shared_ptr GetWriterTrajectoryFollowingMode() const = 0; + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory to be followed. + * + * @return a writer for model property trajectoryRef + */ + virtual std::shared_ptr GetWriterTrajectoryRef() const = 0; + + /** + * Resets the optional property (IsSetInitialDistanceOffset() will return false); + */ + virtual void ResetInitialDistanceOffset() = 0; + + /** + * Resets the optional property (IsSetTrajectory() will return false); + */ + virtual void ResetTrajectory() = 0; + + /** + * Resets the optional property (IsSetCatalogReference() will return false); + */ + virtual void ResetCatalogReference() = 0; + + /** + * Resets the optional property (IsSetTrajectoryRef() will return false); + */ + virtual void ResetTrajectoryRef() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Gear' + * From OpenSCENARIO class model specification: + * Gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGearWriter : public IOpenScenarioElementWriter, public IGear + { + public: + virtual ~IGearWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Manual gear description. + * + * @return value of model property manualGear + */ + virtual void SetManualGear(std::shared_ptr manualGear) = 0; + + /** + * From OpenSCENARIO class model specification: + * Automatic gear description. + * + * @return value of model property automaticGear + */ + virtual void SetAutomaticGear(std::shared_ptr automaticGear) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Manual gear description. + * + * @return a writer for model property manualGear + */ + virtual std::shared_ptr GetWriterManualGear() const = 0; + /** + * From OpenSCENARIO class model specification: + * Automatic gear description. + * + * @return a writer for model property automaticGear + */ + virtual std::shared_ptr GetWriterAutomaticGear() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'GeoPosition' + * From OpenSCENARIO class model specification: + * Position defined in terms of the spherical geographic coordinates (angular Longitude and Latitude) derived from the + * geodetic datum specified in the respective road network definition file (external to the ASAM OpenSCENARIO). Optionally, + * the orientation of the position can be specified. +In the general case, the altitude of the target position above a + * conventional reference level (e.g., the mean sea level on the Earth) is determined by the surface of the underlying + * road, which is derived from the Longitude/Latitude-coordinates of the position. However, optionally, the altitude of the + * target position with respect to the road surface can be specified. +The orientation of the road in the inertial + * (X,Y,Z)-coordinate system, in turn, is specified in the respective road network definition file too. +The transformation + * of angular geographic coordinates into the flat (X,Y)-projection in the World coordinate system is entrusted to a + * simulation environment. However, if the target position would be outside the road boundaries, the Z-coordinate of the + * position is undefined by the OpenSCENARIO standard. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGeoPositionWriter : public IOpenScenarioElementWriter, public IGeoPosition + { + public: + virtual ~IGeoPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Altitude is the Earth gravity-related vertical distance along the z-axis above the road surface, specified horizontally + * by its Longitude/Latitude coordinates and vertically by the verticalRoadSelection attribute. When calculating the road + * surface, it is accounted for an elevation of the road, an entire road super-elevation, or, in more complex cases, a road + * lateral shape profile that are specified in the road network definition (external to the OpenSCENARIO). Missing value is + * interpreted as altitude=0. Unit: [m]. Range: [0..inf[. + * + * @return value of model property altitude + */ + virtual void SetAltitude(const double altitude) = 0; + + /** + * From OpenSCENARIO class model specification: + * Height above a reference surface (e.g. sea level, earth surface). Unit: [m]. If the value is omitted, height is + * interpreted as 0. + * + * @return value of model property height + */ + virtual void SetHeight(const double height) = 0; + + /** + * From OpenSCENARIO class model specification: + * The latitude of a point on earth's surface is the angle between the equatorial plane and the straight line that passes + * through that point and through the center of the earth. Unit: [rad]. Range: [-PI..PI]. + * + * @return value of model property latitude + */ + virtual void SetLatitude(const double latitude) = 0; + + /** + * From OpenSCENARIO class model specification: + * The latitude of a point on earth's surface is the angle between the equatorial plane and the straight line that passes + * through that point and through the center of the earth. Unit: [°]. Range: [-90..90]. Missing value is interpreted + * as 0. + * + * @return value of model property latitudeDeg + */ + virtual void SetLatitudeDeg(const double latitudeDeg) = 0; + + /** + * From OpenSCENARIO class model specification: + * The longitude of a point on earth's surface is the angle east or west of a reference meridian to another meridian that + * passes through that point. Unit: [rad]. Range: [-PI/2..PI/2]. + * + * @return value of model property longitude + */ + virtual void SetLongitude(const double longitude) = 0; + + /** + * From OpenSCENARIO class model specification: + * The longitude of a point on earth's surface is the angle east or west of a reference meridian to another meridian that + * passes through that point. Unit: [°]. Range: [-180..180]. Missing value is interpreted as 0. + * + * @return value of model property longitudeDeg + */ + virtual void SetLongitudeDeg(const double longitudeDeg) = 0; + + /** + * From OpenSCENARIO class model specification: + * Selection of a road for determining the correct z-value of the position if multiple roads are located at the specified + * lat/lon coordinate. Value 0 is interpreted as the top-most road. The value decreases by one for every road below. If + * several roads are located on the same z-value (e.g. junctions), they are treated interchangeably with the same value + * (e.g. junction at top with two roads = value 0, next road below has value -1). Default if omitted: 0. Range: ]-inf, 0]. + * + * @return value of model property verticalRoadSelection + */ + virtual void SetVerticalRoadSelection(const int verticalRoadSelection) = 0; + + /** + * From OpenSCENARIO class model specification: + * In the case of altitude=0, the Pitch and Roll angles are determined by the underlying road surface at the target + * position and therefore undefined by the OpenSCENARIO standard. +The absolute reference context refers to the orientation + * with respect to the World coordinate system, which is assumed to be the projected coordinate system based on the + * spherical geographic coordinate system. +The relative reference context refers to the orientation with respect to the + * reference (s,t)-coordinate system of the lane on the road underlying the target position. The Heading angle at the + * target position on the (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis + * at the target position is built parallel to the tangent to the reference lane s-axis on the reference road. The Heading + * is counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute altitude + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAltitude(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute height + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToHeight(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute latitude + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLatitude(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute latitudeDeg + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLatitudeDeg(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute longitude + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLongitude(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute longitudeDeg + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLongitudeDeg(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute verticalRoadSelection + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVerticalRoadSelection(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute altitude + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAltitude() const = 0; + /** + * Get the parameter for the attribute height + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromHeight() const = 0; + /** + * Get the parameter for the attribute latitude + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLatitude() const = 0; + /** + * Get the parameter for the attribute latitudeDeg + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLatitudeDeg() const = 0; + /** + * Get the parameter for the attribute longitude + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLongitude() const = 0; + /** + * Get the parameter for the attribute longitudeDeg + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLongitudeDeg() const = 0; + /** + * Get the parameter for the attribute verticalRoadSelection + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVerticalRoadSelection() const = 0; + + /** + * Retrieves whether the attribute altitude is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAltitudeParameterized() = 0; + /** + * Retrieves whether the attribute height is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsHeightParameterized() = 0; + /** + * Retrieves whether the attribute latitude is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLatitudeParameterized() = 0; + /** + * Retrieves whether the attribute latitudeDeg is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLatitudeDegParameterized() = 0; + /** + * Retrieves whether the attribute longitude is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLongitudeParameterized() = 0; + /** + * Retrieves whether the attribute longitudeDeg is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLongitudeDegParameterized() = 0; + /** + * Retrieves whether the attribute verticalRoadSelection is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVerticalRoadSelectionParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * In the case of altitude=0, the Pitch and Roll angles are determined by the underlying road surface at the target + * position and therefore undefined by the OpenSCENARIO standard. +The absolute reference context refers to the orientation + * with respect to the World coordinate system, which is assumed to be the projected coordinate system based on the + * spherical geographic coordinate system. +The relative reference context refers to the orientation with respect to the + * reference (s,t)-coordinate system of the lane on the road underlying the target position. The Heading angle at the + * target position on the (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis + * at the target position is built parallel to the tangent to the reference lane s-axis on the reference road. The Heading + * is counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetAltitude() will return false); + */ + virtual void ResetAltitude() = 0; + + /** + * Resets the optional property (IsSetHeight() will return false); + */ + virtual void ResetHeight() = 0; + + /** + * Resets the optional property (IsSetLatitude() will return false); + */ + virtual void ResetLatitude() = 0; + + /** + * Resets the optional property (IsSetLatitudeDeg() will return false); + */ + virtual void ResetLatitudeDeg() = 0; + + /** + * Resets the optional property (IsSetLongitude() will return false); + */ + virtual void ResetLongitude() = 0; + + /** + * Resets the optional property (IsSetLongitudeDeg() will return false); + */ + virtual void ResetLongitudeDeg() = 0; + + /** + * Resets the optional property (IsSetVerticalRoadSelection() will return false); + */ + virtual void ResetVerticalRoadSelection() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'GlobalAction' + * From OpenSCENARIO class model specification: + * Actions that does not explicitly target an entity’s state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IGlobalActionWriter : public IOpenScenarioElementWriter, public IGlobalAction + { + public: + virtual ~IGlobalActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Sets the weather state, road conditions, and time of the day. + * + * @return value of model property environmentAction + */ + virtual void SetEnvironmentAction(std::shared_ptr environmentAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Removing or adding entities. + * + * @return value of model property entityAction + */ + virtual void SetEntityAction(std::shared_ptr entityAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying traffic signals. + * + * @return value of model property infrastructureAction + */ + virtual void SetInfrastructureAction(std::shared_ptr infrastructureAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Set the value of a monitor based on the scenario execution. + * + * @return value of model property setMonitorAction + */ + virtual void SetSetMonitorAction(std::shared_ptr setMonitorAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of parameters. + * + * @return value of model property parameterAction + */ + virtual void SetParameterAction(std::shared_ptr parameterAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Populating ambient traffic. + * + * @return value of model property trafficAction + */ + virtual void SetTrafficAction(std::shared_ptr trafficAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of variables. + * + * @return value of model property variableAction + */ + virtual void SetVariableAction(std::shared_ptr variableAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Sets the weather state, road conditions, and time of the day. + * + * @return a writer for model property environmentAction + */ + virtual std::shared_ptr GetWriterEnvironmentAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Removing or adding entities. + * + * @return a writer for model property entityAction + */ + virtual std::shared_ptr GetWriterEntityAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Setting/modifying traffic signals. + * + * @return a writer for model property infrastructureAction + */ + virtual std::shared_ptr GetWriterInfrastructureAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Set the value of a monitor based on the scenario execution. + * + * @return a writer for model property setMonitorAction + */ + virtual std::shared_ptr GetWriterSetMonitorAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of parameters. + * + * @return a writer for model property parameterAction + */ + virtual std::shared_ptr GetWriterParameterAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Populating ambient traffic. + * + * @return a writer for model property trafficAction + */ + virtual std::shared_ptr GetWriterTrafficAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Setting/modifying values of variables. + * + * @return a writer for model property variableAction + */ + virtual std::shared_ptr GetWriterVariableAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Histogram' + * From OpenSCENARIO class model specification: + * Histogram which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IHistogramWriter : public IOpenScenarioElementWriter, public IHistogram + { + public: + virtual ~IHistogramWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines all the available bins in the histogram. Ranges of bins must not overlap. + * + * @return value of model property bins + */ + virtual void SetBins(std::vector>& bins) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines all the available bins in the histogram. Ranges of bins must not overlap. + * + * @return a list of writers for model property bins + */ + virtual std::vector> GetWriterBins() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'HistogramBin' + * From OpenSCENARIO class model specification: + * A bin in a histogram. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IHistogramBinWriter : public IOpenScenarioElementWriter, public IHistogramBin + { + public: + virtual ~IHistogramBinWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * This is used to define a probability for a value to end up in a specific interval represented by range. Instead of a + * probability a defined count or weight has to be defined. The probability can be calculated by the (1/sum(all weights + * from histogram bins)) * weight. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the range or interval of the bin in a histogram. + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the range or interval of the bin in a histogram. + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'InRoutePosition' + * From OpenSCENARIO class model specification: + * Defines the current position in a given route, either through a position in the lane coordinate system, a position in a + * road coordinate system or through the current position of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInRoutePositionWriter : public IOpenScenarioElementWriter, public IInRoutePosition + { + public: + virtual ~IInRoutePositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The position is defined through the current position of a given entity. + * + * @return value of model property fromCurrentEntity + */ + virtual void SetFromCurrentEntity(std::shared_ptr fromCurrentEntity) = 0; + + /** + * From OpenSCENARIO class model specification: + * Route position in road coordinate system. + * + * @return value of model property fromRoadCoordinates + */ + virtual void SetFromRoadCoordinates(std::shared_ptr fromRoadCoordinates) = 0; + + /** + * From OpenSCENARIO class model specification: + * Route position in lane coordinate system. + * + * @return value of model property fromLaneCoordinates + */ + virtual void SetFromLaneCoordinates(std::shared_ptr fromLaneCoordinates) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The position is defined through the current position of a given entity. + * + * @return a writer for model property fromCurrentEntity + */ + virtual std::shared_ptr GetWriterFromCurrentEntity() const = 0; + /** + * From OpenSCENARIO class model specification: + * Route position in road coordinate system. + * + * @return a writer for model property fromRoadCoordinates + */ + virtual std::shared_ptr GetWriterFromRoadCoordinates() const = 0; + /** + * From OpenSCENARIO class model specification: + * Route position in lane coordinate system. + * + * @return a writer for model property fromLaneCoordinates + */ + virtual std::shared_ptr GetWriterFromLaneCoordinates() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'InfrastructureAction' + * From OpenSCENARIO class model specification: + * Defines an action which changes a state of a traffic signal or a traffic signal controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInfrastructureActionWriter : public IOpenScenarioElementWriter, public IInfrastructureAction + { + public: + virtual ~IInfrastructureActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Set or override a signals state or a signal controllers state from a road network. + * + * @return value of model property trafficSignalAction + */ + virtual void SetTrafficSignalAction(std::shared_ptr trafficSignalAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Set or override a signals state or a signal controllers state from a road network. + * + * @return a writer for model property trafficSignalAction + */ + virtual std::shared_ptr GetWriterTrafficSignalAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Init' + * From OpenSCENARIO class model specification: + * Defines the actions which are executed during the initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInitWriter : public IOpenScenarioElementWriter, public IInit + { + public: + virtual ~IInitWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A list of actions initially executed when the enclosing storyboard starts. + * + * @return value of model property actions + */ + virtual void SetActions(std::shared_ptr actions) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A list of actions initially executed when the enclosing storyboard starts. + * + * @return a writer for model property actions + */ + virtual std::shared_ptr GetWriterActions() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'InitActions' + * From OpenSCENARIO class model specification: + * A list of action instances (GlobalAction, UserDefinedAction, PrivateAction instances) which are executed during the + * initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IInitActionsWriter : public IOpenScenarioElementWriter, public IInitActions + { + public: + virtual ~IInitActionsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * An optional list of global actions. + * + * @return value of model property globalActions + */ + virtual void SetGlobalActions(std::vector>& globalActions) = 0; + + /** + * From OpenSCENARIO class model specification: + * An optional list of user defined actions. + * + * @return value of model property userDefinedActions + */ + virtual void SetUserDefinedActions(std::vector>& userDefinedActions) = 0; + + /** + * From OpenSCENARIO class model specification: + * An optional list of private actions. + * + * @return value of model property privates + */ + virtual void SetPrivates(std::vector>& privates) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * An optional list of global actions. + * + * @return a list of writers for model property globalActions + */ + virtual std::vector> GetWriterGlobalActions() const = 0; + /** + * From OpenSCENARIO class model specification: + * An optional list of user defined actions. + * + * @return a list of writers for model property userDefinedActions + */ + virtual std::vector> GetWriterUserDefinedActions() const = 0; + /** + * From OpenSCENARIO class model specification: + * An optional list of private actions. + * + * @return a list of writers for model property privates + */ + virtual std::vector> GetWriterPrivates() const = 0; + /** + * Resets the optional property (IsSetGlobalActions() will return false); + */ + virtual void ResetGlobalActions() = 0; + + /** + * Resets the optional property (IsSetUserDefinedActions() will return false); + */ + virtual void ResetUserDefinedActions() = 0; + + /** + * Resets the optional property (IsSetPrivates() will return false); + */ + virtual void ResetPrivates() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Knot' + * From OpenSCENARIO class model specification: + * Specification of one value of the knot vector of a NURBS trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IKnotWriter : public IOpenScenarioElementWriter, public IKnot + { + public: + virtual ~IKnotWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Knot vector value. Range: ]-inf..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Lane' + * From OpenSCENARIO class model specification: + * Specifies a lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneWriter : public IOpenScenarioElementWriter, public ILane + { + public: + virtual ~ILaneWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The local ID of the target lane at the specified s coordinate taken from the respective road network definition file. + * + * @return value of model property id + */ + virtual void SetId(const int id) = 0; + + /** + * Set a parameter for the attribute id + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToId(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute id + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromId() const = 0; + + /** + * Retrieves whether the attribute id is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsIdParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LaneChangeAction' + * From OpenSCENARIO class model specification: + * This action describes the transition between an entity's current lane and its target lane. The target lane may be given + * in absolute or relative terms. The dynamics of the transition may be given either by providing the time or the distance + * required for performing the transition. Time and distance are measured between the start position and the end position + * of the action. The transition starts at the current lane position, including the current lane offset and ends at the + * target lane position, optionally including a targetLaneOffset. If no targetLaneOffset is specified, it shall be zero + * after completing the action, so that any previous offset is not taken into account. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneChangeActionWriter : public IOpenScenarioElementWriter, public ILaneChangeAction, public IMotionControlActionWriter + { + public: + virtual ~ILaneChangeActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Lane offset to be reached at the target lane; the action will end there. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property targetLaneOffset + */ + virtual void SetTargetLaneOffset(const double targetLaneOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Shape/time of lane change action. + * + * @return value of model property laneChangeActionDynamics + */ + virtual void SetLaneChangeActionDynamics(std::shared_ptr laneChangeActionDynamics) = 0; + + /** + * From OpenSCENARIO class model specification: + * Target lane of lane change action. + * + * @return value of model property laneChangeTarget + */ + virtual void SetLaneChangeTarget(std::shared_ptr laneChangeTarget) = 0; + + /** + * Set a parameter for the attribute targetLaneOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTargetLaneOffset(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute targetLaneOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTargetLaneOffset() const = 0; + + /** + * Retrieves whether the attribute targetLaneOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTargetLaneOffsetParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Shape/time of lane change action. + * + * @return a writer for model property laneChangeActionDynamics + */ + virtual std::shared_ptr GetWriterLaneChangeActionDynamics() const = 0; + /** + * From OpenSCENARIO class model specification: + * Target lane of lane change action. + * + * @return a writer for model property laneChangeTarget + */ + virtual std::shared_ptr GetWriterLaneChangeTarget() const = 0; + + /** + * Resets the optional property (IsSetTargetLaneOffset() will return false); + */ + virtual void ResetTargetLaneOffset() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LaneChangeTarget' + * From OpenSCENARIO class model specification: + * Defines the target lane of the LaneChangeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneChangeTargetWriter : public IOpenScenarioElementWriter, public ILaneChangeTarget + { + public: + virtual ~ILaneChangeTargetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Lane change direction relative to entity's lane. + * + * @return value of model property relativeTargetLane + */ + virtual void SetRelativeTargetLane(std::shared_ptr relativeTargetLane) = 0; + + /** + * From OpenSCENARIO class model specification: + * Lane change target lane number. + * + * @return value of model property absoluteTargetLane + */ + virtual void SetAbsoluteTargetLane(std::shared_ptr absoluteTargetLane) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Lane change direction relative to entity's lane. + * + * @return a writer for model property relativeTargetLane + */ + virtual std::shared_ptr GetWriterRelativeTargetLane() const = 0; + /** + * From OpenSCENARIO class model specification: + * Lane change target lane number. + * + * @return a writer for model property absoluteTargetLane + */ + virtual std::shared_ptr GetWriterAbsoluteTargetLane() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LaneOffsetAction' + * From OpenSCENARIO class model specification: + * This action describes the transition to a defined lane offset of an entity. The lane offset will be kept if the action + * is set as continuous. The lane offset may be given in absolute or relative terms. The dynamics are specified by + * providing the maxLateralAcc used to keep the lane offset. Lane offset keeping starts immediately at start of the action + * and ends after the given duration. Different shapes can be used for the initial transition. Step defines an immediate + * transition, i.e. a jump from the current lane offset to the target lane offset. Usage of time and distance does not make + * any sense in combination with step; linear will result in a linear movement between the start and target lane offset; + * cubic and sinusoidal will result in smooth transitions (basically s-shaped) between start and end state. A smooth + * transition is only given with cubic and sinusoidal shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetActionWriter : public IOpenScenarioElementWriter, public ILaneOffsetAction, public IMotionControlActionWriter + { + public: + virtual ~ILaneOffsetActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target lane-offset is reached. If true it does not end but has to be stopped. + * + * @return value of model property continuous + */ + virtual void SetContinuous(const bool continuous) = 0; + + /** + * From OpenSCENARIO class model specification: + * Parameters defining the dynamics of the LaneOffsetAction. + * + * @return value of model property laneOffsetActionDynamics + */ + virtual void SetLaneOffsetActionDynamics(std::shared_ptr laneOffsetActionDynamics) = 0; + + /** + * From OpenSCENARIO class model specification: + * Parameters indicating if the lane offset is defined relative to another entity or absolute to the current lane's center + * line. + * + * @return value of model property laneOffsetTarget + */ + virtual void SetLaneOffsetTarget(std::shared_ptr laneOffsetTarget) = 0; + + /** + * Set a parameter for the attribute continuous + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContinuous(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute continuous + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContinuous() const = 0; + + /** + * Retrieves whether the attribute continuous is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContinuousParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Parameters defining the dynamics of the LaneOffsetAction. + * + * @return a writer for model property laneOffsetActionDynamics + */ + virtual std::shared_ptr GetWriterLaneOffsetActionDynamics() const = 0; + /** + * From OpenSCENARIO class model specification: + * Parameters indicating if the lane offset is defined relative to another entity or absolute to the current lane's center + * line. + * + * @return a writer for model property laneOffsetTarget + */ + virtual std::shared_ptr GetWriterLaneOffsetTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LaneOffsetActionDynamics' + * From OpenSCENARIO class model specification: + * Defines shape and lateral acceleration which are used to do the lane offset action. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetActionDynamicsWriter : public IOpenScenarioElementWriter, public ILaneOffsetActionDynamics + { + public: + virtual ~ILaneOffsetActionDynamicsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Geometrical shape of the LaneOffsetAction's dynamics. + * + * @return value of model property dynamicsShape + */ + virtual void SetDynamicsShape(const DynamicsShape dynamicsShape) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum lateral acceleration used to initially reach and afterwards keep the lane offset. Missing value is interpreted + * as 'inf'. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxLateralAcc + */ + virtual void SetMaxLateralAcc(const double maxLateralAcc) = 0; + + /** + * Set a parameter for the attribute dynamicsShape + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDynamicsShape(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxLateralAcc + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxLateralAcc(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dynamicsShape + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDynamicsShape() const = 0; + /** + * Get the parameter for the attribute maxLateralAcc + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxLateralAcc() const = 0; + + /** + * Retrieves whether the attribute dynamicsShape is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDynamicsShapeParameterized() = 0; + /** + * Retrieves whether the attribute maxLateralAcc is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxLateralAccParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxLateralAcc() will return false); + */ + virtual void ResetMaxLateralAcc() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LaneOffsetTarget' + * From OpenSCENARIO class model specification: + * Defines the target lane offset of the LaneOffsetAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILaneOffsetTargetWriter : public IOpenScenarioElementWriter, public ILaneOffsetTarget + { + public: + virtual ~ILaneOffsetTargetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Relative reference to the lane position of a specific entity. + * + * @return value of model property relativeTargetLaneOffset + */ + virtual void SetRelativeTargetLaneOffset(std::shared_ptr relativeTargetLaneOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Absolute reference to the current lane's center line. + * + * @return value of model property absoluteTargetLaneOffset + */ + virtual void SetAbsoluteTargetLaneOffset(std::shared_ptr absoluteTargetLaneOffset) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Relative reference to the lane position of a specific entity. + * + * @return a writer for model property relativeTargetLaneOffset + */ + virtual std::shared_ptr GetWriterRelativeTargetLaneOffset() const = 0; + /** + * From OpenSCENARIO class model specification: + * Absolute reference to the current lane's center line. + * + * @return a writer for model property absoluteTargetLaneOffset + */ + virtual std::shared_ptr GetWriterAbsoluteTargetLaneOffset() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LanePosition' + * From OpenSCENARIO class model specification: + * Position defined in terms of the road segment (roadId), the lane (laneId) of the road, the distance (s) along the road's + * reference line, and the lateral offset to the lane's center line along the lane center line's t-axis. Orientation is + * optional. +The s-coordinate and the offset should be specified so that the target position is within a road defined by + * roadId taken from the respective road network definition file (external to the ASAM OpenSCENARIO). If the target + * position would be outside the road boundaries, the z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILanePositionWriter : public IOpenScenarioElementWriter, public ILanePosition + { + public: + virtual ~ILanePositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The ID of the target lane belonging to the target road (taken from the respective road network definition file). + * + * @return value of model property laneId + */ + virtual void SetLaneId(const std::string laneId) = 0; + + /** + * From OpenSCENARIO class model specification: + * The lateral offset to the center line of the target lane (along the t-axis of the target lane center line). Missing + * value is interpreted as 0. The positive value means the offset is applied in the direction of the t-axis being imagined + * at the target s-position. Unit: [m]. + * + * @return value of model property offset + */ + virtual void SetOffset(const double offset) = 0; + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual void SetRoadId(const std::string roadId) = 0; + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property s + */ + virtual void SetS(const double s) = 0; + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target lane that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the lane s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute laneId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLaneId(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute offset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOffset(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute roadId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoadId(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute s + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToS(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute laneId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLaneId() const = 0; + /** + * Get the parameter for the attribute offset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOffset() const = 0; + /** + * Get the parameter for the attribute roadId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoadId() const = 0; + /** + * Get the parameter for the attribute s + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromS() const = 0; + + /** + * Retrieves whether the attribute laneId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLaneIdParameterized() = 0; + /** + * Retrieves whether the attribute offset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOffsetParameterized() = 0; + /** + * Retrieves whether the attribute roadId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoadIdParameterized() = 0; + /** + * Retrieves whether the attribute s is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target lane that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the lane s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetOffset() will return false); + */ + virtual void ResetOffset() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LateralAction' + * From OpenSCENARIO class model specification: + * Controls the lateral behavior of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILateralActionWriter : public IOpenScenarioElementWriter, public ILateralAction + { + public: + virtual ~ILateralActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Action defining a lane change. + * + * @return value of model property laneChangeAction + */ + virtual void SetLaneChangeAction(std::shared_ptr laneChangeAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined lane offset. + * + * @return value of model property laneOffsetAction + */ + virtual void SetLaneOffsetAction(std::shared_ptr laneOffsetAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a lateral distance to a referenced entity. + * + * @return value of model property lateralDistanceAction + */ + virtual void SetLateralDistanceAction(std::shared_ptr lateralDistanceAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Action defining a lane change. + * + * @return a writer for model property laneChangeAction + */ + virtual std::shared_ptr GetWriterLaneChangeAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined lane offset. + * + * @return a writer for model property laneOffsetAction + */ + virtual std::shared_ptr GetWriterLaneOffsetAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a lateral distance to a referenced entity. + * + * @return a writer for model property lateralDistanceAction + */ + virtual std::shared_ptr GetWriterLateralDistanceAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LateralDistanceAction' + * From OpenSCENARIO class model specification: + * This action describes a continuously kept lateral distance of an entity with respect to a reference entity. The distance + * can be maintained by using a controller, requiring limiting values for lateral acceleration, lateral deceleration and + * lateral speed. Without this limiting parameters lateral distance is kept rigid. Distance measurement could either be + * calculated from the distance between the entities' reference points or from the free space between the entities' + * bounding boxes. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILateralDistanceActionWriter : public IOpenScenarioElementWriter, public ILateralDistanceAction, public IMotionControlActionWriter + { + public: + virtual ~ILateralDistanceActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target distance is reached. If true it does not end and can only be stopped. + * + * @return value of model property continuous + */ + virtual void SetContinuous(const bool continuous) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If "entity", the coordinate system is interpreted as the actor's local coordinate system. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * The displacement in which the distance or time gap applies. Where omitted, 'any' is assumed. + * + * @return value of model property displacement + */ + virtual void SetDisplacement(const LateralDisplacement displacement) = 0; + + /** + * From OpenSCENARIO class model specification: + * Lateral distance value. Missing value is interpreted as 0. Unit: [m]. Range: [0..inf[. + * + * @return value of model property distance + */ + virtual void SetDistance(const double distance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the reference entity the lateral distance shall be kept to. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: Lateral distance is measured using the distance between closest bounding box points. False: Reference point + * distance is used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if omitted) or limited maxAcceleration/maxDeceleration/maxSpeed to the + * action. + * + * @return value of model property dynamicConstraints + */ + virtual void SetDynamicConstraints(std::shared_ptr dynamicConstraints) = 0; + + /** + * Set a parameter for the attribute continuous + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContinuous(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute displacement + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDisplacement(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute distance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDistance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute continuous + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContinuous() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute displacement + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDisplacement() const = 0; + /** + * Get the parameter for the attribute distance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDistance() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + + /** + * Retrieves whether the attribute continuous is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContinuousParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute displacement is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDisplacementParameterized() = 0; + /** + * Retrieves whether the attribute distance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDistanceParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if omitted) or limited maxAcceleration/maxDeceleration/maxSpeed to the + * action. + * + * @return a writer for model property dynamicConstraints + */ + virtual std::shared_ptr GetWriterDynamicConstraints() const = 0; + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetDisplacement() will return false); + */ + virtual void ResetDisplacement() = 0; + + /** + * Resets the optional property (IsSetDistance() will return false); + */ + virtual void ResetDistance() = 0; + + /** + * Resets the optional property (IsSetDynamicConstraints() will return false); + */ + virtual void ResetDynamicConstraints() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'License' + * From OpenSCENARIO class model specification: + * Licensing information about the OpenSCENARIO file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILicenseWriter : public IOpenScenarioElementWriter, public ILicense + { + public: + virtual ~ILicenseWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The full license text. + * + * @return value of model property text + */ + virtual void SetText(const std::string text) = 0; + + /** + * From OpenSCENARIO class model specification: + * The full name of the license. Informational only. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Link to an URL where the full license text can be found. + * + * @return value of model property resource + */ + virtual void SetResource(const std::string resource) = 0; + + /** + * From OpenSCENARIO class model specification: + * The identifier of the license from the SPDX + * license list. Can also be an SPDX License Expression, which is also applicable to custom licenses + * (LicenseRef-...). + * + * @return value of model property spdxId + */ + virtual void SetSpdxId(const std::string spdxId) = 0; + + /** + * Set a parameter for the attribute text + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToText(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute resource + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToResource(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute spdxId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpdxId(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute text + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromText() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute resource + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromResource() const = 0; + /** + * Get the parameter for the attribute spdxId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpdxId() const = 0; + + /** + * Retrieves whether the attribute text is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTextParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute resource is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsResourceParameterized() = 0; + /** + * Retrieves whether the attribute spdxId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpdxIdParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetText() will return false); + */ + virtual void ResetText() = 0; + + /** + * Resets the optional property (IsSetResource() will return false); + */ + virtual void ResetResource() = 0; + + /** + * Resets the optional property (IsSetSpdxId() will return false); + */ + virtual void ResetSpdxId() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LightState' + * From OpenSCENARIO class model specification: + * Definition of the light state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightStateWriter : public IOpenScenarioElementWriter, public ILightState + { + public: + virtual ~ILightStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * When mode is set to flashing (e.g. hazard lights of a parking car), this attribute describes the duration of the 'off' + * phase of the flashing. Unit: [s]. Default: 0.5s. + * + * @return value of model property flashingOffDuration + */ + virtual void SetFlashingOffDuration(const double flashingOffDuration) = 0; + + /** + * From OpenSCENARIO class model specification: + * When mode is set to flashing (e.g. hazard lights of a parking car), this attribute describes the duration of the 'on' + * phase of the flashing. Unit: [s]. Default: 0.5s. + * + * @return value of model property flashingOnDuration + */ + virtual void SetFlashingOnDuration(const double flashingOnDuration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Luminous intensity of the light. Unit: [cd]. + * + * @return value of model property luminousIntensity + */ + virtual void SetLuminousIntensity(const double luminousIntensity) = 0; + + /** + * From OpenSCENARIO class model specification: + * Indication if a light should be switched on, off or flashing. + * + * @return value of model property mode + */ + virtual void SetMode(const LightMode mode) = 0; + + /** + * From OpenSCENARIO class model specification: + * Color of the light. + * + * @return value of model property color + */ + virtual void SetColor(std::shared_ptr color) = 0; + + /** + * Set a parameter for the attribute flashingOffDuration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFlashingOffDuration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute flashingOnDuration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFlashingOnDuration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute luminousIntensity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLuminousIntensity(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute mode + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMode(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute flashingOffDuration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFlashingOffDuration() const = 0; + /** + * Get the parameter for the attribute flashingOnDuration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFlashingOnDuration() const = 0; + /** + * Get the parameter for the attribute luminousIntensity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLuminousIntensity() const = 0; + /** + * Get the parameter for the attribute mode + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMode() const = 0; + + /** + * Retrieves whether the attribute flashingOffDuration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFlashingOffDurationParameterized() = 0; + /** + * Retrieves whether the attribute flashingOnDuration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFlashingOnDurationParameterized() = 0; + /** + * Retrieves whether the attribute luminousIntensity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLuminousIntensityParameterized() = 0; + /** + * Retrieves whether the attribute mode is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsModeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Color of the light. + * + * @return a writer for model property color + */ + virtual std::shared_ptr GetWriterColor() const = 0; + + /** + * Resets the optional property (IsSetFlashingOffDuration() will return false); + */ + virtual void ResetFlashingOffDuration() = 0; + + /** + * Resets the optional property (IsSetFlashingOnDuration() will return false); + */ + virtual void ResetFlashingOnDuration() = 0; + + /** + * Resets the optional property (IsSetLuminousIntensity() will return false); + */ + virtual void ResetLuminousIntensity() = 0; + + /** + * Resets the optional property (IsSetColor() will return false); + */ + virtual void ResetColor() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LightStateAction' + * From OpenSCENARIO class model specification: + * This action describes the transition of a current light state to the target light state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightStateActionWriter : public IOpenScenarioElementWriter, public ILightStateAction + { + public: + virtual ~ILightStateActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Time to transition from current lightState to given new lightState (default: transitionTime = 0). Unit: [s]. + * + * @return value of model property transitionTime + */ + virtual void SetTransitionTime(const double transitionTime) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to a certain light of a entity that will be addressed in this LightStateAction. + * + * @return value of model property lightType + */ + virtual void SetLightType(std::shared_ptr lightType) = 0; + + /** + * From OpenSCENARIO class model specification: + * LightState after execution of the LightStateAction. + * + * @return value of model property lightState + */ + virtual void SetLightState(std::shared_ptr lightState) = 0; + + /** + * Set a parameter for the attribute transitionTime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTransitionTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute transitionTime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTransitionTime() const = 0; + + /** + * Retrieves whether the attribute transitionTime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTransitionTimeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Reference to a certain light of a entity that will be addressed in this LightStateAction. + * + * @return a writer for model property lightType + */ + virtual std::shared_ptr GetWriterLightType() const = 0; + /** + * From OpenSCENARIO class model specification: + * LightState after execution of the LightStateAction. + * + * @return a writer for model property lightState + */ + virtual std::shared_ptr GetWriterLightState() const = 0; + + /** + * Resets the optional property (IsSetTransitionTime() will return false); + */ + virtual void ResetTransitionTime() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LightType' + * From OpenSCENARIO class model specification: + * Definition of light types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILightTypeWriter : public IOpenScenarioElementWriter, public ILightType + { + public: + virtual ~ILightTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Available lights attached to a vehicle. + * + * @return value of model property vehicleLight + */ + virtual void SetVehicleLight(std::shared_ptr vehicleLight) = 0; + + /** + * From OpenSCENARIO class model specification: + * Light type cannot be handled be the above options and is therefore user defined. + * + * @return value of model property userDefinedLight + */ + virtual void SetUserDefinedLight(std::shared_ptr userDefinedLight) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Available lights attached to a vehicle. + * + * @return a writer for model property vehicleLight + */ + virtual std::shared_ptr GetWriterVehicleLight() const = 0; + /** + * From OpenSCENARIO class model specification: + * Light type cannot be handled be the above options and is therefore user defined. + * + * @return a writer for model property userDefinedLight + */ + virtual std::shared_ptr GetWriterUserDefinedLight() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LogNormalDistribution' + * From OpenSCENARIO class model specification: + * Defines a log normal distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILogNormalDistributionWriter : public IOpenScenarioElementWriter, public ILogNormalDistribution + { + public: + virtual ~ILogNormalDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value (mean) for a log normal distribution. Range: ]-inf; inf[ + * + * @return value of model property expectedValue + */ + virtual void SetExpectedValue(const double expectedValue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the variance for a log normal distribution (square of standard deviation). Range: ]0; inf[ + * + * @return value of model property variance + */ + virtual void SetVariance(const double variance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the log normal distribution regarding the definition space. Lower limit must be > 0. Assumed + * range if omitted: ]0; inf[ + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + /** + * Set a parameter for the attribute expectedValue + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToExpectedValue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute variance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVariance(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute expectedValue + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromExpectedValue() const = 0; + /** + * Get the parameter for the attribute variance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVariance() const = 0; + + /** + * Retrieves whether the attribute expectedValue is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsExpectedValueParameterized() = 0; + /** + * Retrieves whether the attribute variance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVarianceParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the log normal distribution regarding the definition space. Lower limit must be > 0. Assumed + * range if omitted: ]0; inf[ + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + /** + * Resets the optional property (IsSetRange() will return false); + */ + virtual void ResetRange() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LongitudinalAction' + * From OpenSCENARIO class model specification: + * Controls the longitudinal behavior of an entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILongitudinalActionWriter : public IOpenScenarioElementWriter, public ILongitudinalAction + { + public: + virtual ~ILongitudinalActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * This action describes the transition between the current speed of an entity and its target speed. + * + * @return value of model property speedAction + */ + virtual void SetSpeedAction(std::shared_ptr speedAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined longitudinal distance to a referenced entity. + * + * @return value of model property longitudinalDistanceAction + */ + virtual void SetLongitudinalDistanceAction(std::shared_ptr longitudinalDistanceAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * This action describes the change of speed in terms of a series of speed targets over time. + * + * @return value of model property speedProfileAction + */ + virtual void SetSpeedProfileAction(std::shared_ptr speedProfileAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * This action describes the transition between the current speed of an entity and its target speed. + * + * @return a writer for model property speedAction + */ + virtual std::shared_ptr GetWriterSpeedAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * This action defines a transition to a defined longitudinal distance to a referenced entity. + * + * @return a writer for model property longitudinalDistanceAction + */ + virtual std::shared_ptr GetWriterLongitudinalDistanceAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * This action describes the change of speed in terms of a series of speed targets over time. + * + * @return a writer for model property speedProfileAction + */ + virtual std::shared_ptr GetWriterSpeedProfileAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'LongitudinalDistanceAction' + * From OpenSCENARIO class model specification: + * This action activates a controller for the longitudinal behavior of an entity in a way that a given distance or time gap + * to the reference entity is maintained. +The target position may be either on the same road segment where the reference + * entity is positioned or on a connecting road. In the latter case for coordinate systems lane and road, the distance or + * time gap is calculated along the road reference line / lane centerline of the connecting road. It is assumed that the + * reference line of the road / lane centerline of the reference entity continues seamlessly on the connecting road (even + * if its shape changes). It is assumed that the target position relates to the routing of the reference entity. Otherwise, + * the calculation of the target position cannot be interpreted within the OpenSCENARIO standard. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ILongitudinalDistanceActionWriter : public IOpenScenarioElementWriter, public ILongitudinalDistanceAction, public IMotionControlActionWriter + { + public: + virtual ~ILongitudinalDistanceActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If false, the action ends when the target distance is reached. If true it does not end and can only be stopped. + * + * @return value of model property continuous + */ + virtual void SetContinuous(const bool continuous) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If "entity", the coordinate system is interpreted as the actor's local coordinate system. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * The displacement in which the distance or time gap applies. Where omitted, 'trailingReferencedEntity' is assumed. + * + * @return value of model property displacement + */ + virtual void SetDisplacement(const LongitudinalDisplacement displacement) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distance value, not to be used together with timeGap attribute. Unit: [m]. Range: [0..inf[. + * + * @return value of model property distance + */ + virtual void SetDistance(const double distance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity the distance shall be kept to. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: Distance is measured using the distance between closest bounding box points False: Reference point distance is + * used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Time gap value, not to be used together with distance attribute. Unit: [s]. Range: [0..inf[. + * + * @return value of model property timeGap + */ + virtual void SetTimeGap(const double timeGap) = 0; + + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if ommitted) or limited maxAcceleration/maxDeceleration/maxSpeed to + * the action. + * + * @return value of model property dynamicConstraints + */ + virtual void SetDynamicConstraints(std::shared_ptr dynamicConstraints) = 0; + + /** + * Set a parameter for the attribute continuous + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContinuous(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute displacement + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDisplacement(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute distance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDistance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute timeGap + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTimeGap(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute continuous + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContinuous() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute displacement + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDisplacement() const = 0; + /** + * Get the parameter for the attribute distance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDistance() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + /** + * Get the parameter for the attribute timeGap + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTimeGap() const = 0; + + /** + * Retrieves whether the attribute continuous is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContinuousParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute displacement is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDisplacementParameterized() = 0; + /** + * Retrieves whether the attribute distance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDistanceParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + /** + * Retrieves whether the attribute timeGap is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeGapParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Parameter that assigns either unlimited dynamics (if ommitted) or limited maxAcceleration/maxDeceleration/maxSpeed to + * the action. + * + * @return a writer for model property dynamicConstraints + */ + virtual std::shared_ptr GetWriterDynamicConstraints() const = 0; + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetDisplacement() will return false); + */ + virtual void ResetDisplacement() = 0; + + /** + * Resets the optional property (IsSetDistance() will return false); + */ + virtual void ResetDistance() = 0; + + /** + * Resets the optional property (IsSetTimeGap() will return false); + */ + virtual void ResetTimeGap() = 0; + + /** + * Resets the optional property (IsSetDynamicConstraints() will return false); + */ + virtual void ResetDynamicConstraints() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Maneuver' + * From OpenSCENARIO class model specification: + * A container for Events. Can be stored in a maneuver catalog. Allows declaration of parameters within its scope. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuverWriter : public IOpenScenarioElementWriter, public IManeuver, public IStoryboardElementWriter, public ICatalogElementWriter + { + public: + virtual ~IManeuverWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the maneuver. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of events that are comprised by the maneuver. + * + * @return value of model property events + */ + virtual void SetEvents(std::vector>& events) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * From OpenSCENARIO class model specification: + * List of events that are comprised by the maneuver. + * + * @return a list of writers for model property events + */ + virtual std::vector> GetWriterEvents() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ManeuverCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up maneuver catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuverCatalogLocationWriter : public IOpenScenarioElementWriter, public IManeuverCatalogLocation + { + public: + virtual ~IManeuverCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ManeuverGroup' + * From OpenSCENARIO class model specification: + * Grouping element connecting a set of actors to a set maneuvers. Multiple maneuver groups can run independently in + * parallel. Maneuvers can be defined or instantiated from a maneuver type in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManeuverGroupWriter : public IOpenScenarioElementWriter, public IManeuverGroup, public IStoryboardElementWriter + { + public: + virtual ~IManeuverGroupWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Number of allowed executions of the maneuver group. Default value is 1. Range: [1..inf[. + * + * @return value of model property maximumExecutionCount + */ + virtual void SetMaximumExecutionCount(const uint32_t maximumExecutionCount) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the maneuver group. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Actors of the maneuver group. + * + * @return value of model property actors + */ + virtual void SetActors(std::shared_ptr actors) = 0; + + /** + * From OpenSCENARIO class model specification: + * Each element of this list of must reference a maneuver type in a catalog. + * + * @return value of model property catalogReferences + */ + virtual void SetCatalogReferences(std::vector>& catalogReferences) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maneuver type definitions. + * + * @return value of model property maneuvers + */ + virtual void SetManeuvers(std::vector>& maneuvers) = 0; + + /** + * Set a parameter for the attribute maximumExecutionCount + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaximumExecutionCount(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maximumExecutionCount + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaximumExecutionCount() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute maximumExecutionCount is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaximumExecutionCountParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Actors of the maneuver group. + * + * @return a writer for model property actors + */ + virtual std::shared_ptr GetWriterActors() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Each element of this list of must reference a maneuver type in a catalog. + * + * @return a list of writers for model property catalogReferences + */ + virtual std::vector> GetWriterCatalogReferences() const = 0; + /** + * From OpenSCENARIO class model specification: + * Maneuver type definitions. + * + * @return a list of writers for model property maneuvers + */ + virtual std::vector> GetWriterManeuvers() const = 0; + /** + * Resets the optional property (IsSetCatalogReferences() will return false); + */ + virtual void ResetCatalogReferences() = 0; + + /** + * Resets the optional property (IsSetManeuvers() will return false); + */ + virtual void ResetManeuvers() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ManualGear' + * From OpenSCENARIO class model specification: + * Manual gear description. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IManualGearWriter : public IOpenScenarioElementWriter, public IManualGear + { + public: + virtual ~IManualGearWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Gear number. Negative values are indicating reverse gears. Zero is neutral gear. + * + * @return value of model property number + */ + virtual void SetNumber(const int number) = 0; + + /** + * Set a parameter for the attribute number + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToNumber(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute number + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromNumber() const = 0; + + /** + * Retrieves whether the attribute number is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNumberParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'MiscObject' + * From OpenSCENARIO class model specification: + * Definition of a miscellaneous object type. A miscellaneous object has no controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMiscObjectWriter : public IOpenScenarioElementWriter, public IMiscObject, public ICatalogElementWriter + { + public: + virtual ~IMiscObjectWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Mass of the miscellaneous object. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual void SetMass(const double mass) = 0; + + /** + * From OpenSCENARIO class model specification: + * Categorization of the miscellaneous object. + * + * @return value of model property miscObjectCategory + */ + virtual void SetMiscObjectCategory(const MiscObjectCategory miscObjectCategory) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the miscellaneous object as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual void SetModel3d(const std::string model3d) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the miscellaneous object type. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Bounding box definition for the miscellaneous object. + * + * @return value of model property boundingBox + */ + virtual void SetBoundingBox(std::shared_ptr boundingBox) = 0; + + /** + * From OpenSCENARIO class model specification: + * Properties of the miscellaneous object. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute mass + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMass(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute miscObjectCategory + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMiscObjectCategory(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute model3d + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToModel3d(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute mass + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMass() const = 0; + /** + * Get the parameter for the attribute miscObjectCategory + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMiscObjectCategory() const = 0; + /** + * Get the parameter for the attribute model3d + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromModel3d() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute mass is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMassParameterized() = 0; + /** + * Retrieves whether the attribute miscObjectCategory is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMiscObjectCategoryParameterized() = 0; + /** + * Retrieves whether the attribute model3d is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsModel3dParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Bounding box definition for the miscellaneous object. + * + * @return a writer for model property boundingBox + */ + virtual std::shared_ptr GetWriterBoundingBox() const = 0; + /** + * From OpenSCENARIO class model specification: + * Properties of the miscellaneous object. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetModel3d() will return false); + */ + virtual void ResetModel3d() = 0; + + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'MiscObjectCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up miscellaneous object catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMiscObjectCatalogLocationWriter : public IOpenScenarioElementWriter, public IMiscObjectCatalogLocation + { + public: + virtual ~IMiscObjectCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ModifyRule' + * From OpenSCENARIO class model specification: + * Enclosing type for either adding a value to a parameter or multiply the parameter by a value. Has to be match the + * parameter type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IModifyRuleWriter : public IOpenScenarioElementWriter, public IModifyRule + { + public: + virtual ~IModifyRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Adding a value to a parameter. + * + * @return value of model property addValue + */ + virtual void SetAddValue(std::shared_ptr addValue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Multiply a parameter by a value. + * + * @return value of model property multiplyByValue + */ + virtual void SetMultiplyByValue(std::shared_ptr multiplyByValue) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Adding a value to a parameter. + * + * @return a writer for model property addValue + */ + virtual std::shared_ptr GetWriterAddValue() const = 0; + /** + * From OpenSCENARIO class model specification: + * Multiply a parameter by a value. + * + * @return a writer for model property multiplyByValue + */ + virtual std::shared_ptr GetWriterMultiplyByValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'MonitorDeclaration' + * From OpenSCENARIO class model specification: + * Declaration of a monitor that keeps track of the scenario execution. Monitors are of type Boolean and can be initialized + * as true or false and set during the scenario execution using the SetMonitorAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMonitorDeclarationWriter : public IOpenScenarioElementWriter, public IMonitorDeclaration + { + public: + virtual ~IMonitorDeclarationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the monitor. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Initialisation value of the monitor. + * + * @return value of model property value + */ + virtual void SetValue(const bool value) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'None' + * From OpenSCENARIO class model specification: + * Empty container, indicating unused controlling behavior or dynamics limitations for specific axis. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INoneWriter : public IOpenScenarioElementWriter, public INone + { + public: + virtual ~INoneWriter() = default; + + + + + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'NormalDistribution' + * From OpenSCENARIO class model specification: + * Normal distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INormalDistributionWriter : public IOpenScenarioElementWriter, public INormalDistribution + { + public: + virtual ~INormalDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value (mean) for a normal distribution. + * + * @return value of model property expectedValue + */ + virtual void SetExpectedValue(const double expectedValue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the variance for a normal distribution.(Square of standard deviation). + * + * @return value of model property variance + */ + virtual void SetVariance(const double variance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the normal distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + /** + * Set a parameter for the attribute expectedValue + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToExpectedValue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute variance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVariance(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute expectedValue + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromExpectedValue() const = 0; + /** + * Get the parameter for the attribute variance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVariance() const = 0; + + /** + * Retrieves whether the attribute expectedValue is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsExpectedValueParameterized() = 0; + /** + * Retrieves whether the attribute variance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVarianceParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the limits of the normal distribution regarding to the definition space. + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + /** + * Resets the optional property (IsSetRange() will return false); + */ + virtual void ResetRange() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Nurbs' + * From OpenSCENARIO class model specification: + * Non-uniform rational b-spline (NURBS) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class INurbsWriter : public IOpenScenarioElementWriter, public INurbs + { + public: + virtual ~INurbsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Order of the NURBS trajectory. This is the order of the curve, not the degree of the polynomials, which will be one less + * than the order of the curve. Range: [2..inf[. + * + * @return value of model property order + */ + virtual void SetOrder(const uint32_t order) = 0; + + /** + * From OpenSCENARIO class model specification: + * Control point vector of the NURBS trajectory. The number of control points must be greater or equal to the order of the + * curve. It's an ordered list, therefore the first control point determines the start of the trajectory and the last + * control point determines the end of the trajectory. + * + * @return value of model property controlPoints + */ + virtual void SetControlPoints(std::vector>& controlPoints) = 0; + + /** + * From OpenSCENARIO class model specification: + * Knot vector of the NURBS trajectory. Knot values must be given in ascending order. The number of knot vector values must + * be equal to the number of control points plus the order of the curve. + * + * @return value of model property knots + */ + virtual void SetKnots(std::vector>& knots) = 0; + + /** + * Set a parameter for the attribute order + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOrder(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute order + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOrder() const = 0; + + /** + * Retrieves whether the attribute order is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOrderParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Control point vector of the NURBS trajectory. The number of control points must be greater or equal to the order of the + * curve. It's an ordered list, therefore the first control point determines the start of the trajectory and the last + * control point determines the end of the trajectory. + * + * @return a list of writers for model property controlPoints + */ + virtual std::vector> GetWriterControlPoints() const = 0; + /** + * From OpenSCENARIO class model specification: + * Knot vector of the NURBS trajectory. Knot values must be given in ascending order. The number of knot vector values must + * be equal to the number of control points plus the order of the curve. + * + * @return a list of writers for model property knots + */ + virtual std::vector> GetWriterKnots() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ObjectController' + * From OpenSCENARIO class model specification: + * Definition of a controller for a scenario object. Either an inline definition or a catalog reference to a controller. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IObjectControllerWriter : public IOpenScenarioElementWriter, public IObjectController + { + public: + virtual ~IObjectControllerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Identifier of the ObjectController. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Catalog reference to a controller. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + /** + * From OpenSCENARIO class model specification: + * Controller type definition. + * + * @return value of model property controller + */ + virtual void SetController(std::shared_ptr controller) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Catalog reference to a controller. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + /** + * From OpenSCENARIO class model specification: + * Controller type definition. + * + * @return a writer for model property controller + */ + virtual std::shared_ptr GetWriterController() const = 0; + + /** + * Resets the optional property (IsSetName() will return false); + */ + virtual void ResetName() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OffroadCondition' + * From OpenSCENARIO class model specification: + * Checks if an entity is of the road. The logical expression returns true after the entity has been offroad for a specific + * duration. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOffroadConditionWriter : public IOpenScenarioElementWriter, public IOffroadCondition + { + public: + virtual ~IOffroadConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Amount of time of driving offroad. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual void SetDuration(const double duration) = 0; + + /** + * Set a parameter for the attribute duration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDuration(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute duration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDuration() const = 0; + + /** + * Retrieves whether the attribute duration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDurationParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OpenScenario' + * From OpenSCENARIO class model specification: + * Top level container for scenarios or catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOpenScenarioWriter : public IOpenScenarioElementWriter, public IOpenScenario + { + public: + virtual ~IOpenScenarioWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Header information for the scenario or the catalog. + * + * @return value of model property fileHeader + */ + virtual void SetFileHeader(std::shared_ptr fileHeader) = 0; + + /** + * From OpenSCENARIO class model specification: + * Category (catalog or scenario) of the OpenSCENARIO description. + * + * @return value of model property openScenarioCategory + */ + virtual void SetOpenScenarioCategory(std::shared_ptr openScenarioCategory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Header information for the scenario or the catalog. + * + * @return a writer for model property fileHeader + */ + virtual std::shared_ptr GetWriterFileHeader() const = 0; + /** + * From OpenSCENARIO class model specification: + * Category (catalog or scenario) of the OpenSCENARIO description. + * + * @return a writer for model property openScenarioCategory + */ + virtual std::shared_ptr GetWriterOpenScenarioCategory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OpenScenarioCategory' + * From OpenSCENARIO class model specification: + * Indicates if the following content defines a scenario or a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOpenScenarioCategoryWriter : public IOpenScenarioElementWriter, public IOpenScenarioCategory + { + public: + virtual ~IOpenScenarioCategoryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of a scenario. + * + * @return value of model property scenarioDefinition + */ + virtual void SetScenarioDefinition(std::shared_ptr scenarioDefinition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return value of model property catalogDefinition + */ + virtual void SetCatalogDefinition(std::shared_ptr catalogDefinition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return value of model property parameterValueDistributionDefinition + */ + virtual void SetParameterValueDistributionDefinition(std::shared_ptr parameterValueDistributionDefinition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Definition of a scenario. + * + * @return a writer for model property scenarioDefinition + */ + virtual std::shared_ptr GetWriterScenarioDefinition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of a catalog. + * + * @return a writer for model property catalogDefinition + */ + virtual std::shared_ptr GetWriterCatalogDefinition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return a writer for model property parameterValueDistributionDefinition + */ + virtual std::shared_ptr GetWriterParameterValueDistributionDefinition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Orientation' + * From OpenSCENARIO class model specification: + * Orientation is defined in terms of the Heading/Pitch/Roll orientation angles in the Cartesian coordinate system and + * considered in the absolute or relative reference context. +The absolute reference context refers to the orientation with + * respect to the World coordinate system. +If more than one orientation angle are specified at the same time, rotations are + * applied in the order: about Z-axis (Heading), then Y-axis (Pitch), then X-axis (Roll), assumed the positive rotation to + * be counter-clockwise. Heading=Pitch=Roll=0 means the orientation is aligned with coordinate axes (no rotation). +The + * relative reference context refers to the orientation with respect to a reference coordinate system. In the case of + * referencing to the road- or lane coordinate system, Pitch and Roll angles are determined by a surface tilt of an + * underlying road and therefore cannot be meaningfully interpreted within the OpenSCENARIO standard. As well, the + * Heading=0 means the Heading is aligned with the direction of the reference lane or road s-axis. In other cases, + * Heading=Pitch=Roll=0 means the orientation is identical to the reference orientation. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOrientationWriter : public IOpenScenarioElementWriter, public IOrientation + { + public: + virtual ~IOrientationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Heading angle. Missing h value is interpreted as 0. Unit: [rad]. + * + * @return value of model property h + */ + virtual void SetH(const double h) = 0; + + /** + * From OpenSCENARIO class model specification: + * Pitch angle. Missing p value is interpreted as 0. Unit: [rad]. + * + * @return value of model property p + */ + virtual void SetP(const double p) = 0; + + /** + * From OpenSCENARIO class model specification: + * Roll angle. Missing r value is interpreted as 0. Unit: [rad]. + * + * @return value of model property r + */ + virtual void SetR(const double r) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative or absolute definition. Missing type value is interpreted as relative. + * + * @return value of model property type + */ + virtual void SetType(const ReferenceContext type) = 0; + + /** + * Set a parameter for the attribute h + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToH(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute p + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToP(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute r + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToR(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute type + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute h + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromH() const = 0; + /** + * Get the parameter for the attribute p + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromP() const = 0; + /** + * Get the parameter for the attribute r + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromR() const = 0; + /** + * Get the parameter for the attribute type + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromType() const = 0; + + /** + * Retrieves whether the attribute h is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsHParameterized() = 0; + /** + * Retrieves whether the attribute p is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPParameterized() = 0; + /** + * Retrieves whether the attribute r is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRParameterized() = 0; + /** + * Retrieves whether the attribute type is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTypeParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetH() will return false); + */ + virtual void ResetH() = 0; + + /** + * Resets the optional property (IsSetP() will return false); + */ + virtual void ResetP() = 0; + + /** + * Resets the optional property (IsSetR() will return false); + */ + virtual void ResetR() = 0; + + /** + * Resets the optional property (IsSetType() will return false); + */ + virtual void ResetType() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideBrakeAction' + * From OpenSCENARIO class model specification: + * Defines the state of the brake of a vehicle, when overriding a brake value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideBrakeActionWriter : public IOpenScenarioElementWriter, public IOverrideBrakeAction + { + public: + virtual ~IOverrideBrakeActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * Brake pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the brake pedal. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Input for the brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return value of model property brakeInput + */ + virtual void SetBrakeInput(std::shared_ptr brakeInput) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Input for the brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return a writer for model property brakeInput + */ + virtual std::shared_ptr GetWriterBrakeInput() const = 0; + + /** + * Resets the optional property (IsSetValue() will return false); + */ + virtual void ResetValue() = 0; + + /** + * Resets the optional property (IsSetBrakeInput() will return false); + */ + virtual void ResetBrakeInput() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideClutchAction' + * From OpenSCENARIO class model specification: + * Defines the state of the clutch of a vehicle, when overriding a clutch value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideClutchActionWriter : public IOpenScenarioElementWriter, public IOverrideClutchAction + { + public: + virtual ~IOverrideClutchActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new clutch position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual void SetMaxRate(const double maxRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Clutch pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the clutch pedal. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute maxRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxRate() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute maxRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxRateParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxRate() will return false); + */ + virtual void ResetMaxRate() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideControllerValueAction' + * From OpenSCENARIO class model specification: + * Overrides entity controller values. Mostly suited for motor vehicles. +It is assumed that a respective user-defined + * Controller is assigned to the entity, defined in the "movement" domain, and activated. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideControllerValueActionWriter : public IOpenScenarioElementWriter, public IOverrideControllerValueAction + { + public: + virtual ~IOverrideControllerValueActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * New value for throttle pedal position or unset value. + * + * @return value of model property throttle + */ + virtual void SetThrottle(std::shared_ptr throttle) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for brake position or unset value. + * + * @return value of model property brake + */ + virtual void SetBrake(std::shared_ptr brake) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for clutch position or unset value. + * + * @return value of model property clutch + */ + virtual void SetClutch(std::shared_ptr clutch) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for parking brake position or unset value. + * + * @return value of model property parkingBrake + */ + virtual void SetParkingBrake(std::shared_ptr parkingBrake) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for steering wheel position or unset value. + * + * @return value of model property steeringWheel + */ + virtual void SetSteeringWheel(std::shared_ptr steeringWheel) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for gear position or unset value. + * + * @return value of model property gear + */ + virtual void SetGear(std::shared_ptr gear) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * New value for throttle pedal position or unset value. + * + * @return a writer for model property throttle + */ + virtual std::shared_ptr GetWriterThrottle() const = 0; + /** + * From OpenSCENARIO class model specification: + * New value for brake position or unset value. + * + * @return a writer for model property brake + */ + virtual std::shared_ptr GetWriterBrake() const = 0; + /** + * From OpenSCENARIO class model specification: + * New value for clutch position or unset value. + * + * @return a writer for model property clutch + */ + virtual std::shared_ptr GetWriterClutch() const = 0; + /** + * From OpenSCENARIO class model specification: + * New value for parking brake position or unset value. + * + * @return a writer for model property parkingBrake + */ + virtual std::shared_ptr GetWriterParkingBrake() const = 0; + /** + * From OpenSCENARIO class model specification: + * New value for steering wheel position or unset value. + * + * @return a writer for model property steeringWheel + */ + virtual std::shared_ptr GetWriterSteeringWheel() const = 0; + /** + * From OpenSCENARIO class model specification: + * New value for gear position or unset value. + * + * @return a writer for model property gear + */ + virtual std::shared_ptr GetWriterGear() const = 0; + + /** + * Resets the optional property (IsSetThrottle() will return false); + */ + virtual void ResetThrottle() = 0; + + /** + * Resets the optional property (IsSetBrake() will return false); + */ + virtual void ResetBrake() = 0; + + /** + * Resets the optional property (IsSetClutch() will return false); + */ + virtual void ResetClutch() = 0; + + /** + * Resets the optional property (IsSetParkingBrake() will return false); + */ + virtual void ResetParkingBrake() = 0; + + /** + * Resets the optional property (IsSetSteeringWheel() will return false); + */ + virtual void ResetSteeringWheel() = 0; + + /** + * Resets the optional property (IsSetGear() will return false); + */ + virtual void ResetGear() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideGearAction' + * From OpenSCENARIO class model specification: + * Defines the state of the gear of a vehicle, when overriding a gear value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideGearActionWriter : public IOpenScenarioElementWriter, public IOverrideGearAction + { + public: + virtual ~IOverrideGearActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * Gear number. + * + * @return value of model property number + */ + virtual void SetNumber(const double number) = 0; + + /** + * From OpenSCENARIO class model specification: + * Gear description. + * + * @return value of model property gear + */ + virtual void SetGear(std::shared_ptr gear) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute number + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToNumber(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute number + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromNumber() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute number is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNumberParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Gear description. + * + * @return a writer for model property gear + */ + virtual std::shared_ptr GetWriterGear() const = 0; + + /** + * Resets the optional property (IsSetNumber() will return false); + */ + virtual void ResetNumber() = 0; + + /** + * Resets the optional property (IsSetGear() will return false); + */ + virtual void ResetGear() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideParkingBrakeAction' + * From OpenSCENARIO class model specification: + * Defines the state of the parking brake of a vehicle, when overriding a parking brake value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideParkingBrakeActionWriter : public IOpenScenarioElementWriter, public IOverrideParkingBrakeAction + { + public: + virtual ~IOverrideParkingBrakeActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * Parking brake value. Unit: [%]. Range: [0..1]. The value 1 represent the maximum parking brake state. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Input for the parking brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return value of model property brakeInput + */ + virtual void SetBrakeInput(std::shared_ptr brakeInput) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Input for the parking brake, either as force or percent. Should be set if the deprecated "value" is not used. + * + * @return a writer for model property brakeInput + */ + virtual std::shared_ptr GetWriterBrakeInput() const = 0; + + /** + * Resets the optional property (IsSetValue() will return false); + */ + virtual void ResetValue() = 0; + + /** + * Resets the optional property (IsSetBrakeInput() will return false); + */ + virtual void ResetBrakeInput() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideSteeringWheelAction' + * From OpenSCENARIO class model specification: + * Defines the state of the steering wheel of a vehicle, when overriding a steering wheel angle in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideSteeringWheelActionWriter : public IOpenScenarioElementWriter, public IOverrideSteeringWheelAction + { + public: + virtual ~IOverrideSteeringWheelActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new steering wheel position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual void SetMaxRate(const double maxRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * The maximum torque that can be applied to acquire/keep an angle. Unit: [Nm]. + * + * @return value of model property maxTorque + */ + virtual void SetMaxTorque(const double maxTorque) = 0; + + /** + * From OpenSCENARIO class model specification: + * Steering wheel angle. Unit: [rad]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxTorque + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxTorque(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute maxRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxRate() const = 0; + /** + * Get the parameter for the attribute maxTorque + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxTorque() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute maxRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxRateParameterized() = 0; + /** + * Retrieves whether the attribute maxTorque is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxTorqueParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxRate() will return false); + */ + virtual void ResetMaxRate() = 0; + + /** + * Resets the optional property (IsSetMaxTorque() will return false); + */ + virtual void ResetMaxTorque() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'OverrideThrottleAction' + * From OpenSCENARIO class model specification: + * Defines the state of the throttle of a vehicle, when overriding a throttle value in a ControllerAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOverrideThrottleActionWriter : public IOpenScenarioElementWriter, public IOverrideThrottleAction + { + public: + virtual ~IOverrideThrottleActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: override; false: stop overriding. + * + * @return value of model property active + */ + virtual void SetActive(const bool active) = 0; + + /** + * From OpenSCENARIO class model specification: + * The rate of how fast the new throttle position should be acquired. Unit: [%/s]. + * + * @return value of model property maxRate + */ + virtual void SetMaxRate(const double maxRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Throttle pedal value. Range: [0..1]. 0 represents 0%, 1 represents 100% of pressing the throttle pedal. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute active + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToActive(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute active + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromActive() const = 0; + /** + * Get the parameter for the attribute maxRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxRate() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute active is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsActiveParameterized() = 0; + /** + * Retrieves whether the attribute maxRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxRateParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxRate() will return false); + */ + virtual void ResetMaxRate() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterAction' + * From OpenSCENARIO class model specification: + * Set or modify a named parameter. (Be aware of the data type). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterActionWriter : public IOpenScenarioElementWriter, public IParameterAction + { + public: + virtual ~IParameterActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter. + * + * @return value of model property parameterRef + */ + virtual void SetParameterRef(std::shared_ptr> parameterRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for the parameter. + * + * @return value of model property setAction + */ + virtual void SetSetAction(std::shared_ptr setAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the parameter (Add value or multiply by value). + * + * @return value of model property modifyAction + */ + virtual void SetModifyAction(std::shared_ptr modifyAction) = 0; + + /** + * Set a parameter for the attribute parameterRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToParameterRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute parameterRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromParameterRef() const = 0; + + /** + * Retrieves whether the attribute parameterRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsParameterRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * New value for the parameter. + * + * @return a writer for model property setAction + */ + virtual std::shared_ptr GetWriterSetAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the parameter (Add value or multiply by value). + * + * @return a writer for model property modifyAction + */ + virtual std::shared_ptr GetWriterModifyAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterAddValueRule' + * From OpenSCENARIO class model specification: + * Defines an addition of a value to a parameter as part of a ModifyRule. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterAddValueRuleWriter : public IOpenScenarioElementWriter, public IParameterAddValueRule + { + public: + virtual ~IParameterAddValueRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Add value to existing parameter. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterAssignment' + * From OpenSCENARIO class model specification: + * Assignment of a value to a named parameter. It is either used when importing types of vehicles, controllers etc. from a + * catalog during startup of a simulator. It is also used when generating concrete scenarios from logical scenarios with + * ParameterValueSets during runtime of a scenario generator. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterAssignmentWriter : public IOpenScenarioElementWriter, public IParameterAssignment + { + public: + virtual ~IParameterAssignmentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter that must be declared in the catalog (when used in CatalogReference) or in the global + * ParameterDeclaration of the scenario (when used in ParameterValueSet). + * + * @return value of model property parameterRef + */ + virtual void SetParameterRef(std::shared_ptr> parameterRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter that is handed over to the parametrizable type. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterCondition' + * From OpenSCENARIO class model specification: + * Compares a named parameter's value to a reference value. The logical operator used for comparison is defined by the rule + * attribute Less and greater operator will only be supported if the value given as string can unambiguously be converted + * into a scalar value (e.g. value=5, value=16.667). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterConditionWriter : public IOpenScenarioElementWriter, public IParameterCondition + { + public: + virtual ~IParameterConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter that must be defined. + * + * @return value of model property parameterRef + */ + virtual void SetParameterRef(std::shared_ptr> parameterRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute parameterRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToParameterRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute parameterRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromParameterRef() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute parameterRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsParameterRefParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterDeclaration' + * From OpenSCENARIO class model specification: + * Declaration of a typed parameter with a name and a default value. It is used for creating variations of the same + * scenario by using the ParameterValueDistributionDefinition in an additional file. +There are two options for applying + * ParameterValueDistributions: + +* Pre-startup: Copy the scenario file and change/override the default value +* On startup: + * Keep the scenario file but on startup of the OSC Director inject parameter values e.g. through the command line. + +The + * value of a parameter cannot change after startup during runtime. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterDeclarationWriter : public IOpenScenarioElementWriter, public IParameterDeclaration + { + public: + virtual ~IParameterDeclarationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the parameter. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Type of the parameter. + * + * @return value of model property parameterType + */ + virtual void SetParameterType(const ParameterType parameterType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value of the parameter as its default value. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines zero or more constraint groups to the parameter value. Multiple constraint groups are combined by an OR. That + * means at least one constraint group has to evaluate to true to get the simulation started. If none of the constraint + * groups is satisfied the scenario should not be evaluated. + * + * @return value of model property constraintGroups + */ + virtual void SetConstraintGroups(std::vector>& constraintGroups) = 0; + + /** + * Set a parameter for the attribute parameterType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToParameterType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute parameterType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromParameterType() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute parameterType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsParameterTypeParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines zero or more constraint groups to the parameter value. Multiple constraint groups are combined by an OR. That + * means at least one constraint group has to evaluate to true to get the simulation started. If none of the constraint + * groups is satisfied the scenario should not be evaluated. + * + * @return a list of writers for model property constraintGroups + */ + virtual std::vector> GetWriterConstraintGroups() const = 0; + /** + * Resets the optional property (IsSetConstraintGroups() will return false); + */ + virtual void ResetConstraintGroups() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterModifyAction' + * From OpenSCENARIO class model specification: + * Modify a global parameter according to given rules. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterModifyActionWriter : public IOpenScenarioElementWriter, public IParameterModifyAction + { + public: + virtual ~IParameterModifyActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a parameter or multiply a parameter by a value. Has to match the parameter type. + * + * @return value of model property rule + */ + virtual void SetRule(std::shared_ptr rule) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a parameter or multiply a parameter by a value. Has to match the parameter type. + * + * @return a writer for model property rule + */ + virtual std::shared_ptr GetWriterRule() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterMultiplyByValueRule' + * From OpenSCENARIO class model specification: + * Multiply a parameter by a value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterMultiplyByValueRuleWriter : public IOpenScenarioElementWriter, public IParameterMultiplyByValueRule + { + public: + virtual ~IParameterMultiplyByValueRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Multiply existing parameter by the value (be aware of the parameter data type). + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterSetAction' + * From OpenSCENARIO class model specification: + * Setting a parameter to a given value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterSetActionWriter : public IOpenScenarioElementWriter, public IParameterSetAction + { + public: + virtual ~IParameterSetActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The new value for the parameter. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterValueDistribution' + * From OpenSCENARIO class model specification: + * The ParameterValueDistribution represents the top level container of a parameter distribution file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueDistributionWriter : public IOpenScenarioElementWriter, public IParameterValueDistribution + { + public: + virtual ~IParameterValueDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the scenario file which shall be linked to the parameter distribution file. + * + * @return value of model property scenarioFile + */ + virtual void SetScenarioFile(std::shared_ptr scenarioFile) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines distributions of the parameter which can be deterministic or stochastic + * + * @return value of model property distributionDefinition + */ + virtual void SetDistributionDefinition(std::shared_ptr distributionDefinition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the scenario file which shall be linked to the parameter distribution file. + * + * @return a writer for model property scenarioFile + */ + virtual std::shared_ptr GetWriterScenarioFile() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines distributions of the parameter which can be deterministic or stochastic + * + * @return a writer for model property distributionDefinition + */ + virtual std::shared_ptr GetWriterDistributionDefinition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterValueDistributionDefinition' + * From OpenSCENARIO class model specification: + * A marker stating that the OpenSCENARIO file is a parameter value distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueDistributionDefinitionWriter : public IOpenScenarioElementWriter, public IParameterValueDistributionDefinition + { + public: + virtual ~IParameterValueDistributionDefinitionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return value of model property parameterValueDistribution + */ + virtual void SetParameterValueDistribution(std::shared_ptr parameterValueDistribution) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Definition of a parameter value distribution. + * + * @return a writer for model property parameterValueDistribution + */ + virtual std::shared_ptr GetWriterParameterValueDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ParameterValueSet' + * From OpenSCENARIO class model specification: + * Set of parameter values that have to be assigned for a single concrete scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IParameterValueSetWriter : public IOpenScenarioElementWriter, public IParameterValueSet + { + public: + virtual ~IParameterValueSetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Assignment of a value to a named parameter. + * + * @return value of model property parameterAssignments + */ + virtual void SetParameterAssignments(std::vector>& parameterAssignments) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Assignment of a value to a named parameter. + * + * @return a list of writers for model property parameterAssignments + */ + virtual std::vector> GetWriterParameterAssignments() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Pedestrian' + * From OpenSCENARIO class model specification: + * Definition of a pedestrian type in a scenario or in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianWriter : public IOpenScenarioElementWriter, public IPedestrian, public ICatalogElementWriter + { + public: + virtual ~IPedestrianWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The mass of a pedestrian. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual void SetMass(const double mass) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the pedestrian. + * + * @return value of model property model + */ + virtual void SetModel(const std::string model) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the pedestrian as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual void SetModel3d(const std::string model3d) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the pedestrian type. Required when used in catalog. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Category type of pedestrian. + * + * @return value of model property pedestrianCategory + */ + virtual void SetPedestrianCategory(const PedestrianCategory pedestrianCategory) = 0; + + /** + * From OpenSCENARIO class model specification: + * Role of the pedestrian (police, civil,...). The default pedestrian role if not specified is None. + * + * @return value of model property role + */ + virtual void SetRole(const Role role) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Bounding box of the pedestrian. + * + * @return value of model property boundingBox + */ + virtual void SetBoundingBox(std::shared_ptr boundingBox) = 0; + + /** + * From OpenSCENARIO class model specification: + * Properties of the pedestrian. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute mass + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMass(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute model + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToModel(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute model3d + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToModel3d(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute pedestrianCategory + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPedestrianCategory(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute role + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRole(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute mass + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMass() const = 0; + /** + * Get the parameter for the attribute model + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromModel() const = 0; + /** + * Get the parameter for the attribute model3d + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromModel3d() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute pedestrianCategory + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPedestrianCategory() const = 0; + /** + * Get the parameter for the attribute role + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRole() const = 0; + + /** + * Retrieves whether the attribute mass is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMassParameterized() = 0; + /** + * Retrieves whether the attribute model is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsModelParameterized() = 0; + /** + * Retrieves whether the attribute model3d is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsModel3dParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute pedestrianCategory is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPedestrianCategoryParameterized() = 0; + /** + * Retrieves whether the attribute role is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoleParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Bounding box of the pedestrian. + * + * @return a writer for model property boundingBox + */ + virtual std::shared_ptr GetWriterBoundingBox() const = 0; + /** + * From OpenSCENARIO class model specification: + * Properties of the pedestrian. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetModel() will return false); + */ + virtual void ResetModel() = 0; + + /** + * Resets the optional property (IsSetModel3d() will return false); + */ + virtual void ResetModel3d() = 0; + + /** + * Resets the optional property (IsSetRole() will return false); + */ + virtual void ResetRole() = 0; + + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PedestrianAnimation' + * From OpenSCENARIO class model specification: + * Defines a pedestrian's motion and gestures. A motion will override a currently active motion. A conflicting gesture will + * override currently active gestures. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianAnimationWriter : public IOpenScenarioElementWriter, public IPedestrianAnimation + { + public: + virtual ~IPedestrianAnimationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Motion of a pedestrian. + * + * @return value of model property motion + */ + virtual void SetMotion(const PedestrianMotionType motion) = 0; + + /** + * From OpenSCENARIO class model specification: + * User defined pedestrian animation. + * + * @return value of model property userDefinedPedestrianAnimation + */ + virtual void SetUserDefinedPedestrianAnimation(const std::string userDefinedPedestrianAnimation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Gestures of a pedestrian. + * + * @return value of model property gestures + */ + virtual void SetGestures(std::vector>& gestures) = 0; + + /** + * Set a parameter for the attribute motion + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMotion(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute userDefinedPedestrianAnimation + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToUserDefinedPedestrianAnimation(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute motion + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMotion() const = 0; + /** + * Get the parameter for the attribute userDefinedPedestrianAnimation + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromUserDefinedPedestrianAnimation() const = 0; + + /** + * Retrieves whether the attribute motion is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMotionParameterized() = 0; + /** + * Retrieves whether the attribute userDefinedPedestrianAnimation is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsUserDefinedPedestrianAnimationParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Gestures of a pedestrian. + * + * @return a list of writers for model property gestures + */ + virtual std::vector> GetWriterGestures() const = 0; + /** + * Resets the optional property (IsSetMotion() will return false); + */ + virtual void ResetMotion() = 0; + + /** + * Resets the optional property (IsSetUserDefinedPedestrianAnimation() will return false); + */ + virtual void ResetUserDefinedPedestrianAnimation() = 0; + + /** + * Resets the optional property (IsSetGestures() will return false); + */ + virtual void ResetGestures() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PedestrianCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up pedestrian catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianCatalogLocationWriter : public IOpenScenarioElementWriter, public IPedestrianCatalogLocation + { + public: + virtual ~IPedestrianCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * File path for the pedestrian catalog files. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * File path for the pedestrian catalog files. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PedestrianGesture' + * From OpenSCENARIO class model specification: + * Defines a pedestrian's gesture. A conflicting gesture will override currently active gestures. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPedestrianGestureWriter : public IOpenScenarioElementWriter, public IPedestrianGesture + { + public: + virtual ~IPedestrianGestureWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Specific gesture of a pedestrian. + * + * @return value of model property gesture + */ + virtual void SetGesture(const PedestrianGestureType gesture) = 0; + + /** + * Set a parameter for the attribute gesture + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToGesture(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute gesture + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromGesture() const = 0; + + /** + * Retrieves whether the attribute gesture is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsGestureParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Performance' + * From OpenSCENARIO class model specification: + * Container for Performance values of a vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPerformanceWriter : public IOpenScenarioElementWriter, public IPerformance + { + public: + virtual ~IPerformanceWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration of the vehicle. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxAcceleration + */ + virtual void SetMaxAcceleration(const double maxAcceleration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum acceleration rate of the vehicle. Unit: [m/s³]. Range: [0..inf[. If omitted then infinity is assumed. + * + * @return value of model property maxAccelerationRate + */ + virtual void SetMaxAccelerationRate(const double maxAccelerationRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration of the vehicle. Unit: [m/s²]. Range: [0..inf[. + * + * @return value of model property maxDeceleration + */ + virtual void SetMaxDeceleration(const double maxDeceleration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum deceleration rate of the vehicle. Unit: [m/s³]. Range: [0..inf[. If omitted then infinity is assumed. + * + * @return value of model property maxDecelerationRate + */ + virtual void SetMaxDecelerationRate(const double maxDecelerationRate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Maximum speed of the vehicle. Unit: [m/s]. + * + * @return value of model property maxSpeed + */ + virtual void SetMaxSpeed(const double maxSpeed) = 0; + + /** + * Set a parameter for the attribute maxAcceleration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxAcceleration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxAccelerationRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxAccelerationRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxDeceleration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxDeceleration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxDecelerationRate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxDecelerationRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute maxSpeed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMaxSpeed(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute maxAcceleration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxAcceleration() const = 0; + /** + * Get the parameter for the attribute maxAccelerationRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxAccelerationRate() const = 0; + /** + * Get the parameter for the attribute maxDeceleration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxDeceleration() const = 0; + /** + * Get the parameter for the attribute maxDecelerationRate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxDecelerationRate() const = 0; + /** + * Get the parameter for the attribute maxSpeed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMaxSpeed() const = 0; + + /** + * Retrieves whether the attribute maxAcceleration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxAccelerationParameterized() = 0; + /** + * Retrieves whether the attribute maxAccelerationRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxAccelerationRateParameterized() = 0; + /** + * Retrieves whether the attribute maxDeceleration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxDecelerationParameterized() = 0; + /** + * Retrieves whether the attribute maxDecelerationRate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxDecelerationRateParameterized() = 0; + /** + * Retrieves whether the attribute maxSpeed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMaxSpeedParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetMaxAccelerationRate() will return false); + */ + virtual void ResetMaxAccelerationRate() = 0; + + /** + * Resets the optional property (IsSetMaxDecelerationRate() will return false); + */ + virtual void ResetMaxDecelerationRate() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Phase' + * From OpenSCENARIO class model specification: + * Phase of a TrafficSignalController. A TrafficSignalController has sequential semantic phases, forming the signal cycle. + * Each semantic phase can have multiple TrafficSignalStates or one TrafficSignalGroupState (mutually exclusive). When + * TrafficSignalStates are used to model the observable states of a traffic signal individually, exactly one + * TrafficSignalState has to be defined for every traffic signal controlled by this TrafficSignalController. The semantic + * phase information like go, attention, stop, etc. is set in Phase attribute name and the observable state like the visual + * information "off;off;on" in trafficSignalStates or trafficSignalGroupState. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPhaseWriter : public IOpenScenarioElementWriter, public IPhase + { + public: + virtual ~IPhaseWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Duration of the phase. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual void SetDuration(const double duration) = 0; + + /** + * From OpenSCENARIO class model specification: + * Semantic information about the phase. Typical values are: off, stop, attention, stop_attention, go, go_exclusive + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Each phase can have multiple TrafficSignalStates to provide the observable state for all traffic signals individually + * that are controlled by the controller. One for each TrafficSignal. E.g. name="go" (trafficSignal1:"off;off;on", + * trafficSignal2:"off;off;on"). + * + * @return value of model property trafficSignalStates + */ + virtual void SetTrafficSignalStates(std::vector>& trafficSignalStates) = 0; + + /** + * From OpenSCENARIO class model specification: + * Each phase can have one TrafficSignalGroupState to provide the observable state for all traffic signals that are + * controlled by the controller if they share the same state. E.g. name="go" ("off;off;on"). + * + * @return value of model property trafficSignalGroupState + */ + virtual void SetTrafficSignalGroupState(std::shared_ptr trafficSignalGroupState) = 0; + + /** + * Set a parameter for the attribute duration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDuration(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute duration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDuration() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute duration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDurationParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Each phase can have one TrafficSignalGroupState to provide the observable state for all traffic signals that are + * controlled by the controller if they share the same state. E.g. name="go" ("off;off;on"). + * + * @return a writer for model property trafficSignalGroupState + */ + virtual std::shared_ptr GetWriterTrafficSignalGroupState() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Each phase can have multiple TrafficSignalStates to provide the observable state for all traffic signals individually + * that are controlled by the controller. One for each TrafficSignal. E.g. name="go" (trafficSignal1:"off;off;on", + * trafficSignal2:"off;off;on"). + * + * @return a list of writers for model property trafficSignalStates + */ + virtual std::vector> GetWriterTrafficSignalStates() const = 0; + /** + * Resets the optional property (IsSetTrafficSignalStates() will return false); + */ + virtual void ResetTrafficSignalStates() = 0; + + /** + * Resets the optional property (IsSetTrafficSignalGroupState() will return false); + */ + virtual void ResetTrafficSignalGroupState() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PoissonDistribution' + * From OpenSCENARIO class model specification: + * Poisson distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPoissonDistributionWriter : public IOpenScenarioElementWriter, public IPoissonDistribution + { + public: + virtual ~IPoissonDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the expected value for a poisson distribution. + * + * @return value of model property expectedValue + */ + virtual void SetExpectedValue(const double expectedValue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and the upper limit of the poisson distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + /** + * Set a parameter for the attribute expectedValue + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToExpectedValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute expectedValue + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromExpectedValue() const = 0; + + /** + * Retrieves whether the attribute expectedValue is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsExpectedValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and the upper limit of the poisson distribution regarding to the definition space. + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + /** + * Resets the optional property (IsSetRange() will return false); + */ + virtual void ResetRange() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Polygon' + * From OpenSCENARIO class model specification: + * Defines an area by a polygon. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPolygonWriter : public IOpenScenarioElementWriter, public IPolygon + { + public: + virtual ~IPolygonWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A minimum of 3 positions must be provided to form a polygon. + * + * @return value of model property positions + */ + virtual void SetPositions(std::vector>& positions) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * A minimum of 3 positions must be provided to form a polygon. + * + * @return a list of writers for model property positions + */ + virtual std::vector> GetWriterPositions() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Polyline' + * From OpenSCENARIO class model specification: + * Polygonal chain (polyline) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPolylineWriter : public IOpenScenarioElementWriter, public IPolyline + { + public: + virtual ~IPolylineWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Ordered chain of vertices of the polygonal chain. + * + * @return value of model property vertices + */ + virtual void SetVertices(std::vector>& vertices) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Ordered chain of vertices of the polygonal chain. + * + * @return a list of writers for model property vertices + */ + virtual std::vector> GetWriterVertices() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Position' + * From OpenSCENARIO class model specification: + * Container for position types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionWriter : public IOpenScenarioElementWriter, public IPosition + { + public: + virtual ~IPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Position that uses global coordinates. + * + * @return value of model property worldPosition + */ + virtual void SetWorldPosition(std::shared_ptr worldPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity, expressed in world coordinates. + * + * @return value of model property relativeWorldPosition + */ + virtual void SetRelativeWorldPosition(std::shared_ptr relativeWorldPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity. + * + * @return value of model property relativeObjectPosition + */ + virtual void SetRelativeObjectPosition(std::shared_ptr relativeObjectPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position in road coordinates (t,s) applied to a given road. + * + * @return value of model property roadPosition + */ + virtual void SetRoadPosition(std::shared_ptr roadPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position relative to an entity's road position (ds, dt). + * + * @return value of model property relativeRoadPosition + */ + virtual void SetRelativeRoadPosition(std::shared_ptr relativeRoadPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a lane (lane ID) and the s coordinate of a given road. + * + * @return value of model property lanePosition + */ + virtual void SetLanePosition(std::shared_ptr lanePosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position that is determined relative to the lane coordinates of a given entity. (Relative lane and relative s to this + * entity). + * + * @return value of model property relativeLanePosition + */ + virtual void SetRelativeLanePosition(std::shared_ptr relativeLanePosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given route. + * + * @return value of model property routePosition + */ + virtual void SetRoutePosition(std::shared_ptr routePosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position that uses geo coordinates + * + * @return value of model property geoPosition + */ + virtual void SetGeoPosition(std::shared_ptr geoPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given trajectory. + * + * @return value of model property trajectoryPosition + */ + virtual void SetTrajectoryPosition(std::shared_ptr trajectoryPosition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Position that uses global coordinates. + * + * @return a writer for model property worldPosition + */ + virtual std::shared_ptr GetWriterWorldPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity, expressed in world coordinates. + * + * @return a writer for model property relativeWorldPosition + */ + virtual std::shared_ptr GetWriterRelativeWorldPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position is given relative to an entity. + * + * @return a writer for model property relativeObjectPosition + */ + virtual std::shared_ptr GetWriterRelativeObjectPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position in road coordinates (t,s) applied to a given road. + * + * @return a writer for model property roadPosition + */ + virtual std::shared_ptr GetWriterRoadPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position relative to an entity's road position (ds, dt). + * + * @return a writer for model property relativeRoadPosition + */ + virtual std::shared_ptr GetWriterRelativeRoadPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a lane (lane ID) and the s coordinate of a given road. + * + * @return a writer for model property lanePosition + */ + virtual std::shared_ptr GetWriterLanePosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position that is determined relative to the lane coordinates of a given entity. (Relative lane and relative s to this + * entity). + * + * @return a writer for model property relativeLanePosition + */ + virtual std::shared_ptr GetWriterRelativeLanePosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given route. + * + * @return a writer for model property routePosition + */ + virtual std::shared_ptr GetWriterRoutePosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position that uses geo coordinates + * + * @return a writer for model property geoPosition + */ + virtual std::shared_ptr GetWriterGeoPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position that is determined by a given trajectory. + * + * @return a writer for model property trajectoryPosition + */ + virtual std::shared_ptr GetWriterTrajectoryPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PositionInLaneCoordinates' + * From OpenSCENARIO class model specification: + * Defines a coordinate along a lane with a given s coordinate and lane ID. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionInLaneCoordinatesWriter : public IOpenScenarioElementWriter, public IPositionInLaneCoordinates + { + public: + virtual ~IPositionInLaneCoordinatesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Lane ID of the actual position. + * + * @return value of model property laneId + */ + virtual void SetLaneId(const std::string laneId) = 0; + + /** + * From OpenSCENARIO class model specification: + * Lateral offset (relative to the lane centerline) of the actual position. If omitted, the lane offset is interpreted as + * 0. Unit: [m]. + * + * @return value of model property laneOffset + */ + virtual void SetLaneOffset(const double laneOffset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position in s coordinates along the reference line of the route. Unit: [m]. Range: [0..inf[. + * + * @return value of model property pathS + */ + virtual void SetPathS(const double pathS) = 0; + + /** + * Set a parameter for the attribute laneId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLaneId(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute laneOffset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLaneOffset(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute pathS + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPathS(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute laneId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLaneId() const = 0; + /** + * Get the parameter for the attribute laneOffset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLaneOffset() const = 0; + /** + * Get the parameter for the attribute pathS + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPathS() const = 0; + + /** + * Retrieves whether the attribute laneId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLaneIdParameterized() = 0; + /** + * Retrieves whether the attribute laneOffset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLaneOffsetParameterized() = 0; + /** + * Retrieves whether the attribute pathS is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPathSParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetLaneOffset() will return false); + */ + virtual void ResetLaneOffset() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PositionInRoadCoordinates' + * From OpenSCENARIO class model specification: + * Position defined in terms of distance along a route (pathS) and lateral offset from the route's reference line (t) at + * that point. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionInRoadCoordinatesWriter : public IOpenScenarioElementWriter, public IPositionInRoadCoordinates + { + public: + virtual ~IPositionInRoadCoordinatesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Position in s coordinates along the reference line of the route. + * + * @return value of model property pathS + */ + virtual void SetPathS(const double pathS) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position in t coordinates orthogonal to the reference line of the route. + * + * @return value of model property t + */ + virtual void SetT(const double t) = 0; + + /** + * Set a parameter for the attribute pathS + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPathS(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute t + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToT(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute pathS + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPathS() const = 0; + /** + * Get the parameter for the attribute t + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromT() const = 0; + + /** + * Retrieves whether the attribute pathS is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPathSParameterized() = 0; + /** + * Retrieves whether the attribute t is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PositionOfCurrentEntity' + * From OpenSCENARIO class model specification: + * Reference to the current Entity. The position in a route is defined through the position of this entity (used in + * RoutePosition). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPositionOfCurrentEntityWriter : public IOpenScenarioElementWriter, public IPositionOfCurrentEntity + { + public: + virtual ~IPositionOfCurrentEntityWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference to an entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Precipitation' + * From OpenSCENARIO class model specification: + * Defines a precipitation by type and value of a weather. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrecipitationWriter : public IOpenScenarioElementWriter, public IPrecipitation + { + public: + virtual ~IPrecipitationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The intensity of the precipitation. Range: [0..1]. + * + * @return value of model property intensity + */ + virtual void SetIntensity(const double intensity) = 0; + + /** + * From OpenSCENARIO class model specification: + * The intensity of the precipitation (valid for all precipitation types). Unit: [mm/h]. Range: [0..inf[. + * + * @return value of model property precipitationIntensity + */ + virtual void SetPrecipitationIntensity(const double precipitationIntensity) = 0; + + /** + * From OpenSCENARIO class model specification: + * Type of the precipitation. + * + * @return value of model property precipitationType + */ + virtual void SetPrecipitationType(const PrecipitationType precipitationType) = 0; + + /** + * Set a parameter for the attribute intensity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToIntensity(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute precipitationIntensity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPrecipitationIntensity(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute precipitationType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPrecipitationType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute intensity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromIntensity() const = 0; + /** + * Get the parameter for the attribute precipitationIntensity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPrecipitationIntensity() const = 0; + /** + * Get the parameter for the attribute precipitationType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPrecipitationType() const = 0; + + /** + * Retrieves whether the attribute intensity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsIntensityParameterized() = 0; + /** + * Retrieves whether the attribute precipitationIntensity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPrecipitationIntensityParameterized() = 0; + /** + * Retrieves whether the attribute precipitationType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPrecipitationTypeParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetIntensity() will return false); + */ + virtual void ResetIntensity() = 0; + + /** + * Resets the optional property (IsSetPrecipitationIntensity() will return false); + */ + virtual void ResetPrecipitationIntensity() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Private' + * From OpenSCENARIO class model specification: + * Container for private actions assigned to one specific entity and used in the initialization phase of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrivateWriter : public IOpenScenarioElementWriter, public IPrivate + { + public: + virtual ~IPrivateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of private actions to be executed when the enclosing container gets triggered. + * + * @return value of model property privateActions + */ + virtual void SetPrivateActions(std::vector>& privateActions) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * List of private actions to be executed when the enclosing container gets triggered. + * + * @return a list of writers for model property privateActions + */ + virtual std::vector> GetWriterPrivateActions() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'PrivateAction' + * From OpenSCENARIO class model specification: + * Actions applied to one or multiple entities. Either the entities are referenced in the actors of the enclosing maneuver + * group or the single entity is referenced in the enclosing Private instance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPrivateActionWriter : public IOpenScenarioElementWriter, public IPrivateAction + { + public: + virtual ~IPrivateActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Applies longitudinal control behavior on the reference entity/entities. Either a SpeedAction, LongitudinalDistanceAction + * or a SpeedProfileAction. + * + * @return value of model property longitudinalAction + */ + virtual void SetLongitudinalAction(std::shared_ptr longitudinalAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Applies lateral control behavior on the reference entity/entities. Either a LaneChangeAction, LaneOffsetAction or a + * LateralDistanceAction. + * + * @return value of model property lateralAction + */ + virtual void SetLateralAction(std::shared_ptr lateralAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Sets visibility attributes on the reference entity/entities. + * + * @return value of model property visibilityAction + */ + virtual void SetVisibilityAction(std::shared_ptr visibilityAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Synchronizes the reference entity/entities with a master entity. A target position is provided for the entity and for + * the master entity to be reached at the same time. + * + * @return value of model property synchronizeAction + */ + virtual void SetSynchronizeAction(std::shared_ptr synchronizeAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Activates/ deactivates a controller on the reference entity/entities. + * + * @return value of model property activateControllerAction + */ + virtual void SetActivateControllerAction(std::shared_ptr activateControllerAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to the reference entity/entities. + * + * @return value of model property controllerAction + */ + virtual void SetControllerAction(std::shared_ptr controllerAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Assigns a position to the reference entity/entities. + * + * @return value of model property teleportAction + */ + virtual void SetTeleportAction(std::shared_ptr teleportAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Applies an AssignRouteAction, a FollowTrajectoryAction or an AcquirePositionAction to the reference entity/entities. + * + * @return value of model property routingAction + */ + virtual void SetRoutingAction(std::shared_ptr routingAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the behaviour of an entity without moving it in the world, e.g. turning on a light or opening a door. + * + * @return value of model property appearanceAction + */ + virtual void SetAppearanceAction(std::shared_ptr appearanceAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Connect or disconnect trailer. + * + * @return value of model property trailerAction + */ + virtual void SetTrailerAction(std::shared_ptr trailerAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Applies longitudinal control behavior on the reference entity/entities. Either a SpeedAction, LongitudinalDistanceAction + * or a SpeedProfileAction. + * + * @return a writer for model property longitudinalAction + */ + virtual std::shared_ptr GetWriterLongitudinalAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Applies lateral control behavior on the reference entity/entities. Either a LaneChangeAction, LaneOffsetAction or a + * LateralDistanceAction. + * + * @return a writer for model property lateralAction + */ + virtual std::shared_ptr GetWriterLateralAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Sets visibility attributes on the reference entity/entities. + * + * @return a writer for model property visibilityAction + */ + virtual std::shared_ptr GetWriterVisibilityAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Synchronizes the reference entity/entities with a master entity. A target position is provided for the entity and for + * the master entity to be reached at the same time. + * + * @return a writer for model property synchronizeAction + */ + virtual std::shared_ptr GetWriterSynchronizeAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Activates/ deactivates a controller on the reference entity/entities. + * + * @return a writer for model property activateControllerAction + */ + virtual std::shared_ptr GetWriterActivateControllerAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Assigns a controller to the reference entity/entities. + * + * @return a writer for model property controllerAction + */ + virtual std::shared_ptr GetWriterControllerAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Assigns a position to the reference entity/entities. + * + * @return a writer for model property teleportAction + */ + virtual std::shared_ptr GetWriterTeleportAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Applies an AssignRouteAction, a FollowTrajectoryAction or an AcquirePositionAction to the reference entity/entities. + * + * @return a writer for model property routingAction + */ + virtual std::shared_ptr GetWriterRoutingAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the behaviour of an entity without moving it in the world, e.g. turning on a light or opening a door. + * + * @return a writer for model property appearanceAction + */ + virtual std::shared_ptr GetWriterAppearanceAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Connect or disconnect trailer. + * + * @return a writer for model property trailerAction + */ + virtual std::shared_ptr GetWriterTrailerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ProbabilityDistributionSet' + * From OpenSCENARIO class model specification: + * Container for a set of single values with a defined probability. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProbabilityDistributionSetWriter : public IOpenScenarioElementWriter, public IProbabilityDistributionSet + { + public: + virtual ~IProbabilityDistributionSetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines set of elements with a defined probability. + * + * @return value of model property elements + */ + virtual void SetElements(std::vector>& elements) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines set of elements with a defined probability. + * + * @return a list of writers for model property elements + */ + virtual std::vector> GetWriterElements() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ProbabilityDistributionSetElement' + * From OpenSCENARIO class model specification: + * Indicates a value and probability in a stochastic distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IProbabilityDistributionSetElementWriter : public IOpenScenarioElementWriter, public IProbabilityDistributionSetElement + { + public: + virtual ~IProbabilityDistributionSetElementWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A possible value in a stochastic distribution. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * From OpenSCENARIO class model specification: + * This is used to define a propability of occurences for a specific value. Instead of a probability a defined count or + * weight has to be defined. The probability can be calculated by the (1/sum(all weights in the + * ProbabilityDistributionSet)) * weight. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Properties' + * From OpenSCENARIO class model specification: + * Container for one or more properties. Properties encloses multiple property instances and/or multiple file references. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPropertiesWriter : public IOpenScenarioElementWriter, public IProperties + { + public: + virtual ~IPropertiesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A name/value pair. The semantic of the name/values are subject of a contract between the provider of a simulation + * environment and the author of a scenario. + * + * @return value of model property properties + */ + virtual void SetProperties(std::vector>& properties) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of arbitrary files attached to an object that owns the properties. The semantic and the file formats are subject + * of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property files + */ + virtual void SetFiles(std::vector>& files) = 0; + + /** + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return value of model property customContent + */ + virtual void SetCustomContent(std::vector>& customContent) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * A name/value pair. The semantic of the name/values are subject of a contract between the provider of a simulation + * environment and the author of a scenario. + * + * @return a list of writers for model property properties + */ + virtual std::vector> GetWriterProperties() const = 0; + /** + * From OpenSCENARIO class model specification: + * A list of arbitrary files attached to an object that owns the properties. The semantic and the file formats are subject + * of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return a list of writers for model property files + */ + virtual std::vector> GetWriterFiles() const = 0; + /** + * From OpenSCENARIO class model specification: + * The semantic is subject of a contract between the provider of a simulation environment and the author of a scenario. + * + * @return a list of writers for model property customContent + */ + virtual std::vector> GetWriterCustomContent() const = 0; + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + /** + * Resets the optional property (IsSetFiles() will return false); + */ + virtual void ResetFiles() = 0; + + /** + * Resets the optional property (IsSetCustomContent() will return false); + */ + virtual void ResetCustomContent() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Property' + * From OpenSCENARIO class model specification: + * Definition of a property by name and value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IPropertyWriter : public IOpenScenarioElementWriter, public IProperty + { + public: + virtual ~IPropertyWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of a user defined property. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value of a user defined property. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RandomRouteAction' + * From OpenSCENARIO class model specification: + * If an entity approaches a junction, the road to follow is selected randomly from the available options. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRandomRouteActionWriter : public IOpenScenarioElementWriter, public IRandomRouteAction + { + public: + virtual ~IRandomRouteActionWriter() = default; + + + + + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Range' + * From OpenSCENARIO class model specification: + * Indicates a range for a distribution where the following rule applies: lowerLimit <= value <= upperLimit. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRangeWriter : public IOpenScenarioElementWriter, public IRange + { + public: + virtual ~IRangeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit of a range. + * + * @return value of model property lowerLimit + */ + virtual void SetLowerLimit(const double lowerLimit) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the upper limit of a range. + * + * @return value of model property upperLimit + */ + virtual void SetUpperLimit(const double upperLimit) = 0; + + /** + * Set a parameter for the attribute lowerLimit + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLowerLimit(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute upperLimit + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToUpperLimit(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute lowerLimit + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLowerLimit() const = 0; + /** + * Get the parameter for the attribute upperLimit + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromUpperLimit() const = 0; + + /** + * Retrieves whether the attribute lowerLimit is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLowerLimitParameterized() = 0; + /** + * Retrieves whether the attribute upperLimit is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsUpperLimitParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ReachPositionCondition' + * From OpenSCENARIO class model specification: + * Checks if a triggering entity/entities has reached a given position, within some user specified tolerance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IReachPositionConditionWriter : public IOpenScenarioElementWriter, public IReachPositionCondition + { + public: + virtual ~IReachPositionConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given position. Unit: [m]. Range: [0..inf[. + * + * @return value of model property tolerance + */ + virtual void SetTolerance(const double tolerance) = 0; + + /** + * From OpenSCENARIO class model specification: + * The position to be reached with the defined tolerance. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute tolerance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTolerance(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute tolerance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTolerance() const = 0; + + /** + * Retrieves whether the attribute tolerance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsToleranceParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The position to be reached with the defined tolerance. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeAngleCondition' + * From OpenSCENARIO class model specification: + * Checks if the relative angle of the triggering entity, measured with respect to the reference entity, has reached a + * given value, within some user-specified angle tolerance. + +The relative angle is generally measured as angle of the + * triggering entity minus angle of the reference entity. +Both angles must be measured in the same coordinate system, as + * specified by the user. + +When the entity value is used, the angles are measured in the local coordinate system of the + * reference entity. +Note that for the s-t coordinate systems the orientation is measured at the local s-coordinate of each + * entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeAngleConditionWriter : public IOpenScenarioElementWriter, public IRelativeAngleCondition + { + public: + virtual ~IRelativeAngleConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The angle to be reached with the defined tolerance. Unit: [rad]. Range: [-pi..pi]. + * + * @return value of model property angle + */ + virtual void SetAngle(const double angle) = 0; + + /** + * From OpenSCENARIO class model specification: + * Tolerance around the given angle value. Unit: [rad]. Range: [0..pi]. + * + * @return value of model property angleTolerance + */ + virtual void SetAngleTolerance(const double angleTolerance) = 0; + + /** + * From OpenSCENARIO class model specification: + * The angular coordinate to be used for the condition. + * + * @return value of model property angleType + */ + virtual void SetAngleType(const AngleType angleType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Define which coordinate system is used to measure the angles of the reference entity and the triggering entity. Default: + * entity. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * Set a parameter for the attribute angle + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngle(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute angleTolerance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngleTolerance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute angleType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAngleType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute angle + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngle() const = 0; + /** + * Get the parameter for the attribute angleTolerance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngleTolerance() const = 0; + /** + * Get the parameter for the attribute angleType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAngleType() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute angle is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleParameterized() = 0; + /** + * Retrieves whether the attribute angleTolerance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleToleranceParameterized() = 0; + /** + * Retrieves whether the attribute angleType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAngleTypeParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeClearanceCondition' + * From OpenSCENARIO class model specification: + * Checks if an amount of lanes next to the triggering entity is free from other entities. Evaluates to true, if the + * specified area exists and is free, otherwise evaluates to false. The longitudinal distance to be checked is defined in + * the lane coordinate system of the current lane of the triggering entity. In lateral direction the checked area is + * defined by the lane boundaries. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeClearanceConditionWriter : public IOpenScenarioElementWriter, public IRelativeClearanceCondition + { + public: + virtual ~IRelativeClearanceConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Longitudinal distance behind reference point of the entity to be checked along lane centerline of the current lane of + * the triggering entity. Orientation of entity towards lane determines backward direction. Velocity of entity is + * irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0 + * + * @return value of model property distanceBackward + */ + virtual void SetDistanceBackward(const double distanceBackward) = 0; + + /** + * From OpenSCENARIO class model specification: + * Longitudinal distance in front of reference point of the entity to be checked along lane centerline of the current lane + * of the triggering entity. Orientation of entity towards lane determines forward direction. Velocity of entity is + * irrelevant. Unit: [m]. Range: [0..inf[. Default if omitted: 0 + * + * @return value of model property distanceForward + */ + virtual void SetDistanceForward(const double distanceForward) = 0; + + /** + * From OpenSCENARIO class model specification: + * If false, then entityRefs are only considered to be on the lane if their reference point is within the checked area; + * otherwise the whole bounding box is considered. + * + * @return value of model property freeSpace + */ + virtual void SetFreeSpace(const bool freeSpace) = 0; + + /** + * From OpenSCENARIO class model specification: + * If true, then also lanes in the opposite direction are considered; otherwise only lanes in the same direction are + * considered. + * + * @return value of model property oppositeLanes + */ + virtual void SetOppositeLanes(const bool oppositeLanes) = 0; + + /** + * From OpenSCENARIO class model specification: + * The lanes to be checked to left and right of the triggering entity (positive to the y-axis). If omitted: all lanes are + * checked. + * + * @return value of model property relativeLaneRange + */ + virtual void SetRelativeLaneRange(std::vector>& relativeLaneRange) = 0; + + /** + * From OpenSCENARIO class model specification: + * Constraint to check only specific entities. If it is not used then all entities are considered. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::vector>& entityRef) = 0; + + /** + * Set a parameter for the attribute distanceBackward + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDistanceBackward(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute distanceForward + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDistanceForward(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freeSpace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreeSpace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute oppositeLanes + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOppositeLanes(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute distanceBackward + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDistanceBackward() const = 0; + /** + * Get the parameter for the attribute distanceForward + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDistanceForward() const = 0; + /** + * Get the parameter for the attribute freeSpace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreeSpace() const = 0; + /** + * Get the parameter for the attribute oppositeLanes + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOppositeLanes() const = 0; + + /** + * Retrieves whether the attribute distanceBackward is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDistanceBackwardParameterized() = 0; + /** + * Retrieves whether the attribute distanceForward is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDistanceForwardParameterized() = 0; + /** + * Retrieves whether the attribute freeSpace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreeSpaceParameterized() = 0; + /** + * Retrieves whether the attribute oppositeLanes is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOppositeLanesParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * The lanes to be checked to left and right of the triggering entity (positive to the y-axis). If omitted: all lanes are + * checked. + * + * @return a list of writers for model property relativeLaneRange + */ + virtual std::vector> GetWriterRelativeLaneRange() const = 0; + /** + * From OpenSCENARIO class model specification: + * Constraint to check only specific entities. If it is not used then all entities are considered. + * + * @return a list of writers for model property entityRef + */ + virtual std::vector> GetWriterEntityRef() const = 0; + /** + * Resets the optional property (IsSetDistanceBackward() will return false); + */ + virtual void ResetDistanceBackward() = 0; + + /** + * Resets the optional property (IsSetDistanceForward() will return false); + */ + virtual void ResetDistanceForward() = 0; + + /** + * Resets the optional property (IsSetRelativeLaneRange() will return false); + */ + virtual void ResetRelativeLaneRange() = 0; + + /** + * Resets the optional property (IsSetEntityRef() will return false); + */ + virtual void ResetEntityRef() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeDistanceCondition' + * From OpenSCENARIO class model specification: + * The current relative distance of a triggering entity/entities to a reference entity is compared to a given value. The + * logical operator used for comparison is defined in the rule attribute. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeDistanceConditionWriter : public IOpenScenarioElementWriter, public IRelativeDistanceCondition + { + public: + virtual ~IRelativeDistanceConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: distance is measured between closest bounding box points. False: reference point distance is used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. + * + * @return value of model property relativeDistanceType + */ + virtual void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * The distance value. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute relativeDistanceType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRelativeDistanceType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute routingAlgorithm + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoutingAlgorithm(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + /** + * Get the parameter for the attribute relativeDistanceType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRelativeDistanceType() const = 0; + /** + * Get the parameter for the attribute routingAlgorithm + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoutingAlgorithm() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + /** + * Retrieves whether the attribute relativeDistanceType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRelativeDistanceTypeParameterized() = 0; + /** + * Retrieves whether the attribute routingAlgorithm is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoutingAlgorithmParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetRoutingAlgorithm() will return false); + */ + virtual void ResetRoutingAlgorithm() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeLanePosition' + * From OpenSCENARIO class model specification: + * Defines a position derived from relative lane coordinates (dLane, ds / dsLane and offset) to a reference entity. +Where + * ds is provided, the position is computed by the following process: +  +

    +
  1. Find the closest road reference line + * point to the reference entity. Travel the road reference line difference ds from the position of the reference + * entity.
  2. +
  3. Find the target lane by adding dLane to that of the reference entity and the intersection of the road + * reference line's normal with its center lane.
  4. +
  5. Apply offset as a lateral offset.
  6. +
+ +Alternatively + * where dsLane is provided, the following process is used: +  +
    +
  1. Find the closest lane center line point to the + * reference entity. Travel the lane center line difference dsLane from the position of the reference entity in the + * direction the reference entity is facing.
  2. +
  3. Find the target lane by adding dLane to that of the reference + * entity's and the intersection of the source lane's center lane normal with its center lane.
  4. +
  5. Apply offset as a + * lateral offset.
  6. +
+ +The target position may be either on the same road segment (defined by roadId), where the + * reference entity is positioned, or on a connecting road. In the latter case, the ds-coordinate is calculated assuming + * that the reference line of the road of the reference entity continues seamlessly on the connecting road (even if its + * shape changes). It is also assumed that the lane, where the reference entity is located, continues seamlessly on the + * connecting road (provided the lane's center line is unbroken between roads). It is assumed that the target position + * relates to the routing of the reference entity. Otherwise, the calculation of the target position cannot be interpreted + * within the OpenSCENARIO standard. + +The relative lane coordinates (dLane, ds/dsLane, and offset) should be specified so + * that the target position is within a road defined by roadId taken from the respective road network definition file + * (external to the ASAM OpenSCENARIO). If the target position would be outside the road boundaries, the z-coordinate of + * the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeLanePositionWriter : public IOpenScenarioElementWriter, public IRelativeLanePosition + { + public: + virtual ~IRelativeLanePositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The deviation value between the laneId of the lane, where the reference entity is located, and the target laneId. + * + * @return value of model property dLane + */ + virtual void SetDLane(const int dLane) = 0; + + /** + * From OpenSCENARIO class model specification: + * The offset along the road's reference line relative to the s-coordinate of the reference entity. Mutually exclusive with + * dsLane. Unit: [m]. + * + * @return value of model property ds + */ + virtual void SetDs(const double ds) = 0; + + /** + * From OpenSCENARIO class model specification: + * The offset along the center line of the lane, where the reference entity is located. Mutually exclusive with ds. Unit: + * [m]. + * + * @return value of model property dsLane + */ + virtual void SetDsLane(const double dsLane) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The lateral offset to the center line of the target lane (along the t-axis of the target lane center line). Missing + * value is interpreted as 0. The positive value means the offset is applied in the direction of the t-axis being imagined + * at the target s-position. Unit: [m]. + * + * @return value of model property offset + */ + virtual void SetOffset(const double offset) = 0; + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the lane where the target position is located. Only the Heading angle at the target position on the + * (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position + * is built parallel to the tangent to the lane s-axis at the target s-position on the target road s-axis. The Heading is + * counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute dLane + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDLane(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute ds + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDs(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dsLane + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDsLane(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute offset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOffset(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dLane + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDLane() const = 0; + /** + * Get the parameter for the attribute ds + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDs() const = 0; + /** + * Get the parameter for the attribute dsLane + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDsLane() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute offset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOffset() const = 0; + + /** + * Retrieves whether the attribute dLane is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDLaneParameterized() = 0; + /** + * Retrieves whether the attribute ds is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDsParameterized() = 0; + /** + * Retrieves whether the attribute dsLane is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDsLaneParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute offset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOffsetParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the lane where the target position is located. Only the Heading angle at the target position on the + * (s,t)-plane can be arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position + * is built parallel to the tangent to the lane s-axis at the target s-position on the target road s-axis. The Heading is + * counted from this imaginary axis. +Missing Orientation property is interpreted as the relative reference context with + * Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetDs() will return false); + */ + virtual void ResetDs() = 0; + + /** + * Resets the optional property (IsSetDsLane() will return false); + */ + virtual void ResetDsLane() = 0; + + /** + * Resets the optional property (IsSetOffset() will return false); + */ + virtual void ResetOffset() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeLaneRange' + * From OpenSCENARIO class model specification: + * A range of lanes to the left and/or right of a referenced entity. The properties "from" and "to" define the signed + * numbers of lanes that are offset the referenced entity's current lane. (0 is the entity's current lane, positive is left + * of the entity, negative is right of the entity). Set "from" and "to" to the same number in order to check clearance for + * only one lane. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeLaneRangeWriter : public IOpenScenarioElementWriter, public IRelativeLaneRange + { + public: + virtual ~IRelativeLaneRangeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The lower limit of the range. Range: [-inf, inf[. Default if omitted: -inf + * + * @return value of model property from + */ + virtual void SetFrom(const int from) = 0; + + /** + * From OpenSCENARIO class model specification: + * The upper limit of the range. Range: ]-inf, inf]. Default if omitted: +inf + * + * @return value of model property to + */ + virtual void SetTo(const int to) = 0; + + /** + * Set a parameter for the attribute from + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFrom(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute to + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTo(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute from + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFrom() const = 0; + /** + * Get the parameter for the attribute to + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTo() const = 0; + + /** + * Retrieves whether the attribute from is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFromParameterized() = 0; + /** + * Retrieves whether the attribute to is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsToParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetFrom() will return false); + */ + virtual void ResetFrom() = 0; + + /** + * Resets the optional property (IsSetTo() will return false); + */ + virtual void ResetTo() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeObjectPosition' + * From OpenSCENARIO class model specification: + * Defines a position derived from coordinates (dx, dy and dz) relative to a reference entity. The coordinate system for + * the relative coordinates is the reference entity's coordinate system (taking the orientation of the entity into + * account). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeObjectPositionWriter : public IOpenScenarioElementWriter, public IRelativeObjectPosition + { + public: + virtual ~IRelativeObjectPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Relative position in the x axis, using the coordinate system of the reference entity. + * + * @return value of model property dx + */ + virtual void SetDx(const double dx) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the y axis, using the coordinate system of the reference entity. + * + * @return value of model property dy + */ + virtual void SetDy(const double dy) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the reference entity. Missing value is interpreted as 0. + * + * @return value of model property dz + */ + virtual void SetDz(const double dz) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the orientation with respect + * to the corresponding axes of the local (X,Y,Z)-coordinate system of the reference entity. +Missing Orientation property + * is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute dx + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDx(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dy + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDy(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dz + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDz(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dx + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDx() const = 0; + /** + * Get the parameter for the attribute dy + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDy() const = 0; + /** + * Get the parameter for the attribute dz + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDz() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute dx is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDxParameterized() = 0; + /** + * Retrieves whether the attribute dy is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDyParameterized() = 0; + /** + * Retrieves whether the attribute dz is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDzParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the orientation with respect + * to the corresponding axes of the local (X,Y,Z)-coordinate system of the reference entity. +Missing Orientation property + * is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetDz() will return false); + */ + virtual void ResetDz() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeRoadPosition' + * From OpenSCENARIO class model specification: + * Position defined in terms of the relative distance (ds) along the road's reference line and the relative lateral offset + * (dt) to the road's reference line which are derived from the position of the reference entity. + +The target position may + * be either on the same road segment (defined by roadId) where the reference entity is positioned or on a connecting road. + * In the latter case, the ds-coordinate is calculated along the road reference line of the connecting road. It is assumed + * that the reference line of the road of the reference entity continues seamlessly on the connecting road (even if its + * shape changes). It is assumed that the target position relates to the routing of the reference entity. Otherwise, the + * calculation of the target position cannot be interpreted within the OpenSCENARIO standard. + +The ds- and dt-coordinates + * should be specified so that the target position is within a road defined by roadId taken from the respective road + * network definition file (external to the ASAM OpenSCENARIO). If the target position would be outside the road + * boundaries, the z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeRoadPositionWriter : public IOpenScenarioElementWriter, public IRelativeRoadPosition + { + public: + virtual ~IRelativeRoadPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The offset along the road's reference line relative to the s-coordinate of the reference entity. Unit: [m]. + * + * @return value of model property ds + */ + virtual void SetDs(const double ds) = 0; + + /** + * From OpenSCENARIO class model specification: + * The offset on the axis orthogonal to the road's reference line relative to the t-coordinate of the reference entity. + * Unit: [m]. + * + * @return value of model property dt + */ + virtual void SetDt(const double dt) = 0; + + /** + * From OpenSCENARIO class model specification: + * reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the road at the target position. Only the Heading angle at the target position on the (s,t)-plane can be + * arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to + * the tangent to the road s-axis at the s-position of the target position. The Heading is counted from this imaginary + * axis. +Missing Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute ds + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDs(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dt + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDt(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute ds + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDs() const = 0; + /** + * Get the parameter for the attribute dt + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDt() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute ds is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDsParameterized() = 0; + /** + * Retrieves whether the attribute dt is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDtParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the road at the target position. Only the Heading angle at the target position on the (s,t)-plane can be + * arbitrarily specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to + * the tangent to the road s-axis at the s-position of the target position. The Heading is counted from this imaginary + * axis. +Missing Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeSpeedCondition' + * From OpenSCENARIO class model specification: + * The current relative speed of a triggering entity/entities to a reference entity is compared to a given value. The + * logical operator used for the evaluation is defined by the rule attribute. If direction is used, only the projection to + * that direction is used in the comparison, with the triggering entity/entities as the reference. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeSpeedConditionWriter : public IOpenScenarioElementWriter, public IRelativeSpeedCondition + { + public: + virtual ~IRelativeSpeedConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Direction of the speed (if not given, the total speed is considered). + * + * @return value of model property direction + */ + virtual void SetDirection(const DirectionalDimension direction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative speed value. Unit: [m/s]. Range: ]-inf..inf[. Relative speed is defined as speed_rel = speed(triggering entity) + * - speed(reference entity) + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute direction + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDirection(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute direction + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDirection() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute direction is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDirectionParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetDirection() will return false); + */ + virtual void ResetDirection() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeSpeedToMaster' + * From OpenSCENARIO class model specification: + * Speed definition relative to the master entity's speed within a SynchronizeAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeSpeedToMasterWriter : public IOpenScenarioElementWriter, public IRelativeSpeedToMaster + { + public: + virtual ~IRelativeSpeedToMasterWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The semantics of the value (delta, offset, factor). + * + * @return value of model property speedTargetValueType + */ + virtual void SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative speed. Unit: [m/s]. Range: ]-inf..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return value of model property steadyState + */ + virtual void SetSteadyState(std::shared_ptr steadyState) = 0; + + /** + * Set a parameter for the attribute speedTargetValueType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpeedTargetValueType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute speedTargetValueType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpeedTargetValueType() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute speedTargetValueType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpeedTargetValueTypeParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Optional final phase of constant (final) speed. + * + * @return a writer for model property steadyState + */ + virtual std::shared_ptr GetWriterSteadyState() const = 0; + + /** + * Resets the optional property (IsSetSteadyState() will return false); + */ + virtual void ResetSteadyState() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeTargetLane' + * From OpenSCENARIO class model specification: + * Target lane defined as difference compared to the reference entity's current lane evaluated in the reference entity's + * coordinate system. I.e. positive values refer to lanes in the positive y-axis of the reference entity's coordinate + * system, negative values refer to lanes in the negative y-axis respectively. For ASAM OpenDRIVE maps, the road center + * lane is not counted as a lane and thus omitted. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetLaneWriter : public IOpenScenarioElementWriter, public IRelativeTargetLane + { + public: + virtual ~IRelativeTargetLaneWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Signed number defining the target lane as difference compared to the reference entity's current lane evaluated in the + * reference entity's coordinate system. + * + * @return value of model property value + */ + virtual void SetValue(const int value) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeTargetLaneOffset' + * From OpenSCENARIO class model specification: + * Defines the relative lane offset from a triggering entity/entities to a reference entity as a target for a + * LaneOffsetTarget. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetLaneOffsetWriter : public IOpenScenarioElementWriter, public IRelativeTargetLaneOffset + { + public: + virtual ~IRelativeTargetLaneOffsetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Lane offset with respect to the reference entity's current lane position. Unit: [m]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeTargetSpeed' + * From OpenSCENARIO class model specification: + * Defines a target speed relative to a reference entity's speed. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeTargetSpeedWriter : public IOpenScenarioElementWriter, public IRelativeTargetSpeed + { + public: + virtual ~IRelativeTargetSpeedWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * By setting continuous to true a controller comes into place and tries to maintain a continuous relative speed. This may + * not be used together with Dynamics.time or Dynamics.distance. + * + * @return value of model property continuous + */ + virtual void SetContinuous(const bool continuous) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The value is either a delta (Unit: [m/s]) or a factor (no Unit). + * + * @return value of model property speedTargetValueType + */ + virtual void SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value of the relative speed. This value is either given as a delta or as a factor. E.g. value=10 together with + * valueType=delta means the entity/entities are supposed to drive 10m/s faster than the target reference entity. E.g. + * value=1.1 together with valueType=factor means that the entity/entities are supposed to drive 10% faster than the target + * reference entity. Unit: [m/s] or [1]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute continuous + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContinuous(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute speedTargetValueType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpeedTargetValueType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute continuous + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContinuous() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute speedTargetValueType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpeedTargetValueType() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute continuous is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContinuousParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute speedTargetValueType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpeedTargetValueTypeParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RelativeWorldPosition' + * From OpenSCENARIO class model specification: + * Position defined in terms of delta x, y, (z) relative to a reference entity's position in world coordinate space. + * Optionally, an orientation can be defined in either absolute or relative values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRelativeWorldPositionWriter : public IOpenScenarioElementWriter, public IRelativeWorldPosition + { + public: + virtual ~IRelativeWorldPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Relative x coordinate in the world coordinate system. Unit: [m]. + * + * @return value of model property dx + */ + virtual void SetDx(const double dx) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative y coordinate in the world coordinate system. Unit: [m]. + * + * @return value of model property dy + */ + virtual void SetDy(const double dy) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative z coordinate in the world coordinate system. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property dz + */ + virtual void SetDz(const double dz) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity from which the relative world position is measured. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the angular shift of + * orientation angles with respect to the corresponding orientation angles of the reference entity in the World coordinate + * system. The positive value means a counter-clockwise shift. +Missing Orientation property is interpreted as the relative + * reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute dx + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDx(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dy + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDy(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dz + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDz(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dx + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDx() const = 0; + /** + * Get the parameter for the attribute dy + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDy() const = 0; + /** + * Get the parameter for the attribute dz + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDz() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + + /** + * Retrieves whether the attribute dx is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDxParameterized() = 0; + /** + * Retrieves whether the attribute dy is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDyParameterized() = 0; + /** + * Retrieves whether the attribute dz is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDzParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The absolute reference context refers to the orientation with respect to the World coordinate system (i.e., the + * orientation of the reference entity is ignored). +The relative reference context refers to the angular shift of + * orientation angles with respect to the corresponding orientation angles of the reference entity in the World coordinate + * system. The positive value means a counter-clockwise shift. +Missing Orientation property is interpreted as the relative + * reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetDz() will return false); + */ + virtual void ResetDz() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoadCondition' + * From OpenSCENARIO class model specification: + * Definition of the road friction scale factor. Can be augmented with the addition of optional road properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadConditionWriter : public IOpenScenarioElementWriter, public IRoadCondition + { + public: + virtual ~IRoadConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Friction scale factor. Range: [0..inf[. + * + * @return value of model property frictionScaleFactor + */ + virtual void SetFrictionScaleFactor(const double frictionScaleFactor) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the wetness of the road. + * + * @return value of model property wetness + */ + virtual void SetWetness(const Wetness wetness) = 0; + + /** + * From OpenSCENARIO class model specification: + * Additional properties to describe the road condition. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute frictionScaleFactor + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFrictionScaleFactor(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute wetness + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWetness(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute frictionScaleFactor + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFrictionScaleFactor() const = 0; + /** + * Get the parameter for the attribute wetness + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWetness() const = 0; + + /** + * Retrieves whether the attribute frictionScaleFactor is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFrictionScaleFactorParameterized() = 0; + /** + * Retrieves whether the attribute wetness is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWetnessParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Additional properties to describe the road condition. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * Resets the optional property (IsSetWetness() will return false); + */ + virtual void ResetWetness() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoadCursor' + * From OpenSCENARIO class model specification: + * Defines a cross-section across lanes on a road with respect to the road reference line. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadCursorWriter : public IOpenScenarioElementWriter, public IRoadCursor + { + public: + virtual ~IRoadCursorWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual void SetRoadId(const std::string roadId) = 0; + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. If s is omitted and the + * road cursor depicts the start of a road range, then s=0 is assumed. If s is omitted and the road cursor depicts the end + * of a road range, then s=max_length is assumed. Unit: [m]. Range: [0..inf[. + * + * @return value of model property s + */ + virtual void SetS(const double s) = 0; + + /** + * From OpenSCENARIO class model specification: + * Restriction of the road cursor to specific lanes of a road. If omitted, road cursor is valid for all lanes of the road. + * + * @return value of model property lane + */ + virtual void SetLane(std::vector>& lane) = 0; + + /** + * Set a parameter for the attribute roadId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoadId(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute s + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToS(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute roadId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoadId() const = 0; + /** + * Get the parameter for the attribute s + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromS() const = 0; + + /** + * Retrieves whether the attribute roadId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoadIdParameterized() = 0; + /** + * Retrieves whether the attribute s is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Restriction of the road cursor to specific lanes of a road. If omitted, road cursor is valid for all lanes of the road. + * + * @return a list of writers for model property lane + */ + virtual std::vector> GetWriterLane() const = 0; + /** + * Resets the optional property (IsSetS() will return false); + */ + virtual void ResetS() = 0; + + /** + * Resets the optional property (IsSetLane() will return false); + */ + virtual void ResetLane() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoadNetwork' + * From OpenSCENARIO class model specification: + * The road network which provides the base layer (and road-relative coordinate systems) for all scenario elements is + * defined as a reference to a road network file. This reference is optional; in case it is not specified, an infinite + * non-inclined plane on level z=0 shall be assumed as base layer. Additionally and optionally, a visual 3D model file can + * be referenced and any number of signals can be specified. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadNetworkWriter : public IOpenScenarioElementWriter, public IRoadNetwork + { + public: + virtual ~IRoadNetworkWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * File path of the road network file (e.g. an ASAM OpenDRIVE file). + * + * @return value of model property logicFile + */ + virtual void SetLogicFile(std::shared_ptr logicFile) = 0; + + /** + * From OpenSCENARIO class model specification: + * File path of a 3D model representing the virtual environment. This may be used for visual representation (rendering). + * + * @return value of model property sceneGraphFile + */ + virtual void SetSceneGraphFile(std::shared_ptr sceneGraphFile) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name references and description of dynamic behavior for traffic signals defined in the road network file. + * + * @return value of model property trafficSignals + */ + virtual void SetTrafficSignals(std::vector>& trafficSignals) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the area of the road network, which is used by the entities. If not provided, then the whole logicFile and + * sceneGraphFile will be used/loaded. + * + * @return value of model property usedArea + */ + virtual void SetUsedArea(std::shared_ptr usedArea) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * File path of the road network file (e.g. an ASAM OpenDRIVE file). + * + * @return a writer for model property logicFile + */ + virtual std::shared_ptr GetWriterLogicFile() const = 0; + /** + * From OpenSCENARIO class model specification: + * File path of a 3D model representing the virtual environment. This may be used for visual representation (rendering). + * + * @return a writer for model property sceneGraphFile + */ + virtual std::shared_ptr GetWriterSceneGraphFile() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of the area of the road network, which is used by the entities. If not provided, then the whole logicFile and + * sceneGraphFile will be used/loaded. + * + * @return a writer for model property usedArea + */ + virtual std::shared_ptr GetWriterUsedArea() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Name references and description of dynamic behavior for traffic signals defined in the road network file. + * + * @return a list of writers for model property trafficSignals + */ + virtual std::vector> GetWriterTrafficSignals() const = 0; + /** + * Resets the optional property (IsSetLogicFile() will return false); + */ + virtual void ResetLogicFile() = 0; + + /** + * Resets the optional property (IsSetSceneGraphFile() will return false); + */ + virtual void ResetSceneGraphFile() = 0; + + /** + * Resets the optional property (IsSetTrafficSignals() will return false); + */ + virtual void ResetTrafficSignals() = 0; + + /** + * Resets the optional property (IsSetUsedArea() will return false); + */ + virtual void ResetUsedArea() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoadPosition' + * From OpenSCENARIO class model specification: + * Position defined in terms of the road segment (roadId), the distance (s) along the road's reference line, and the + * lateral offset (t) to the road's reference line at that point. Orientation is optional. + +The s- and t-coordinates should + * be specified so that the target position is within a road defined by roadId taken from the respective road network + * definition file (external to the ASAM OpenSCENARIO). If the target position would be outside the road boundaries, the + * z-coordinate of the position is undefined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadPositionWriter : public IOpenScenarioElementWriter, public IRoadPosition + { + public: + virtual ~IRoadPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The ID of the target road taken from the respective road network definition file. + * + * @return value of model property roadId + */ + virtual void SetRoadId(const std::string roadId) = 0; + + /** + * From OpenSCENARIO class model specification: + * The s-coordinate taken along the road's reference line from the start point of the target road. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property s + */ + virtual void SetS(const double s) = 0; + + /** + * From OpenSCENARIO class model specification: + * The t-coordinate taken on the axis orthogonal to the reference line of the road. Unit: [m]. + * + * @return value of model property t + */ + virtual void SetT(const double t) = 0; + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target road that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the road s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * Set a parameter for the attribute roadId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoadId(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute s + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToS(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute t + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToT(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute roadId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoadId() const = 0; + /** + * Get the parameter for the attribute s + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromS() const = 0; + /** + * Get the parameter for the attribute t + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromT() const = 0; + + /** + * Retrieves whether the attribute roadId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoadIdParameterized() = 0; + /** + * Retrieves whether the attribute s is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSParameterized() = 0; + /** + * Retrieves whether the attribute t is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface and therefore undefined by the OpenSCENARIO + * standard. +The absolute reference context refers to the orientation with respect to the World coordinate system. Only the + * Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane counting from the X-axis. +The + * relative reference context refers to the orientation with respect to the (s,t)-coordinate system of the target road that + * is considered a reference orientation. Only the Heading angle at the target position can be arbitrarily specified on the + * (s,t)-plane counting from the tangent to the road s-axis at the point with the target s-coordinate. +Missing Orientation + * property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoadRange' + * From OpenSCENARIO class model specification: + * Defines an area by a range on a specific road. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoadRangeWriter : public IOpenScenarioElementWriter, public IRoadRange + { + public: + virtual ~IRoadRangeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Limits the length of the road range starting from the first road cursor. If omitted or if length exceeds last road + * cursor, then last road cursor defines the end of the road range. Unit: [m]. Range: ]0;inf[. + * + * @return value of model property length + */ + virtual void SetLength(const double length) = 0; + + /** + * From OpenSCENARIO class model specification: + * A minimum of 2 road cursors must be provided to specify the start and end of the road range. Intermediate cursors can be + * used to change the lane "validity". + * + * @return value of model property roadCursor + */ + virtual void SetRoadCursor(std::vector>& roadCursor) = 0; + + /** + * Set a parameter for the attribute length + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToLength(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute length + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromLength() const = 0; + + /** + * Retrieves whether the attribute length is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsLengthParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * A minimum of 2 road cursors must be provided to specify the start and end of the road range. Intermediate cursors can be + * used to change the lane "validity". + * + * @return a list of writers for model property roadCursor + */ + virtual std::vector> GetWriterRoadCursor() const = 0; + /** + * Resets the optional property (IsSetLength() will return false); + */ + virtual void ResetLength() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Route' + * From OpenSCENARIO class model specification: + * A route is defined in a scenario or in a catalog. It represents a continuous path throughout the road network, defined + * by a series of waypoints. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRouteWriter : public IOpenScenarioElementWriter, public IRoute, public ICatalogElementWriter + { + public: + virtual ~IRouteWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * In a closed route, the last waypoint is followed by the first waypoint to create a closed route. + * + * @return value of model property closed + */ + virtual void SetClosed(const bool closed) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the route. Required in catalogs. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * At least two waypoints are needed to define a route. + * + * @return value of model property waypoints + */ + virtual void SetWaypoints(std::vector>& waypoints) = 0; + + /** + * Set a parameter for the attribute closed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToClosed(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute closed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromClosed() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute closed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsClosedParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * From OpenSCENARIO class model specification: + * At least two waypoints are needed to define a route. + * + * @return a list of writers for model property waypoints + */ + virtual std::vector> GetWriterWaypoints() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RouteCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up route catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRouteCatalogLocationWriter : public IOpenScenarioElementWriter, public IRouteCatalogLocation + { + public: + virtual ~IRouteCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoutePosition' + * From OpenSCENARIO class model specification: + * Position along a route defined in terms of PositionInRoadCoordinates, PositionInLaneCoordinates or current position of a + * reference object. Orientation definition is optional. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoutePositionWriter : public IOpenScenarioElementWriter, public IRoutePosition + { + public: + virtual ~IRoutePositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Either a route definition or a catalog reference to the route the position is calculated from. + * + * @return value of model property routeRef + */ + virtual void SetRouteRef(std::shared_ptr routeRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Orientation. The relative reference context refers to the referenced road's s and t coordinates, to the current lane's s + * and t coordinates or to the orientation of the reference entity. Missing Orientation property is interpreted as the + * relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position along the route. + * + * @return value of model property inRoutePosition + */ + virtual void SetInRoutePosition(std::shared_ptr inRoutePosition) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Either a route definition or a catalog reference to the route the position is calculated from. + * + * @return a writer for model property routeRef + */ + virtual std::shared_ptr GetWriterRouteRef() const = 0; + /** + * From OpenSCENARIO class model specification: + * Orientation. The relative reference context refers to the referenced road's s and t coordinates, to the current lane's s + * and t coordinates or to the orientation of the reference entity. Missing Orientation property is interpreted as the + * relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + /** + * From OpenSCENARIO class model specification: + * Position along the route. + * + * @return a writer for model property inRoutePosition + */ + virtual std::shared_ptr GetWriterInRoutePosition() const = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RouteRef' + * From OpenSCENARIO class model specification: + * Defines a reference to a route. Either an inline definition of a route or a route in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRouteRefWriter : public IOpenScenarioElementWriter, public IRouteRef + { + public: + virtual ~IRouteRefWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Route definition. + * + * @return value of model property route + */ + virtual void SetRoute(std::shared_ptr route) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to route in the catalog. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Route definition. + * + * @return a writer for model property route + */ + virtual std::shared_ptr GetWriterRoute() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference to route in the catalog. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'RoutingAction' + * From OpenSCENARIO class model specification: + * Controls entity routing, either by following a predefined route or trajectory, alternatively by specifying a destination + * position which the entity should aim to reach. +Further, it can be enforced that an entity selects its routing at each + * junction randomly. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IRoutingActionWriter : public IOpenScenarioElementWriter, public IRoutingAction + { + public: + virtual ~IRoutingActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route is defined by at least two waypoints. + * + * @return value of model property assignRouteAction + */ + virtual void SetAssignRouteAction(std::shared_ptr assignRouteAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Controls an entity to follow a trajectory. + * + * @return value of model property followTrajectoryAction + */ + virtual void SetFollowTrajectoryAction(std::shared_ptr followTrajectoryAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route assigned will be the shortest route (along roads) between the entity's current + * position and the position specified. + * + * @return value of model property acquirePositionAction + */ + virtual void SetAcquirePositionAction(std::shared_ptr acquirePositionAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Assigns random routing behavior to an entity. + * + * @return value of model property randomRouteAction + */ + virtual void SetRandomRouteAction(std::shared_ptr randomRouteAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route is defined by at least two waypoints. + * + * @return a writer for model property assignRouteAction + */ + virtual std::shared_ptr GetWriterAssignRouteAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Controls an entity to follow a trajectory. + * + * @return a writer for model property followTrajectoryAction + */ + virtual std::shared_ptr GetWriterFollowTrajectoryAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Assigns a route to an entity. The route assigned will be the shortest route (along roads) between the entity's current + * position and the position specified. + * + * @return a writer for model property acquirePositionAction + */ + virtual std::shared_ptr GetWriterAcquirePositionAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Assigns random routing behavior to an entity. + * + * @return a writer for model property randomRouteAction + */ + virtual std::shared_ptr GetWriterRandomRouteAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ScenarioDefinition' + * From OpenSCENARIO class model specification: + * Top level container containing all scenario elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioDefinitionWriter : public IOpenScenarioElementWriter, public IScenarioDefinition + { + public: + virtual ~IScenarioDefinitionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Declaration of typed parameters with names and default values. It is used for creating variations of the same scenario. + * The value of the parameters cannot change after startup during runtime. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Declaration of typed variables with names and default values. Their value can change during runtime, and can be used to + * trigger Events in the scenario or on external side. + * + * @return value of model property variableDeclarations + */ + virtual void SetVariableDeclarations(std::vector>& variableDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Declaration of monitors by name and initial value. Monitors can be read out by an external tool and may change during + * runtime to monitor the scenario execution. + * + * @return value of model property monitorDeclarations + */ + virtual void SetMonitorDeclarations(std::vector>& monitorDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * A list of locations to look up catalog files. Each catalog element type has its own list. + * + * @return value of model property catalogLocations + */ + virtual void SetCatalogLocations(std::shared_ptr catalogLocations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to the road network. + * + * @return value of model property roadNetwork + */ + virtual void SetRoadNetwork(std::shared_ptr roadNetwork) = 0; + + /** + * From OpenSCENARIO class model specification: + * Container for entity selections and scenario object definitions. Instances of ScenarioObject, of EntitySelection and of + * SpawnedObject considered instances of Entity. + * + * @return value of model property entities + */ + virtual void SetEntities(std::shared_ptr entities) = 0; + + /** + * From OpenSCENARIO class model specification: + * Container for the dynamic content of the scenario. + * + * @return value of model property storyboard + */ + virtual void SetStoryboard(std::shared_ptr storyboard) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A list of locations to look up catalog files. Each catalog element type has its own list. + * + * @return a writer for model property catalogLocations + */ + virtual std::shared_ptr GetWriterCatalogLocations() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference to the road network. + * + * @return a writer for model property roadNetwork + */ + virtual std::shared_ptr GetWriterRoadNetwork() const = 0; + /** + * From OpenSCENARIO class model specification: + * Container for entity selections and scenario object definitions. Instances of ScenarioObject, of EntitySelection and of + * SpawnedObject considered instances of Entity. + * + * @return a writer for model property entities + */ + virtual std::shared_ptr GetWriterEntities() const = 0; + /** + * From OpenSCENARIO class model specification: + * Container for the dynamic content of the scenario. + * + * @return a writer for model property storyboard + */ + virtual std::shared_ptr GetWriterStoryboard() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Declaration of typed parameters with names and default values. It is used for creating variations of the same scenario. + * The value of the parameters cannot change after startup during runtime. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * From OpenSCENARIO class model specification: + * Declaration of typed variables with names and default values. Their value can change during runtime, and can be used to + * trigger Events in the scenario or on external side. + * + * @return a list of writers for model property variableDeclarations + */ + virtual std::vector> GetWriterVariableDeclarations() const = 0; + /** + * From OpenSCENARIO class model specification: + * Declaration of monitors by name and initial value. Monitors can be read out by an external tool and may change during + * runtime to monitor the scenario execution. + * + * @return a list of writers for model property monitorDeclarations + */ + virtual std::vector> GetWriterMonitorDeclarations() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetVariableDeclarations() will return false); + */ + virtual void ResetVariableDeclarations() = 0; + + /** + * Resets the optional property (IsSetMonitorDeclarations() will return false); + */ + virtual void ResetMonitorDeclarations() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ScenarioObject' + * From OpenSCENARIO class model specification: + * A scenario object represents a runtime object that is created from an EntityObject (vehicle type, pedestrian type, + * miscellaneous object type and external object reference type) and Controllers. Miscellaneous objects and external object + * references must not have controllers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioObjectWriter : public IOpenScenarioElementWriter, public IScenarioObject, public IEntityWriter + { + public: + virtual ~IScenarioObjectWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Identifier of the scenario object. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle, Pedestrian or MiscObject). + * + * @return value of model property entityObject + */ + virtual void SetEntityObject(std::shared_ptr entityObject) = 0; + + /** + * From OpenSCENARIO class model specification: + * Controller of the EntityObject instance. + * + * @return value of model property objectController + */ + virtual void SetObjectController(std::vector>& objectController) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle, Pedestrian or MiscObject). + * + * @return a writer for model property entityObject + */ + virtual std::shared_ptr GetWriterEntityObject() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Controller of the EntityObject instance. + * + * @return a list of writers for model property objectController + */ + virtual std::vector> GetWriterObjectController() const = 0; + /** + * Resets the optional property (IsSetObjectController() will return false); + */ + virtual void ResetObjectController() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ScenarioObjectTemplate' + * From OpenSCENARIO class model specification: + * An entity profile that shall appear in an entity group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioObjectTemplateWriter : public IOpenScenarioElementWriter, public IScenarioObjectTemplate, public IEntityWriter + { + public: + virtual ~IScenarioObjectTemplateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle/Pedestrian or CatalogReference to them; no MiscObject or + * ExternalObjectReference). + * + * @return value of model property entitiyObject + */ + virtual void SetEntitiyObject(std::shared_ptr entitiyObject) = 0; + + /** + * From OpenSCENARIO class model specification: + * Controller(s) of the EntityObject instance. + * + * @return value of model property objectController + */ + virtual void SetObjectController(std::vector>& objectController) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The EntityObject (either instance of type Vehicle/Pedestrian or CatalogReference to them; no MiscObject or + * ExternalObjectReference). + * + * @return a writer for model property entitiyObject + */ + virtual std::shared_ptr GetWriterEntitiyObject() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Controller(s) of the EntityObject instance. + * + * @return a list of writers for model property objectController + */ + virtual std::vector> GetWriterObjectController() const = 0; + /** + * Resets the optional property (IsSetObjectController() will return false); + */ + virtual void ResetObjectController() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SelectedEntities' + * From OpenSCENARIO class model specification: + * Collection of entities that includes entities explicitly by their reference or includes the entities by their type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISelectedEntitiesWriter : public IOpenScenarioElementWriter, public ISelectedEntities + { + public: + virtual ~ISelectedEntitiesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * References to the selected entities. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::vector>& entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the type to determine that all entities of a specific type are members. + * + * @return value of model property byType + */ + virtual void SetByType(std::vector>& byType) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * References to the selected entities. + * + * @return a list of writers for model property entityRef + */ + virtual std::vector> GetWriterEntityRef() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the type to determine that all entities of a specific type are members. + * + * @return a list of writers for model property byType + */ + virtual std::vector> GetWriterByType() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SensorReference' + * From OpenSCENARIO class model specification: + * Reference to a sensor, whose definition is beyond OpenSCENARIO files and catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISensorReferenceWriter : public IOpenScenarioElementWriter, public ISensorReference + { + public: + virtual ~ISensorReferenceWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the sensor. The semantics of the sensor names are subject of a contract between the author of a scenario and the + * provider of a simulation environment. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SensorReferenceSet' + * From OpenSCENARIO class model specification: + * Set of references to sensors, whose definition is beyond OpenSCENARIO files and catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISensorReferenceSetWriter : public IOpenScenarioElementWriter, public ISensorReferenceSet + { + public: + virtual ~ISensorReferenceSetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Set of references to sensors. + * + * @return value of model property sensorReferences + */ + virtual void SetSensorReferences(std::vector>& sensorReferences) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Set of references to sensors. + * + * @return a list of writers for model property sensorReferences + */ + virtual std::vector> GetWriterSensorReferences() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SetMonitorAction' + * From OpenSCENARIO class model specification: + * Action used to set the value of a monitor. If it is set to false by this action, that indicates the scenario was not + * executed as expected. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISetMonitorActionWriter : public IOpenScenarioElementWriter, public ISetMonitorAction + { + public: + virtual ~ISetMonitorActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced monitor. + * + * @return value of model property monitorRef + */ + virtual void SetMonitorRef(std::shared_ptr> monitorRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value of the monitor. + * + * @return value of model property value + */ + virtual void SetValue(const bool value) = 0; + + /** + * Set a parameter for the attribute monitorRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMonitorRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute monitorRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMonitorRef() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute monitorRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMonitorRefParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Shape' + * From OpenSCENARIO class model specification: + * Shape for use in trajectories. Supported types: Polyline (line segments), Clothoid, Nurbs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IShapeWriter : public IOpenScenarioElementWriter, public IShape + { + public: + virtual ~IShapeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Polyline property of a shape. + * + * @return value of model property polyline + */ + virtual void SetPolyline(std::shared_ptr polyline) = 0; + + /** + * From OpenSCENARIO class model specification: + * Clothoid property of a shape. + * + * @return value of model property clothoid + */ + virtual void SetClothoid(std::shared_ptr clothoid) = 0; + + /** + * From OpenSCENARIO class model specification: + * Clothoid spline property of a shape. + * + * @return value of model property clothoidSpline + */ + virtual void SetClothoidSpline(std::shared_ptr clothoidSpline) = 0; + + /** + * From OpenSCENARIO class model specification: + * NURBS property of a shape. + * + * @return value of model property nurbs + */ + virtual void SetNurbs(std::shared_ptr nurbs) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Polyline property of a shape. + * + * @return a writer for model property polyline + */ + virtual std::shared_ptr GetWriterPolyline() const = 0; + /** + * From OpenSCENARIO class model specification: + * Clothoid property of a shape. + * + * @return a writer for model property clothoid + */ + virtual std::shared_ptr GetWriterClothoid() const = 0; + /** + * From OpenSCENARIO class model specification: + * Clothoid spline property of a shape. + * + * @return a writer for model property clothoidSpline + */ + virtual std::shared_ptr GetWriterClothoidSpline() const = 0; + /** + * From OpenSCENARIO class model specification: + * NURBS property of a shape. + * + * @return a writer for model property nurbs + */ + virtual std::shared_ptr GetWriterNurbs() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SimulationTimeCondition' + * From OpenSCENARIO class model specification: + * Compares the simulation time to the specified value. The logical operator is defined by the rule attribute. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISimulationTimeConditionWriter : public IOpenScenarioElementWriter, public ISimulationTimeCondition + { + public: + virtual ~ISimulationTimeConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Time value of the simulation time condition. Unit: [s]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpeedAction' + * From OpenSCENARIO class model specification: + * This action describes the transition of an entity's speed to a target speed. SpeedActionDynamics specifies the + * transition with respects to time or distance combined with a shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedActionWriter : public IOpenScenarioElementWriter, public ISpeedAction, public IMotionControlActionWriter + { + public: + virtual ~ISpeedActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines how the target speed is reached. + * + * @return value of model property speedActionDynamics + */ + virtual void SetSpeedActionDynamics(std::shared_ptr speedActionDynamics) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed which should be reached. + * + * @return value of model property speedActionTarget + */ + virtual void SetSpeedActionTarget(std::shared_ptr speedActionTarget) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines how the target speed is reached. + * + * @return a writer for model property speedActionDynamics + */ + virtual std::shared_ptr GetWriterSpeedActionDynamics() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the target speed which should be reached. + * + * @return a writer for model property speedActionTarget + */ + virtual std::shared_ptr GetWriterSpeedActionTarget() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpeedActionTarget' + * From OpenSCENARIO class model specification: + * Specifies the target speed of a SpeedAction. Can be either an absolute speed value or a speed value relative to another + * entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedActionTargetWriter : public IOpenScenarioElementWriter, public ISpeedActionTarget + { + public: + virtual ~ISpeedActionTargetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as relative speed to a reference entity. Unit: [m/s]. + * + * @return value of model property relativeTargetSpeed + */ + virtual void SetRelativeTargetSpeed(std::shared_ptr relativeTargetSpeed) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as absolute speed. Unit: [m/s]. + * + * @return value of model property absoluteTargetSpeed + */ + virtual void SetAbsoluteTargetSpeed(std::shared_ptr absoluteTargetSpeed) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as relative speed to a reference entity. Unit: [m/s]. + * + * @return a writer for model property relativeTargetSpeed + */ + virtual std::shared_ptr GetWriterRelativeTargetSpeed() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the target speed as absolute speed. Unit: [m/s]. + * + * @return a writer for model property absoluteTargetSpeed + */ + virtual std::shared_ptr GetWriterAbsoluteTargetSpeed() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpeedCondition' + * From OpenSCENARIO class model specification: + * Compares a triggering entity's/entities' speed to a target speed. The logical operator for the comparison is given by + * the rule attribute. If direction is used, only the projection to that direction is used in the comparison. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedConditionWriter : public IOpenScenarioElementWriter, public ISpeedCondition + { + public: + virtual ~ISpeedConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Direction of the speed (if not given, the total speed is considered). + * + * @return value of model property direction + */ + virtual void SetDirection(const DirectionalDimension direction) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Speed value of the speed condition. Unit: [m/s]. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute direction + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDirection(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute direction + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDirection() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute direction is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDirectionParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetDirection() will return false); + */ + virtual void ResetDirection() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpeedProfileAction' + * From OpenSCENARIO class model specification: + * This action describes the change of speed in terms of a series of speed targets over time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedProfileActionWriter : public IOpenScenarioElementWriter, public ISpeedProfileAction + { + public: + virtual ~ISpeedProfileActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference entity. If set, the speed values will be interpreted as relative delta to the speed of the referenced entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines whether to apply strictly linear interpolation between speed target values (mode=position), or to apply jerk + * (change rate of acceleration/deceleration) and other optional constraints of the Performance class of a Vehicle entity + * resulting in a smoother speed profile curve (mode=follow). For mode=follow the acceleration is zero at the start and end + * of the profile. + * + * @return value of model property followingMode + */ + virtual void SetFollowingMode(const FollowingMode followingMode) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines limitations to the action in terms of acceleration, deceleration, speed and/or jerk. These settings has + * precedence over any Performance settings (applies to vehicles only). + * + * @return value of model property dynamicConstraints + */ + virtual void SetDynamicConstraints(std::shared_ptr dynamicConstraints) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a series of speed targets. + * + * @return value of model property speedProfileEntry + */ + virtual void SetSpeedProfileEntry(std::vector>& speedProfileEntry) = 0; + + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute followingMode + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFollowingMode(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute followingMode + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFollowingMode() const = 0; + + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute followingMode is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFollowingModeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines limitations to the action in terms of acceleration, deceleration, speed and/or jerk. These settings has + * precedence over any Performance settings (applies to vehicles only). + * + * @return a writer for model property dynamicConstraints + */ + virtual std::shared_ptr GetWriterDynamicConstraints() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a series of speed targets. + * + * @return a list of writers for model property speedProfileEntry + */ + virtual std::vector> GetWriterSpeedProfileEntry() const = 0; + /** + * Resets the optional property (IsSetEntityRef() will return false); + */ + virtual void ResetEntityRef() = 0; + + /** + * Resets the optional property (IsSetDynamicConstraints() will return false); + */ + virtual void ResetDynamicConstraints() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpeedProfileEntry' + * From OpenSCENARIO class model specification: + * Describes a speed target for a SpeedProfileAction. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpeedProfileEntryWriter : public IOpenScenarioElementWriter, public ISpeedProfileEntry + { + public: + virtual ~ISpeedProfileEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The speed to reach. Unit: [m/s]. + * + * @return value of model property speed + */ + virtual void SetSpeed(const double speed) = 0; + + /** + * From OpenSCENARIO class model specification: + * The time to reach the specified speed. First entry specifies delta from start of the action, remaining entries delta + * from previous entry. If omitted, the speed will be reached as soon as possible given the performance settings. Unit: + * [s]. Range: [0..inf[. + * + * @return value of model property time + */ + virtual void SetTime(const double time) = 0; + + /** + * Set a parameter for the attribute speed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpeed(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute time + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute speed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpeed() const = 0; + /** + * Get the parameter for the attribute time + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTime() const = 0; + + /** + * Retrieves whether the attribute speed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpeedParameterized() = 0; + /** + * Retrieves whether the attribute time is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetTime() will return false); + */ + virtual void ResetTime() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'StandStillCondition' + * From OpenSCENARIO class model specification: + * Logical expression in condition becomes true if the triggering entity/entities stands still for a given amount of time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStandStillConditionWriter : public IOpenScenarioElementWriter, public IStandStillCondition + { + public: + virtual ~IStandStillConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Duration time of still standing to let the logical expression become true. Unit: [s]. Range: [0..inf[. + * + * @return value of model property duration + */ + virtual void SetDuration(const double duration) = 0; + + /** + * Set a parameter for the attribute duration + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDuration(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute duration + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDuration() const = 0; + + /** + * Retrieves whether the attribute duration is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDurationParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SteadyState' + * From OpenSCENARIO class model specification: + * Final phase of constant (final) speed, start of which defined by distance or time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISteadyStateWriter : public IOpenScenarioElementWriter, public ISteadyState + { + public: + virtual ~ISteadyStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The target distance steady state (distance from object to target) + * + * @return value of model property targetDistanceSteadyState + */ + virtual void SetTargetDistanceSteadyState(std::shared_ptr targetDistanceSteadyState) = 0; + + /** + * From OpenSCENARIO class model specification: + * The target time steady state (remaining time for object to reach target position). + * + * @return value of model property targetTimeSteadyState + */ + virtual void SetTargetTimeSteadyState(std::shared_ptr targetTimeSteadyState) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The target distance steady state (distance from object to target) + * + * @return a writer for model property targetDistanceSteadyState + */ + virtual std::shared_ptr GetWriterTargetDistanceSteadyState() const = 0; + /** + * From OpenSCENARIO class model specification: + * The target time steady state (remaining time for object to reach target position). + * + * @return a writer for model property targetTimeSteadyState + */ + virtual std::shared_ptr GetWriterTargetTimeSteadyState() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Stochastic' + * From OpenSCENARIO class model specification: + * Top level container for all stochastic distribution elements. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochasticWriter : public IOpenScenarioElementWriter, public IStochastic + { + public: + virtual ~IStochasticWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the total number of runs for each stochastic distribution. + * + * @return value of model property numberOfTestRuns + */ + virtual void SetNumberOfTestRuns(const uint32_t numberOfTestRuns) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the seed which is used to generate the random values. A identical seed shall generate the same set of random + * values. + * + * @return value of model property randomSeed + */ + virtual void SetRandomSeed(const double randomSeed) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return value of model property stochasticDistributions + */ + virtual void SetStochasticDistributions(std::vector>& stochasticDistributions) = 0; + + /** + * Set a parameter for the attribute numberOfTestRuns + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToNumberOfTestRuns(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute randomSeed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRandomSeed(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute numberOfTestRuns + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromNumberOfTestRuns() const = 0; + /** + * Get the parameter for the attribute randomSeed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRandomSeed() const = 0; + + /** + * Retrieves whether the attribute numberOfTestRuns is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNumberOfTestRunsParameterized() = 0; + /** + * Retrieves whether the attribute randomSeed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRandomSeedParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return a list of writers for model property stochasticDistributions + */ + virtual std::vector> GetWriterStochasticDistributions() const = 0; + /** + * Resets the optional property (IsSetRandomSeed() will return false); + */ + virtual void ResetRandomSeed() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'StochasticDistribution' + * From OpenSCENARIO class model specification: + * Container for a stochastic distribution which applies to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochasticDistributionWriter : public IOpenScenarioElementWriter, public IStochasticDistribution + { + public: + virtual ~IStochasticDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the parameter name these distribution values should be applied to. + * + * @return value of model property parameterName + */ + virtual void SetParameterName(const std::string parameterName) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return value of model property stochasticDistributionType + */ + virtual void SetStochasticDistributionType(std::shared_ptr stochasticDistributionType) = 0; + + /** + * Set a parameter for the attribute parameterName + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToParameterName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute parameterName + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromParameterName() const = 0; + + /** + * Retrieves whether the attribute parameterName is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsParameterNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a single stochastic distribution to one parameter. + * + * @return a writer for model property stochasticDistributionType + */ + virtual std::shared_ptr GetWriterStochasticDistributionType() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'StochasticDistributionType' + * From OpenSCENARIO class model specification: + * Container for a stochastic distribution type which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStochasticDistributionTypeWriter : public IOpenScenarioElementWriter, public IStochasticDistributionType + { + public: + virtual ~IStochasticDistributionTypeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines a set of values with a defined probability + * + * @return value of model property probabilityDistributionSet + */ + virtual void SetProbabilityDistributionSet(std::shared_ptr probabilityDistributionSet) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a normal distribution. + * + * @return value of model property normalDistribution + */ + virtual void SetNormalDistribution(std::shared_ptr normalDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a log normal distribution. + * + * @return value of model property logNormalDistribution + */ + virtual void SetLogNormalDistribution(std::shared_ptr logNormalDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a uniform distribution. + * + * @return value of model property uniformDistribution + */ + virtual void SetUniformDistribution(std::shared_ptr uniformDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a poisson distribution. + * + * @return value of model property poissonDistribution + */ + virtual void SetPoissonDistribution(std::shared_ptr poissonDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a histogram. + * + * @return value of model property histogram + */ + virtual void SetHistogram(std::shared_ptr histogram) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a user defined stochastic distribution. + * + * @return value of model property userDefinedDistribution + */ + virtual void SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a set of values with a defined probability + * + * @return a writer for model property probabilityDistributionSet + */ + virtual std::shared_ptr GetWriterProbabilityDistributionSet() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a normal distribution. + * + * @return a writer for model property normalDistribution + */ + virtual std::shared_ptr GetWriterNormalDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a log normal distribution. + * + * @return a writer for model property logNormalDistribution + */ + virtual std::shared_ptr GetWriterLogNormalDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a uniform distribution. + * + * @return a writer for model property uniformDistribution + */ + virtual std::shared_ptr GetWriterUniformDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a poisson distribution. + * + * @return a writer for model property poissonDistribution + */ + virtual std::shared_ptr GetWriterPoissonDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a histogram. + * + * @return a writer for model property histogram + */ + virtual std::shared_ptr GetWriterHistogram() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a user defined stochastic distribution. + * + * @return a writer for model property userDefinedDistribution + */ + virtual std::shared_ptr GetWriterUserDefinedDistribution() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Story' + * From OpenSCENARIO class model specification: + * Grouping of independent executable parts of a scenario. The name of a story must be unique within an OpenSCENARIO file. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryWriter : public IOpenScenarioElementWriter, public IStory, public IStoryboardElementWriter + { + public: + virtual ~IStoryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the story, must be unique within an OpenSCENARIO file. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the acts of the story. + * + * @return value of model property acts + */ + virtual void SetActs(std::vector>& acts) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the acts of the story. + * + * @return a list of writers for model property acts + */ + virtual std::vector> GetWriterActs() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Storyboard' + * From OpenSCENARIO class model specification: + * Top container for the dynamic content of a scenario. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboardWriter : public IOpenScenarioElementWriter, public IStoryboard + { + public: + virtual ~IStoryboardWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Initialization of the storyboard instance. Initial conditions are set and initial actions are applied to entities. + * + * @return value of model property init + */ + virtual void SetInit(std::shared_ptr init) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of stories defined in a story board. + * + * @return value of model property stories + */ + virtual void SetStories(std::vector>& stories) = 0; + + /** + * From OpenSCENARIO class model specification: + * Trigger to stop the Storyboard instance. If no trigger is defined, the Storyboard will be never stopped. + * + * @return value of model property stopTrigger + */ + virtual void SetStopTrigger(std::shared_ptr stopTrigger) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Initialization of the storyboard instance. Initial conditions are set and initial actions are applied to entities. + * + * @return a writer for model property init + */ + virtual std::shared_ptr GetWriterInit() const = 0; + /** + * From OpenSCENARIO class model specification: + * Trigger to stop the Storyboard instance. If no trigger is defined, the Storyboard will be never stopped. + * + * @return a writer for model property stopTrigger + */ + virtual std::shared_ptr GetWriterStopTrigger() const = 0; + + /** + * From OpenSCENARIO class model specification: + * List of stories defined in a story board. + * + * @return a list of writers for model property stories + */ + virtual std::vector> GetWriterStories() const = 0; + /** + * Resets the optional property (IsSetStories() will return false); + */ + virtual void ResetStories() = 0; + + /** + * Resets the optional property (IsSetStopTrigger() will return false); + */ + virtual void ResetStopTrigger() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'StoryboardElementStateCondition' + * From OpenSCENARIO class model specification: + * Considered true if a referenced storyboard element has reached a given runtime state (standbyState, runningState, + * completeState) or if the referenced storyboard element undergoes a specific transition (startTransition, stopTransition, + * endTransition, skipTransition) at a discrete time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboardElementStateConditionWriter : public IOpenScenarioElementWriter, public IStoryboardElementStateCondition + { + public: + virtual ~IStoryboardElementStateConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The state or the transition of the storyboard element instance for which the condition becomes true. + * + * @return value of model property state + */ + virtual void SetState(const StoryboardElementState state) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced Storyboard instance. + * + * @return value of model property storyboardElementRef + */ + virtual void SetStoryboardElementRef(std::shared_ptr> storyboardElementRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Type of storyboard element instance. + * + * @return value of model property storyboardElementType + */ + virtual void SetStoryboardElementType(const StoryboardElementType storyboardElementType) = 0; + + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute storyboardElementRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToStoryboardElementRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute storyboardElementType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToStoryboardElementType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + /** + * Get the parameter for the attribute storyboardElementRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromStoryboardElementRef() const = 0; + /** + * Get the parameter for the attribute storyboardElementType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromStoryboardElementType() const = 0; + + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + /** + * Retrieves whether the attribute storyboardElementRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStoryboardElementRefParameterized() = 0; + /** + * Retrieves whether the attribute storyboardElementType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStoryboardElementTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Sun' + * From OpenSCENARIO class model specification: + * Specification of sun properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISunWriter : public IOpenScenarioElementWriter, public ISun + { + public: + virtual ~ISunWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Azimuth of the sun, counted clockwise, 0=north, PI/2 = east, PI=south, 3/2 PI=west. Unit: [rad]. Range: [0..2*PI]. + * + * @return value of model property azimuth + */ + virtual void SetAzimuth(const double azimuth) = 0; + + /** + * From OpenSCENARIO class model specification: + * Solar elevation angle, 0=x/y plane, PI/2=zenith. Unit: [rad]. Range: [-PI..PI]. + * + * @return value of model property elevation + */ + virtual void SetElevation(const double elevation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Illuminance of the sun, direct sunlight is around 100,000 lx. Unit: [lx]. Range: [0..inf[. Default if missing: 0. + * + * @return value of model property illuminance + */ + virtual void SetIlluminance(const double illuminance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Illuminance of the sun, direct sunlight is around 100,000 lx. Unit: [lx]. Range: [0..inf[. + * + * @return value of model property intensity + */ + virtual void SetIntensity(const double intensity) = 0; + + /** + * Set a parameter for the attribute azimuth + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAzimuth(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute elevation + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToElevation(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute illuminance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToIlluminance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute intensity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToIntensity(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute azimuth + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAzimuth() const = 0; + /** + * Get the parameter for the attribute elevation + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromElevation() const = 0; + /** + * Get the parameter for the attribute illuminance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromIlluminance() const = 0; + /** + * Get the parameter for the attribute intensity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromIntensity() const = 0; + + /** + * Retrieves whether the attribute azimuth is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAzimuthParameterized() = 0; + /** + * Retrieves whether the attribute elevation is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsElevationParameterized() = 0; + /** + * Retrieves whether the attribute illuminance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsIlluminanceParameterized() = 0; + /** + * Retrieves whether the attribute intensity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsIntensityParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetIlluminance() will return false); + */ + virtual void ResetIlluminance() = 0; + + /** + * Resets the optional property (IsSetIntensity() will return false); + */ + virtual void ResetIntensity() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SynchronizeAction' + * From OpenSCENARIO class model specification: + * Synchronizes an entity's arrival at a destination with a master entity. Both entities are provided with their own + * reference position which shall be reached at the same time. Final speed can be specified. Note that the reference + * positions can be different or identical. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISynchronizeActionWriter : public IOpenScenarioElementWriter, public ISynchronizeAction, public IMotionControlActionWriter + { + public: + virtual ~ISynchronizeActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A reference to the master entity. + * + * @return value of model property masterEntityRef + */ + virtual void SetMasterEntityRef(std::shared_ptr> masterEntityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given TargetPosition. Unit: [m]. Range: [0..inf[. + * + * @return value of model property targetTolerance + */ + virtual void SetTargetTolerance(const double targetTolerance) = 0; + + /** + * From OpenSCENARIO class model specification: + * Radius of tolerance circle around given TargetPositionMaster. Unit: [m]. Range: [0..inf[. + * + * @return value of model property targetToleranceMaster + */ + virtual void SetTargetToleranceMaster(const double targetToleranceMaster) = 0; + + /** + * From OpenSCENARIO class model specification: + * The target position for the master entity. + * + * @return value of model property targetPositionMaster + */ + virtual void SetTargetPositionMaster(std::shared_ptr targetPositionMaster) = 0; + + /** + * From OpenSCENARIO class model specification: + * The target position for the entity that should be synchronized. + * + * @return value of model property targetPosition + */ + virtual void SetTargetPosition(std::shared_ptr targetPosition) = 0; + + /** + * From OpenSCENARIO class model specification: + * The speed that the synchronized entity should have at its target position. + * + * @return value of model property finalSpeed + */ + virtual void SetFinalSpeed(std::shared_ptr finalSpeed) = 0; + + /** + * Set a parameter for the attribute masterEntityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMasterEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute targetTolerance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTargetTolerance(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute targetToleranceMaster + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTargetToleranceMaster(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute masterEntityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMasterEntityRef() const = 0; + /** + * Get the parameter for the attribute targetTolerance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTargetTolerance() const = 0; + /** + * Get the parameter for the attribute targetToleranceMaster + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTargetToleranceMaster() const = 0; + + /** + * Retrieves whether the attribute masterEntityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMasterEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute targetTolerance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTargetToleranceParameterized() = 0; + /** + * Retrieves whether the attribute targetToleranceMaster is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTargetToleranceMasterParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The target position for the master entity. + * + * @return a writer for model property targetPositionMaster + */ + virtual std::shared_ptr GetWriterTargetPositionMaster() const = 0; + /** + * From OpenSCENARIO class model specification: + * The target position for the entity that should be synchronized. + * + * @return a writer for model property targetPosition + */ + virtual std::shared_ptr GetWriterTargetPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * The speed that the synchronized entity should have at its target position. + * + * @return a writer for model property finalSpeed + */ + virtual std::shared_ptr GetWriterFinalSpeed() const = 0; + + /** + * Resets the optional property (IsSetTargetTolerance() will return false); + */ + virtual void ResetTargetTolerance() = 0; + + /** + * Resets the optional property (IsSetTargetToleranceMaster() will return false); + */ + virtual void ResetTargetToleranceMaster() = 0; + + /** + * Resets the optional property (IsSetFinalSpeed() will return false); + */ + virtual void ResetFinalSpeed() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TargetDistanceSteadyState' + * From OpenSCENARIO class model specification: + * The distance between object and target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITargetDistanceSteadyStateWriter : public IOpenScenarioElementWriter, public ITargetDistanceSteadyState + { + public: + virtual ~ITargetDistanceSteadyStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The distance. Unit: [m]. Range: ]0..inf[. + * + * @return value of model property distance + */ + virtual void SetDistance(const double distance) = 0; + + /** + * Set a parameter for the attribute distance + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDistance(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute distance + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDistance() const = 0; + + /** + * Retrieves whether the attribute distance is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDistanceParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TargetTimeSteadyState' + * From OpenSCENARIO class model specification: + * The remaining time for object to reach target position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITargetTimeSteadyStateWriter : public IOpenScenarioElementWriter, public ITargetTimeSteadyState + { + public: + virtual ~ITargetTimeSteadyStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The time to reach target position. Unit: [s]. Range: ]0..inf[. + * + * @return value of model property time + */ + virtual void SetTime(const double time) = 0; + + /** + * Set a parameter for the attribute time + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute time + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTime() const = 0; + + /** + * Retrieves whether the attribute time is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TeleportAction' + * From OpenSCENARIO class model specification: + * Specifying a target position an entity is teleported to. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITeleportActionWriter : public IOpenScenarioElementWriter, public ITeleportAction + { + public: + virtual ~ITeleportActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The position the entity/entities are teleported to. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The position the entity/entities are teleported to. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeHeadwayCondition' + * From OpenSCENARIO class model specification: + * Condition based on the headway time between a triggering entity and a reference entity. The reference entity is assumed + * to be leading/ahead, so the triggering entity is trailing. TimeHeadway is calculated similar to TimeToCollision + * (distance divided by relative speed, no acceleration) with the following exception: For the relative speed only the + * speed of the triggering entity is considered but not the speed of the reference entity. This is because it doesn't + * matter where the reference entity moves, only the time it takes for the triggering entity to reach the current position + * of the reference entity is calculated. The logical operator used for comparison is defined by the rule attribute. The + * property "alongRoute" is deprecated. If "coordinateSystem" or "relativeDistanceType" are set, "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeHeadwayConditionWriter : public IOpenScenarioElementWriter, public ITimeHeadwayCondition + { + public: + virtual ~ITimeHeadwayConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. + * + * @return value of model property alongRoute + */ + virtual void SetAlongRoute(const bool alongRoute) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity to which the time headway is computed. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr> entityRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: time headway is measured using the distance between closest bounding box points. False: reference point distance + * is used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * The time headway value. Unit: [s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute alongRoute + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAlongRoute(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute entityRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToEntityRef(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute relativeDistanceType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRelativeDistanceType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute routingAlgorithm + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoutingAlgorithm(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute alongRoute + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAlongRoute() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute entityRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromEntityRef() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + /** + * Get the parameter for the attribute relativeDistanceType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRelativeDistanceType() const = 0; + /** + * Get the parameter for the attribute routingAlgorithm + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoutingAlgorithm() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute alongRoute is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAlongRouteParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute entityRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsEntityRefParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + /** + * Retrieves whether the attribute relativeDistanceType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRelativeDistanceTypeParameterized() = 0; + /** + * Retrieves whether the attribute routingAlgorithm is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoutingAlgorithmParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetAlongRoute() will return false); + */ + virtual void ResetAlongRoute() = 0; + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetRelativeDistanceType() will return false); + */ + virtual void ResetRelativeDistanceType() = 0; + + /** + * Resets the optional property (IsSetRoutingAlgorithm() will return false); + */ + virtual void ResetRoutingAlgorithm() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeOfDay' + * From OpenSCENARIO class model specification: + * Defines the day and time. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeOfDayWriter : public IOpenScenarioElementWriter, public ITimeOfDay + { + public: + virtual ~ITimeOfDayWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If true, the timeofday is animated with progressing simulation time, e.g. in order to animate the position of the sun. + * + * @return value of model property animation + */ + virtual void SetAnimation(const bool animation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Datetime value. + * + * @return value of model property dateTime + */ + virtual void SetDateTime(const DateTime dateTime) = 0; + + /** + * Set a parameter for the attribute animation + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAnimation(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dateTime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDateTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute animation + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAnimation() const = 0; + /** + * Get the parameter for the attribute dateTime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDateTime() const = 0; + + /** + * Retrieves whether the attribute animation is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAnimationParameterized() = 0; + /** + * Retrieves whether the attribute dateTime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDateTimeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeOfDayCondition' + * From OpenSCENARIO class model specification: + * The logical expression is considered true if the simulated time and date verifies the specified relation rule (bigger + * than, smaller than, or equal to) relatively to a given time and date value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeOfDayConditionWriter : public IOpenScenarioElementWriter, public ITimeOfDayCondition + { + public: + virtual ~ITimeOfDayConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Datetime value for comparison. + * + * @return value of model property dateTime + */ + virtual void SetDateTime(const DateTime dateTime) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * Set a parameter for the attribute dateTime + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDateTime(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dateTime + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDateTime() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + + /** + * Retrieves whether the attribute dateTime is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDateTimeParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeReference' + * From OpenSCENARIO class model specification: + * Defines whether time information present in trajectories should be considered. If considered, it may be used as either + * absolute or relative time values. Moreover, a time offset or time scaling may be applied. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeReferenceWriter : public IOpenScenarioElementWriter, public ITimeReference + { + public: + virtual ~ITimeReferenceWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * This property indicates Timing information is neglected. + * + * @return value of model property none + */ + virtual void SetNone(std::shared_ptr none) = 0; + + /** + * From OpenSCENARIO class model specification: + * This property indicates timing information is taken into account. Its underlying properties allow specification of the + * time domain (absolute or relative), time scaling and a global time offset. + * + * @return value of model property timing + */ + virtual void SetTiming(std::shared_ptr timing) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * This property indicates Timing information is neglected. + * + * @return a writer for model property none + */ + virtual std::shared_ptr GetWriterNone() const = 0; + /** + * From OpenSCENARIO class model specification: + * This property indicates timing information is taken into account. Its underlying properties allow specification of the + * time domain (absolute or relative), time scaling and a global time offset. + * + * @return a writer for model property timing + */ + virtual std::shared_ptr GetWriterTiming() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeToCollisionCondition' + * From OpenSCENARIO class model specification: + * The currently predicted time to collision of a triggering entity/entities and either a reference entity or an explicit + * position is compared to a given time value. Time to collision is calculated as the distance divided by the relative + * speed. Acceleration of entities is not taken into consideration. For the relative speed calculation the same coordinate + * system and relative distance type applies as for the distance calculation. If the relative speed is negative, which + * means the entity is moving away from the position / the entities are moving away from each other, then the time to + * collision cannot be predicted and the condition evaluates to false. The logical operator for comparison is defined by + * the rule attribute. The property "alongRoute" is deprecated. If "coordinateSystem" or "relativeDistanceType" are set, + * "alongRoute" is ignored. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeToCollisionConditionWriter : public IOpenScenarioElementWriter, public ITimeToCollisionCondition + { + public: + virtual ~ITimeToCollisionConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: routing is taken into account, e.g. turns will increase distance. False: straight line distance is used. This + * value is ignored if "coordinateSystem" or "relativeDistanceType" is set. + * + * @return value of model property alongRoute + */ + virtual void SetAlongRoute(const bool alongRoute) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system to be used for calculations. If not provided the value is interpreted as "entity". + * If set, "alongRoute" is ignored. + * + * @return value of model property coordinateSystem + */ + virtual void SetCoordinateSystem(const CoordinateSystem coordinateSystem) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: time to collision is measured using the distance between closest bounding box points. False: reference point + * distance is used. + * + * @return value of model property freespace + */ + virtual void SetFreespace(const bool freespace) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the coordinate system dimension(s) to be used for calculating distances. If set "alongRoute" is ignored. + * If not provided, value is interpreted as "euclideanDistance". + * + * @return value of model property relativeDistanceType + */ + virtual void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) = 0; + + /** + * From OpenSCENARIO class model specification: + * Algorithm for path selection/calculation between two positions across roads. Only relevant, if CoordinateSystem is + * "road"/"lane". Default value if omitted: "undefined". + * + * @return value of model property routingAlgorithm + */ + virtual void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * The time to collision value. Unit: [s]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * From OpenSCENARIO class model specification: + * The explicit position or a position defined through the current position of a reference entity. + * + * @return value of model property timeToCollisionConditionTarget + */ + virtual void SetTimeToCollisionConditionTarget(std::shared_ptr timeToCollisionConditionTarget) = 0; + + /** + * Set a parameter for the attribute alongRoute + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAlongRoute(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute coordinateSystem + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCoordinateSystem(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute freespace + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFreespace(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute relativeDistanceType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRelativeDistanceType(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute routingAlgorithm + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRoutingAlgorithm(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute alongRoute + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAlongRoute() const = 0; + /** + * Get the parameter for the attribute coordinateSystem + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCoordinateSystem() const = 0; + /** + * Get the parameter for the attribute freespace + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFreespace() const = 0; + /** + * Get the parameter for the attribute relativeDistanceType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRelativeDistanceType() const = 0; + /** + * Get the parameter for the attribute routingAlgorithm + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRoutingAlgorithm() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute alongRoute is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAlongRouteParameterized() = 0; + /** + * Retrieves whether the attribute coordinateSystem is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCoordinateSystemParameterized() = 0; + /** + * Retrieves whether the attribute freespace is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFreespaceParameterized() = 0; + /** + * Retrieves whether the attribute relativeDistanceType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRelativeDistanceTypeParameterized() = 0; + /** + * Retrieves whether the attribute routingAlgorithm is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoutingAlgorithmParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The explicit position or a position defined through the current position of a reference entity. + * + * @return a writer for model property timeToCollisionConditionTarget + */ + virtual std::shared_ptr GetWriterTimeToCollisionConditionTarget() const = 0; + + /** + * Resets the optional property (IsSetAlongRoute() will return false); + */ + virtual void ResetAlongRoute() = 0; + + /** + * Resets the optional property (IsSetCoordinateSystem() will return false); + */ + virtual void ResetCoordinateSystem() = 0; + + /** + * Resets the optional property (IsSetRelativeDistanceType() will return false); + */ + virtual void ResetRelativeDistanceType() = 0; + + /** + * Resets the optional property (IsSetRoutingAlgorithm() will return false); + */ + virtual void ResetRoutingAlgorithm() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TimeToCollisionConditionTarget' + * From OpenSCENARIO class model specification: + * Target position used in the TimeToCollisionCondition. Can be defined as either an explicit position, or the position of + * a reference entity. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimeToCollisionConditionTargetWriter : public IOpenScenarioElementWriter, public ITimeToCollisionConditionTarget + { + public: + virtual ~ITimeToCollisionConditionTargetWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Position. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return value of model property entityRef + */ + virtual void SetEntityRef(std::shared_ptr entityRef) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Position. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference entity. + * + * @return a writer for model property entityRef + */ + virtual std::shared_ptr GetWriterEntityRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Timing' + * From OpenSCENARIO class model specification: + * Adjust the timing within time references by scale and offset. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITimingWriter : public IOpenScenarioElementWriter, public ITiming + { + public: + virtual ~ITimingWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of time value context as either absolute or relative. + * + * @return value of model property domainAbsoluteRelative + */ + virtual void SetDomainAbsoluteRelative(const ReferenceContext domainAbsoluteRelative) = 0; + + /** + * From OpenSCENARIO class model specification: + * Introduction of a global offset for all time values. Unit: [s]. Range: ]-inf..inf[. + * + * @return value of model property offset + */ + virtual void SetOffset(const double offset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Scaling factor for time values. While values smaller than 1.0 represent negative scaling, values larger than 1.0 will + * result in positive scaling. A value of 1.0 means no scaling. Range: ]0..inf[. + * + * @return value of model property scale + */ + virtual void SetScale(const double scale) = 0; + + /** + * Set a parameter for the attribute domainAbsoluteRelative + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDomainAbsoluteRelative(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute offset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOffset(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute scale + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToScale(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute domainAbsoluteRelative + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDomainAbsoluteRelative() const = 0; + /** + * Get the parameter for the attribute offset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOffset() const = 0; + /** + * Get the parameter for the attribute scale + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromScale() const = 0; + + /** + * Retrieves whether the attribute domainAbsoluteRelative is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDomainAbsoluteRelativeParameterized() = 0; + /** + * Retrieves whether the attribute offset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOffsetParameterized() = 0; + /** + * Retrieves whether the attribute scale is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsScaleParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficAction' + * From OpenSCENARIO class model specification: + * Actions defining macroscopic traffic flow and behavior. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficActionWriter : public IOpenScenarioElementWriter, public ITrafficAction + { + public: + virtual ~ITrafficActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the traffic that is created. This name can be referenced when stopping the traffic with StopTrafficAction. + * + * @return value of model property trafficName + */ + virtual void SetTrafficName(const std::string trafficName) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a source of traffic at a specific position. + * + * @return value of model property trafficSourceAction + */ + virtual void SetTrafficSourceAction(std::shared_ptr trafficSourceAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines a sink of traffic at a specific position. + * + * @return value of model property trafficSinkAction + */ + virtual void SetTrafficSinkAction(std::shared_ptr trafficSinkAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines swarm traffic around a given central entity. + * + * @return value of model property trafficSwarmAction + */ + virtual void SetTrafficSwarmAction(std::shared_ptr trafficSwarmAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines traffic in a specific area. + * + * @return value of model property trafficAreaAction + */ + virtual void SetTrafficAreaAction(std::shared_ptr trafficAreaAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Stops traffic instances (area, swarm, source, sink). + * + * @return value of model property trafficStopAction + */ + virtual void SetTrafficStopAction(std::shared_ptr trafficStopAction) = 0; + + /** + * Set a parameter for the attribute trafficName + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrafficName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute trafficName + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrafficName() const = 0; + + /** + * Retrieves whether the attribute trafficName is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrafficNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines a source of traffic at a specific position. + * + * @return a writer for model property trafficSourceAction + */ + virtual std::shared_ptr GetWriterTrafficSourceAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines a sink of traffic at a specific position. + * + * @return a writer for model property trafficSinkAction + */ + virtual std::shared_ptr GetWriterTrafficSinkAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines swarm traffic around a given central entity. + * + * @return a writer for model property trafficSwarmAction + */ + virtual std::shared_ptr GetWriterTrafficSwarmAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines traffic in a specific area. + * + * @return a writer for model property trafficAreaAction + */ + virtual std::shared_ptr GetWriterTrafficAreaAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Stops traffic instances (area, swarm, source, sink). + * + * @return a writer for model property trafficStopAction + */ + virtual std::shared_ptr GetWriterTrafficStopAction() const = 0; + + /** + * Resets the optional property (IsSetTrafficName() will return false); + */ + virtual void ResetTrafficName() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficArea' + * From OpenSCENARIO class model specification: + * Defines the area, where the traffic shall be spawned. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficAreaWriter : public IOpenScenarioElementWriter, public ITrafficArea + { + public: + virtual ~ITrafficAreaWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines an area by a polygon. Suitable for urban areas, where all roads within an area shall be populated. + * + * @return value of model property polygon + */ + virtual void SetPolygon(std::shared_ptr polygon) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines an area by one or multiple road ranges. Suitable for highways, where only a few specific roads shall be + * populated. + * + * @return value of model property roadRange + */ + virtual void SetRoadRange(std::vector>& roadRange) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines an area by a polygon. Suitable for urban areas, where all roads within an area shall be populated. + * + * @return a writer for model property polygon + */ + virtual std::shared_ptr GetWriterPolygon() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines an area by one or multiple road ranges. Suitable for highways, where only a few specific roads shall be + * populated. + * + * @return a list of writers for model property roadRange + */ + virtual std::vector> GetWriterRoadRange() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficAreaAction' + * From OpenSCENARIO class model specification: + * Defines traffic in a specific area. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficAreaActionWriter : public IOpenScenarioElementWriter, public ITrafficAreaAction + { + public: + virtual ~ITrafficAreaActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If false, then traffic shall be only spawned once when the action is started and the action ends immediately. If true, + * then continuously the spawned traffic is despawned when it leaves the area and new traffic is spawned in the area to + * keep a constant number of entities. + * + * @return value of model property continuous + */ + virtual void SetContinuous(const bool continuous) = 0; + + /** + * From OpenSCENARIO class model specification: + * The maximum number of spawned entities in the area. Depending on the size of the area and the available spawning + * positions on the included roads, less than numberOfEntities might be set up. Range: [0..inf[. + * + * @return value of model property numberOfEntities + */ + virtual void SetNumberOfEntities(const uint32_t numberOfEntities) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the entity and controller distribution for the traffic. + * + * @return value of model property trafficDistribution + */ + virtual void SetTrafficDistribution(std::shared_ptr trafficDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the area, where the traffic shall be spawned. + * + * @return value of model property trafficArea + */ + virtual void SetTrafficArea(std::shared_ptr trafficArea) = 0; + + /** + * Set a parameter for the attribute continuous + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContinuous(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute numberOfEntities + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToNumberOfEntities(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute continuous + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContinuous() const = 0; + /** + * Get the parameter for the attribute numberOfEntities + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromNumberOfEntities() const = 0; + + /** + * Retrieves whether the attribute continuous is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContinuousParameterized() = 0; + /** + * Retrieves whether the attribute numberOfEntities is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNumberOfEntitiesParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the entity and controller distribution for the traffic. + * + * @return a writer for model property trafficDistribution + */ + virtual std::shared_ptr GetWriterTrafficDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the area, where the traffic shall be spawned. + * + * @return a writer for model property trafficArea + */ + virtual std::shared_ptr GetWriterTrafficArea() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficDefinition' + * From OpenSCENARIO class model specification: + * Definition of macroscopic traffic based on vehicle and controller definitions. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDefinitionWriter : public IOpenScenarioElementWriter, public ITrafficDefinition + { + public: + virtual ~ITrafficDefinitionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the traffic definition. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle categories within the traffic. + * + * @return value of model property vehicleCategoryDistribution + */ + virtual void SetVehicleCategoryDistribution(std::shared_ptr vehicleCategoryDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle roles within the traffic. + * + * @return value of model property vehicleRoleDistribution + */ + virtual void SetVehicleRoleDistribution(std::shared_ptr vehicleRoleDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distribution of controllers within this traffic. + * + * @return value of model property controllerDistribution + */ + virtual void SetControllerDistribution(std::shared_ptr controllerDistribution) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle categories within the traffic. + * + * @return a writer for model property vehicleCategoryDistribution + */ + virtual std::shared_ptr GetWriterVehicleCategoryDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle roles within the traffic. + * + * @return a writer for model property vehicleRoleDistribution + */ + virtual std::shared_ptr GetWriterVehicleRoleDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Distribution of controllers within this traffic. + * + * @return a writer for model property controllerDistribution + */ + virtual std::shared_ptr GetWriterControllerDistribution() const = 0; + + /** + * Resets the optional property (IsSetVehicleRoleDistribution() will return false); + */ + virtual void ResetVehicleRoleDistribution() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficDistribution' + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of a traffic source/swarm including their controllers. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDistributionWriter : public IOpenScenarioElementWriter, public ITrafficDistribution + { + public: + virtual ~ITrafficDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted vehicle/pedestrian entity groups as part of the traffic. + * + * @return value of model property trafficDistributionEntry + */ + virtual void SetTrafficDistributionEntry(std::vector>& trafficDistributionEntry) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines the weighted vehicle/pedestrian entity groups as part of the traffic. + * + * @return a list of writers for model property trafficDistributionEntry + */ + virtual std::vector> GetWriterTrafficDistributionEntry() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficDistributionEntry' + * From OpenSCENARIO class model specification: + * Defines one weighted vehicle/pedestrian entity group as part of the traffic. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficDistributionEntryWriter : public IOpenScenarioElementWriter, public ITrafficDistributionEntry + { + public: + virtual ~ITrafficDistributionEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The weight of this entity group within the traffic distribution. Range: ]0..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * From OpenSCENARIO class model specification: + * The entity group within the traffic distribution. + * + * @return value of model property entityDistribution + */ + virtual void SetEntityDistribution(std::shared_ptr entityDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * Describing tool specific properties for spawning of the entity group (e.g. spawn only on the rightmost lane for a truck + * group, overwrite speed range for slower vehicles/trucks). + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The entity group within the traffic distribution. + * + * @return a writer for model property entityDistribution + */ + virtual std::shared_ptr GetWriterEntityDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * Describing tool specific properties for spawning of the entity group (e.g. spawn only on the rightmost lane for a truck + * group, overwrite speed range for slower vehicles/trucks). + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalAction' + * From OpenSCENARIO class model specification: + * Action used to change the state of a traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalActionWriter : public IOpenScenarioElementWriter, public ITrafficSignalAction + { + public: + virtual ~ITrafficSignalActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Action used to set a semantic phase of a TrafficSignalController. + * + * @return value of model property trafficSignalControllerAction + */ + virtual void SetTrafficSignalControllerAction(std::shared_ptr trafficSignalControllerAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Action used to control the observable state of a signal. + * + * @return value of model property trafficSignalStateAction + */ + virtual void SetTrafficSignalStateAction(std::shared_ptr trafficSignalStateAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Action used to set a semantic phase of a TrafficSignalController. + * + * @return a writer for model property trafficSignalControllerAction + */ + virtual std::shared_ptr GetWriterTrafficSignalControllerAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Action used to control the observable state of a signal. + * + * @return a writer for model property trafficSignalStateAction + */ + virtual std::shared_ptr GetWriterTrafficSignalStateAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalCondition' + * From OpenSCENARIO class model specification: + * Considered true if a referenced traffic signal (e.g. from an OpenDRIVE file) reaches a specific observable state. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalConditionWriter : public IOpenScenarioElementWriter, public ITrafficSignalCondition + { + public: + virtual ~ITrafficSignalConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * ID of the referenced signal in a road network file. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Observable state of the signal to be reached for the condition to become true. + * + * @return value of model property state + */ + virtual void SetState(const std::string state) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalController' + * From OpenSCENARIO class model specification: + * The TrafficSignalController provides a signal cycle to a single signal or a signal group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalControllerWriter : public IOpenScenarioElementWriter, public ITrafficSignalController + { + public: + virtual ~ITrafficSignalControllerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The delay to the controller in the reference property. A controller having a delay to another one means that its first + * phase virtually starts delaytime seconds after the start of the reference's first phase. This can be used to define a + * progressive signal system, but only makes sense, if the total times of all connected controllers are the same. If delay + * is set, reference is required. Unit: [s]. Range: [0..inf[. + * + * @return value of model property delay + */ + virtual void SetDelay(const double delay) = 0; + + /** + * From OpenSCENARIO class model specification: + * ID of the TrafficSignalController for reference within the scenario and the reference to an OpenDRIVE signal group ID. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * A reference (ID) to a TrafficSignalController. If reference is set, a delay is required. + * + * @return value of model property reference + */ + virtual void SetReference(const std::string reference) = 0; + + /** + * From OpenSCENARIO class model specification: + * Semantic phases of a TrafficSignalController, forming the signal cycle. + * + * @return value of model property phases + */ + virtual void SetPhases(std::vector>& phases) = 0; + + /** + * Set a parameter for the attribute delay + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDelay(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute reference + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToReference(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute delay + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDelay() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute reference + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromReference() const = 0; + + /** + * Retrieves whether the attribute delay is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDelayParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute reference is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsReferenceParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * Semantic phases of a TrafficSignalController, forming the signal cycle. + * + * @return a list of writers for model property phases + */ + virtual std::vector> GetWriterPhases() const = 0; + /** + * Resets the optional property (IsSetDelay() will return false); + */ + virtual void ResetDelay() = 0; + + /** + * Resets the optional property (IsSetReference() will return false); + */ + virtual void ResetReference() = 0; + + /** + * Resets the optional property (IsSetPhases() will return false); + */ + virtual void ResetPhases() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalControllerAction' + * From OpenSCENARIO class model specification: + * Sets a specific semantic phase of a traffic signal controller, typically affecting a signal group. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalControllerActionWriter : public IOpenScenarioElementWriter, public ITrafficSignalControllerAction + { + public: + virtual ~ITrafficSignalControllerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Targeted phase of the signal controller. + * + * @return value of model property phase + */ + virtual void SetPhase(const std::string phase) = 0; + + /** + * From OpenSCENARIO class model specification: + * ID of the signal controller in a road network. + * + * @return value of model property trafficSignalControllerRef + */ + virtual void SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The reference to the semantic phase (phase is the referential key in the referenced TrafficSignalController). + * + * @return value of model property phaseRef + */ + virtual void SetPhaseRef(std::vector>& phaseRef) = 0; + + /** + * Set a parameter for the attribute phase + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPhase(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute trafficSignalControllerRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrafficSignalControllerRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute phase + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPhase() const = 0; + /** + * Get the parameter for the attribute trafficSignalControllerRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrafficSignalControllerRef() const = 0; + + /** + * Retrieves whether the attribute phase is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPhaseParameterized() = 0; + /** + * Retrieves whether the attribute trafficSignalControllerRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrafficSignalControllerRefParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetPhaseRef() will return false); + */ + virtual void ResetPhaseRef() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalControllerCondition' + * From OpenSCENARIO class model specification: + * Considered true if a given TrafficSignalController (which shall be defined within OpenSCENARIO) reaches a specific + * semantic phase. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalControllerConditionWriter : public IOpenScenarioElementWriter, public ITrafficSignalControllerCondition + { + public: + virtual ~ITrafficSignalControllerConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced phase of the TrafficSignalController to be reached for the condition to become true. + * + * @return value of model property phase + */ + virtual void SetPhase(const std::string phase) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the referenced TrafficSignalController. + * + * @return value of model property trafficSignalControllerRef + */ + virtual void SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * The reference to the semantic phase (phase is the referential key in the referenced TrafficSignalController). + * + * @return value of model property phaseRef + */ + virtual void SetPhaseRef(std::vector>& phaseRef) = 0; + + /** + * Set a parameter for the attribute phase + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToPhase(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute trafficSignalControllerRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrafficSignalControllerRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute phase + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromPhase() const = 0; + /** + * Get the parameter for the attribute trafficSignalControllerRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrafficSignalControllerRef() const = 0; + + /** + * Retrieves whether the attribute phase is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPhaseParameterized() = 0; + /** + * Retrieves whether the attribute trafficSignalControllerRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrafficSignalControllerRefParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetPhaseRef() will return false); + */ + virtual void ResetPhaseRef() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalGroupState' + * From OpenSCENARIO class model specification: + * Observable state of a traffic signal group within one semantic phase. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalGroupStateWriter : public IOpenScenarioElementWriter, public ITrafficSignalGroupState + { + public: + virtual ~ITrafficSignalGroupStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Observable state of all signals controlled by this TrafficSignalController, e.g. the visual information "off;off;on". + * The number of values in the state depends on the traffic signal in the roadnetwork , e.g. type and subtype in OpenDRIVE + * + * @return value of model property state + */ + virtual void SetState(const std::string state) = 0; + + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalState' + * From OpenSCENARIO class model specification: + * State of a traffic signal for this phase. One state per phase and traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalStateWriter : public IOpenScenarioElementWriter, public ITrafficSignalState + { + public: + virtual ~ITrafficSignalStateWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Observable state of the signal, e.g. "off;off;on". The number of values in the state depends on the traffic signal in + * the roadnetwork , e.g. type and subtype in OpenDRIVE + * + * @return value of model property state + */ + virtual void SetState(const std::string state) = 0; + + /** + * From OpenSCENARIO class model specification: + * ID of the referenced signal in a road network file. + * + * @return value of model property trafficSignalId + */ + virtual void SetTrafficSignalId(const std::string trafficSignalId) = 0; + + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute trafficSignalId + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTrafficSignalId(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + /** + * Get the parameter for the attribute trafficSignalId + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTrafficSignalId() const = 0; + + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + /** + * Retrieves whether the attribute trafficSignalId is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrafficSignalIdParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSignalStateAction' + * From OpenSCENARIO class model specification: + * Controls the observable state of a traffic signal. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSignalStateActionWriter : public IOpenScenarioElementWriter, public ITrafficSignalStateAction + { + public: + virtual ~ITrafficSignalStateActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * ID of a signal in a road network file. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Targeted state of the signal. The number of light bulbs, i.e. observable states can be derived from the type of the + * dynamic signal in the road network file. + * + * @return value of model property state + */ + virtual void SetState(const std::string state) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute state + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToState(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute state + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromState() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute state is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsStateParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSinkAction' + * From OpenSCENARIO class model specification: + * Defines a sink of traffic at a specific position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSinkActionWriter : public IOpenScenarioElementWriter, public ITrafficSinkAction + { + public: + virtual ~ITrafficSinkActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the radius of the traffic sink where vehicles disappear around the specified position. Unit: [m]. Range: + * [0..inf[. + * + * @return value of model property radius + */ + virtual void SetRadius(const double radius) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the rate on which vehicles disappear at the sinks location. If omitted, rate is interpreted as 'inf'. Unit: + * [vehicles/s]. Range: [0..inf[. + * + * @return value of model property rate + */ + virtual void SetRate(const double rate) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic sink. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the sink. + * + * @return value of model property trafficDefinition + */ + virtual void SetTrafficDefinition(std::shared_ptr trafficDefinition) = 0; + + /** + * Set a parameter for the attribute radius + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRadius(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRate(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute radius + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRadius() const = 0; + /** + * Get the parameter for the attribute rate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRate() const = 0; + + /** + * Retrieves whether the attribute radius is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRadiusParameterized() = 0; + /** + * Retrieves whether the attribute rate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRateParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic sink. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the sink. + * + * @return a writer for model property trafficDefinition + */ + virtual std::shared_ptr GetWriterTrafficDefinition() const = 0; + + /** + * Resets the optional property (IsSetRate() will return false); + */ + virtual void ResetRate() = 0; + + /** + * Resets the optional property (IsSetTrafficDefinition() will return false); + */ + virtual void ResetTrafficDefinition() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSourceAction' + * From OpenSCENARIO class model specification: + * Defines a source of traffic at a specific position. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSourceActionWriter : public IOpenScenarioElementWriter, public ITrafficSourceAction + { + public: + virtual ~ITrafficSourceActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the radius of the traffic source where vehicles appear around the specific position. Unit: [m]. Range: [0..inf[. + * + * @return value of model property radius + */ + virtual void SetRadius(const double radius) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the rate on which vehicles appear at the source location. Unit: [vehicles/s]. Range: [0..inf[. + * + * @return value of model property rate + */ + virtual void SetRate(const double rate) = 0; + + /** + * From OpenSCENARIO class model specification: + * The optional starting speed of a scenario object. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property speed + */ + virtual void SetSpeed(const double speed) = 0; + + /** + * From OpenSCENARIO class model specification: + * The optional starting velocity of a scenario object. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property velocity + */ + virtual void SetVelocity(const double velocity) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic source. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the source. + * + * @return value of model property trafficDefinition + */ + virtual void SetTrafficDefinition(std::shared_ptr trafficDefinition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic source including their controllers. + * + * @return value of model property trafficDistribution + */ + virtual void SetTrafficDistribution(std::shared_ptr trafficDistribution) = 0; + + /** + * Set a parameter for the attribute radius + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRadius(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rate + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRate(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute speed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpeed(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute velocity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVelocity(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute radius + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRadius() const = 0; + /** + * Get the parameter for the attribute rate + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRate() const = 0; + /** + * Get the parameter for the attribute speed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpeed() const = 0; + /** + * Get the parameter for the attribute velocity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVelocity() const = 0; + + /** + * Retrieves whether the attribute radius is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRadiusParameterized() = 0; + /** + * Retrieves whether the attribute rate is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRateParameterized() = 0; + /** + * Retrieves whether the attribute speed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpeedParameterized() = 0; + /** + * Retrieves whether the attribute velocity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVelocityParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the position of the traffic source. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle and controller distribution for the source. + * + * @return a writer for model property trafficDefinition + */ + virtual std::shared_ptr GetWriterTrafficDefinition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic source including their controllers. + * + * @return a writer for model property trafficDistribution + */ + virtual std::shared_ptr GetWriterTrafficDistribution() const = 0; + + /** + * Resets the optional property (IsSetSpeed() will return false); + */ + virtual void ResetSpeed() = 0; + + /** + * Resets the optional property (IsSetVelocity() will return false); + */ + virtual void ResetVelocity() = 0; + + /** + * Resets the optional property (IsSetTrafficDefinition() will return false); + */ + virtual void ResetTrafficDefinition() = 0; + + /** + * Resets the optional property (IsSetTrafficDistribution() will return false); + */ + virtual void ResetTrafficDistribution() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficStopAction' + * From OpenSCENARIO class model specification: + * This action stops one or more traffic instances. The instances to be stopped are identified by their name. All active + * traffic instances with this name are stopped. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficStopActionWriter : public IOpenScenarioElementWriter, public ITrafficStopAction + { + public: + virtual ~ITrafficStopActionWriter() = default; + + + + + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrafficSwarmAction' + * From OpenSCENARIO class model specification: + * Defines swarm traffic within an elliptical planview around a given central entity. The innerRadius defines the minimum + * distance between the central vehicle and swarm traffic. The latter is set up in the free space between the circular area + * defined by innerRadius and the outline of the ellipsis defined by the two semi axis attributes. While vehicles are + * created in this area, they are removed if they leave it crossing the it ellipsis’ outline. Within the innerRadius, + * vehicles are neither set up nor removed. Optionally, the swarm area can be longitudinally offset to the central scenario + * object. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrafficSwarmActionWriter : public IOpenScenarioElementWriter, public ITrafficSwarmAction + { + public: + virtual ~ITrafficSwarmActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Radius of the inner circular area around the central entity. Unit: [m]. Range: [0..inf[. + * + * @return value of model property innerRadius + */ + virtual void SetInnerRadius(const double innerRadius) = 0; + + /** + * From OpenSCENARIO class model specification: + * The maximum number of vehicles surrounding the central entity. Depending on the current road situation less than + * numberOfVehicles might be set up. Range: [0..inf[. + * + * @return value of model property numberOfVehicles + */ + virtual void SetNumberOfVehicles(const uint32_t numberOfVehicles) = 0; + + /** + * From OpenSCENARIO class model specification: + * Offset in longitudinal direction related to the x-axis of the central entity. Unit: [m]. + * + * @return value of model property offset + */ + virtual void SetOffset(const double offset) = 0; + + /** + * From OpenSCENARIO class model specification: + * Shape of the swarm traffic distribution area is given as an ellipsis around a central entity. SemiMajorAxis defines the + * half length of the major axis of this ellipsis. Unit: [m]. Range: [0..inf[. + * + * @return value of model property semiMajorAxis + */ + virtual void SetSemiMajorAxis(const double semiMajorAxis) = 0; + + /** + * From OpenSCENARIO class model specification: + * Shape of the swarm traffic distribution area is given as an ellipsis around a central entity. SemiMinorAxis defines the + * half length of the minor axis of this ellipsis. Unit: [m]. Range: [0..inf[. + * + * @return value of model property semiMinorAxis + */ + virtual void SetSemiMinorAxis(const double semiMinorAxis) = 0; + + /** + * From OpenSCENARIO class model specification: + * The optional starting velocity of the created entities. Unit: [m/s]. Range: [0..inf[. + * + * @return value of model property velocity + */ + virtual void SetVelocity(const double velocity) = 0; + + /** + * From OpenSCENARIO class model specification: + * The entity that represents the center of a swarm. + * + * @return value of model property centralObject + */ + virtual void SetCentralObject(std::shared_ptr centralObject) = 0; + + /** + * From OpenSCENARIO class model specification: + * Specifies properties of autonomous traffic with respect to vehicle and driver distributions. + * + * @return value of model property trafficDefinition + */ + virtual void SetTrafficDefinition(std::shared_ptr trafficDefinition) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic swarm including their controllers. + * + * @return value of model property trafficDistribution + */ + virtual void SetTrafficDistribution(std::shared_ptr trafficDistribution) = 0; + + /** + * From OpenSCENARIO class model specification: + * The optional starting speeds of the created entities. Unit: [m/s]; Range for lower and upper limit: [0..inf[. + * Distributed uniformly/equally. + * + * @return value of model property initialSpeedRange + */ + virtual void SetInitialSpeedRange(std::shared_ptr initialSpeedRange) = 0; + + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle directions of travel relative to the centralObject. If omitted, direction of travel is + * distributed uniformly. + * + * @return value of model property directionOfTravelDistribution + */ + virtual void SetDirectionOfTravelDistribution(std::shared_ptr directionOfTravelDistribution) = 0; + + /** + * Set a parameter for the attribute innerRadius + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToInnerRadius(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute numberOfVehicles + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToNumberOfVehicles(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute offset + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToOffset(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute semiMajorAxis + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSemiMajorAxis(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute semiMinorAxis + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSemiMinorAxis(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute velocity + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVelocity(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute innerRadius + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromInnerRadius() const = 0; + /** + * Get the parameter for the attribute numberOfVehicles + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromNumberOfVehicles() const = 0; + /** + * Get the parameter for the attribute offset + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromOffset() const = 0; + /** + * Get the parameter for the attribute semiMajorAxis + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSemiMajorAxis() const = 0; + /** + * Get the parameter for the attribute semiMinorAxis + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSemiMinorAxis() const = 0; + /** + * Get the parameter for the attribute velocity + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVelocity() const = 0; + + /** + * Retrieves whether the attribute innerRadius is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsInnerRadiusParameterized() = 0; + /** + * Retrieves whether the attribute numberOfVehicles is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNumberOfVehiclesParameterized() = 0; + /** + * Retrieves whether the attribute offset is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsOffsetParameterized() = 0; + /** + * Retrieves whether the attribute semiMajorAxis is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSemiMajorAxisParameterized() = 0; + /** + * Retrieves whether the attribute semiMinorAxis is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSemiMinorAxisParameterized() = 0; + /** + * Retrieves whether the attribute velocity is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVelocityParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The entity that represents the center of a swarm. + * + * @return a writer for model property centralObject + */ + virtual std::shared_ptr GetWriterCentralObject() const = 0; + /** + * From OpenSCENARIO class model specification: + * Specifies properties of autonomous traffic with respect to vehicle and driver distributions. + * + * @return a writer for model property trafficDefinition + */ + virtual std::shared_ptr GetWriterTrafficDefinition() const = 0; + /** + * From OpenSCENARIO class model specification: + * Defines the vehicle/pedestrian distribution of the traffic swarm including their controllers. + * + * @return a writer for model property trafficDistribution + */ + virtual std::shared_ptr GetWriterTrafficDistribution() const = 0; + /** + * From OpenSCENARIO class model specification: + * The optional starting speeds of the created entities. Unit: [m/s]; Range for lower and upper limit: [0..inf[. + * Distributed uniformly/equally. + * + * @return a writer for model property initialSpeedRange + */ + virtual std::shared_ptr GetWriterInitialSpeedRange() const = 0; + /** + * From OpenSCENARIO class model specification: + * Distribution of vehicle directions of travel relative to the centralObject. If omitted, direction of travel is + * distributed uniformly. + * + * @return a writer for model property directionOfTravelDistribution + */ + virtual std::shared_ptr GetWriterDirectionOfTravelDistribution() const = 0; + + /** + * Resets the optional property (IsSetVelocity() will return false); + */ + virtual void ResetVelocity() = 0; + + /** + * Resets the optional property (IsSetTrafficDefinition() will return false); + */ + virtual void ResetTrafficDefinition() = 0; + + /** + * Resets the optional property (IsSetTrafficDistribution() will return false); + */ + virtual void ResetTrafficDistribution() = 0; + + /** + * Resets the optional property (IsSetInitialSpeedRange() will return false); + */ + virtual void ResetInitialSpeedRange() = 0; + + /** + * Resets the optional property (IsSetDirectionOfTravelDistribution() will return false); + */ + virtual void ResetDirectionOfTravelDistribution() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Trailer' + * From OpenSCENARIO class model specification: + * Definition of a trailer to be towed. The included or referred ScenarioObject must include an EntityObject of type + * Vehicle. The Vehicle must have a trailerCoupler in order for the connection to be complete. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerWriter : public IOpenScenarioElementWriter, public ITrailer + { + public: + virtual ~ITrailerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of a trailer vehicle (inline or catalog reference). + * + * @return value of model property trailer + */ + virtual void SetTrailer(std::shared_ptr trailer) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the trailer vehicle. + * + * @return value of model property trailerRef + */ + virtual void SetTrailerRef(std::shared_ptr trailerRef) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Definition of a trailer vehicle (inline or catalog reference). + * + * @return a writer for model property trailer + */ + virtual std::shared_ptr GetWriterTrailer() const = 0; + /** + * From OpenSCENARIO class model specification: + * Name of the trailer vehicle. + * + * @return a writer for model property trailerRef + */ + virtual std::shared_ptr GetWriterTrailerRef() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrailerAction' + * From OpenSCENARIO class model specification: + * Action to connect or disconnect trailer. Applied to the towing vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerActionWriter : public IOpenScenarioElementWriter, public ITrailerAction + { + public: + virtual ~ITrailerActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Connect a trailer to a vehicle. Any other already connected trailer will be disconnected. + * + * @return value of model property connectTrailerAction + */ + virtual void SetConnectTrailerAction(std::shared_ptr connectTrailerAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Disconnect any connected trailer from a vehicle. + * + * @return value of model property disconnectTrailerAction + */ + virtual void SetDisconnectTrailerAction(std::shared_ptr disconnectTrailerAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Connect a trailer to a vehicle. Any other already connected trailer will be disconnected. + * + * @return a writer for model property connectTrailerAction + */ + virtual std::shared_ptr GetWriterConnectTrailerAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Disconnect any connected trailer from a vehicle. + * + * @return a writer for model property disconnectTrailerAction + */ + virtual std::shared_ptr GetWriterDisconnectTrailerAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrailerCoupler' + * From OpenSCENARIO class model specification: + * Definition of the mounting point for connecting the trailer to a towing vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerCouplerWriter : public IOpenScenarioElementWriter, public ITrailerCoupler + { + public: + virtual ~ITrailerCouplerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Relative position of the trailerCoupler in the x axis, using the coordinate system of the vehicle. + * + * @return value of model property dx + */ + virtual void SetDx(const double dx) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the vehicle. If omitted, z of the towing vehicle's hitch + * will be applied. If neither hitch nor coupler has a z value, a 2D connection will be applied, constrained to rotation in + * the XY-plane. + * + * @return value of model property dz + */ + virtual void SetDz(const double dz) = 0; + + /** + * Set a parameter for the attribute dx + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDx(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dz + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDz(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dx + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDx() const = 0; + /** + * Get the parameter for the attribute dz + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDz() const = 0; + + /** + * Retrieves whether the attribute dx is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDxParameterized() = 0; + /** + * Retrieves whether the attribute dz is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDzParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetDz() will return false); + */ + virtual void ResetDz() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrailerHitch' + * From OpenSCENARIO class model specification: + * Definition of the mounting point for connecting a trailer to the vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrailerHitchWriter : public IOpenScenarioElementWriter, public ITrailerHitch + { + public: + virtual ~ITrailerHitchWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Relative position in the x axis, using the coordinate system of the vehicle. + * + * @return value of model property dx + */ + virtual void SetDx(const double dx) = 0; + + /** + * From OpenSCENARIO class model specification: + * Relative position in the z axis, using the coordinate system of the vehicle. If omitted, z of the trailer's coupler will + * be applied. If neither hitch nor coupler has a z value, a 2D connection will be applied, constrained to rotation in the + * XY-plane. + * + * @return value of model property dz + */ + virtual void SetDz(const double dz) = 0; + + /** + * Set a parameter for the attribute dx + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDx(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dz + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDz(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dx + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDx() const = 0; + /** + * Get the parameter for the attribute dz + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDz() const = 0; + + /** + * Retrieves whether the attribute dx is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDxParameterized() = 0; + /** + * Retrieves whether the attribute dz is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDzParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetDz() will return false); + */ + virtual void ResetDz() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Trajectory' + * From OpenSCENARIO class model specification: + * Definition of a trajectory type in terms of shape and optional time domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryWriter : public IOpenScenarioElementWriter, public ITrajectory, public ICatalogElementWriter + { + public: + virtual ~ITrajectoryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * If 'true', then the trajectory forms a loop, where the end of the trajectory is connected to the start of the trajectory + * by a straight line. For continuous derivatives of this segment, end and start point can also be at the same position and + * form a zero-length segment. A FollowTrajectoryAction with a closed trajectory doesn't end regularly but has to be + * stopped. If 'true' then the timing information in the trajectory cannot be used as absolute values. + * + * @return value of model property closed + */ + virtual void SetClosed(const bool closed) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the trajectory type. Required if used in catalog. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * The shape of a trajectory (Polyline, Clothoid or Nurbs) + * + * @return value of model property shape + */ + virtual void SetShape(std::shared_ptr shape) = 0; + + /** + * Set a parameter for the attribute closed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToClosed(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute closed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromClosed() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + + /** + * Retrieves whether the attribute closed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsClosedParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The shape of a trajectory (Polyline, Clothoid or Nurbs) + * + * @return a writer for model property shape + */ + virtual std::shared_ptr GetWriterShape() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrajectoryCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up trajectory catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryCatalogLocationWriter : public IOpenScenarioElementWriter, public ITrajectoryCatalogLocation + { + public: + virtual ~ITrajectoryCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrajectoryFollowingMode' + * From OpenSCENARIO class model specification: + * Used to define a steering trajectory. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryFollowingModeWriter : public IOpenScenarioElementWriter, public ITrajectoryFollowingMode + { + public: + virtual ~ITrajectoryFollowingModeWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the (lateral) trajectory following behavior of the actor: Mode 'position' forces the actor to strictly adhere to + * the trajectory. In contrast, mode 'follow' hands over control to the actor. In this mode, the actor tries to follow the + * trajectory as best as he can. This may be restricted by dynamics constraints and/or control loop implementation. In mode + * 'follow' the resulting path of the entity is not guaranteed to be identical for every simulation environment. + * + * @return value of model property followingMode + */ + virtual void SetFollowingMode(const FollowingMode followingMode) = 0; + + /** + * Set a parameter for the attribute followingMode + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFollowingMode(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute followingMode + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFollowingMode() const = 0; + + /** + * Retrieves whether the attribute followingMode is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFollowingModeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrajectoryPosition' + * From OpenSCENARIO class model specification: + * Definition of a trajectory type in terms of shape and optional time domain. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryPositionWriter : public IOpenScenarioElementWriter, public ITrajectoryPosition + { + public: + virtual ~ITrajectoryPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Represents the s coordinate from the start of the trajectory. Unit: [m]. Range: [0..arclength of the trajectory]. + * + * @return value of model property s + */ + virtual void SetS(const double s) = 0; + + /** + * From OpenSCENARIO class model specification: + * Represents the t coordinate orthogonal to the arclength of the trajectory. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property t + */ + virtual void SetT(const double t) = 0; + + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the reference trajectory. Only the Heading angle at the target position on the (s,t)-plane can be arbitrarily + * specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to the tangent + * to the reference trajectory s-axis at the point with the target s-coordinate. The Heading is counted from this imaginary + * axis. +If the reference trajectory s-axis shape contains sharp "kinks" (e.g., vertices on the polyline shape), the + * relative reference context with respect to such points cannot be interpreted within the OpenSCENARIO standard. +Missing + * Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return value of model property orientation + */ + virtual void SetOrientation(std::shared_ptr orientation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory the position is calculated from. + * + * @return value of model property trajectoryRef + */ + virtual void SetTrajectoryRef(std::shared_ptr trajectoryRef) = 0; + + /** + * Set a parameter for the attribute s + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToS(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute t + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToT(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute s + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromS() const = 0; + /** + * Get the parameter for the attribute t + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromT() const = 0; + + /** + * Retrieves whether the attribute s is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSParameterized() = 0; + /** + * Retrieves whether the attribute t is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The Pitch and Roll angles are determined by the underlying road surface at the target position and therefore undefined + * by the OpenSCENARIO standard. +The absolute reference context refers to the orientation with respect to the World + * coordinate system. Only the Heading angle at the target position can be arbitrarily specified on the (X,Y)-plane + * counting from the X-axis. +The relative reference context refers to the orientation with respect to the (s,t)-coordinate + * system of the reference trajectory. Only the Heading angle at the target position on the (s,t)-plane can be arbitrarily + * specified. To calculate the Heading, the imaginary straight axis at the target position is built parallel to the tangent + * to the reference trajectory s-axis at the point with the target s-coordinate. The Heading is counted from this imaginary + * axis. +If the reference trajectory s-axis shape contains sharp "kinks" (e.g., vertices on the polyline shape), the + * relative reference context with respect to such points cannot be interpreted within the OpenSCENARIO standard. +Missing + * Orientation property is interpreted as the relative reference context with Heading=Pitch=Roll=0. + * + * @return a writer for model property orientation + */ + virtual std::shared_ptr GetWriterOrientation() const = 0; + /** + * From OpenSCENARIO class model specification: + * Either a trajectory definition or a catalog reference to the trajectory the position is calculated from. + * + * @return a writer for model property trajectoryRef + */ + virtual std::shared_ptr GetWriterTrajectoryRef() const = 0; + + /** + * Resets the optional property (IsSetT() will return false); + */ + virtual void ResetT() = 0; + + /** + * Resets the optional property (IsSetOrientation() will return false); + */ + virtual void ResetOrientation() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TrajectoryRef' + * From OpenSCENARIO class model specification: + * Defines a reference to a trajectory. Either an inline definition of a trajectory or a trajectory in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITrajectoryRefWriter : public IOpenScenarioElementWriter, public ITrajectoryRef + { + public: + virtual ~ITrajectoryRefWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * A trajectory definition. + * + * @return value of model property trajectory + */ + virtual void SetTrajectory(std::shared_ptr trajectory) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to a trajectory in a catalog. + * + * @return value of model property catalogReference + */ + virtual void SetCatalogReference(std::shared_ptr catalogReference) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * A trajectory definition. + * + * @return a writer for model property trajectory + */ + virtual std::shared_ptr GetWriterTrajectory() const = 0; + /** + * From OpenSCENARIO class model specification: + * Reference to a trajectory in a catalog. + * + * @return a writer for model property catalogReference + */ + virtual std::shared_ptr GetWriterCatalogReference() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TransitionDynamics' + * From OpenSCENARIO class model specification: + * Specifies the dynamics of a value transition and defines how the value changes over time or distance. Different shapes + * can be used for the transition. Step is an immediate transition, i.e. a jump from the current current value to the + * target value. In this case value for time or distance must be 0. Linear will result in a linear transition between the + * start and end value. A smooth transition is only given with cubic and sinusoidal shape. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITransitionDynamicsWriter : public IOpenScenarioElementWriter, public ITransitionDynamics + { + public: + virtual ~ITransitionDynamicsWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The semantics of the value: 'rate', 'time' or 'distance'. + * + * @return value of model property dynamicsDimension + */ + virtual void SetDynamicsDimension(const DynamicsDimension dynamicsDimension) = 0; + + /** + * From OpenSCENARIO class model specification: + * The shape of the transition function f(x) between current and target value. + * + * @return value of model property dynamicsShape + */ + virtual void SetDynamicsShape(const DynamicsShape dynamicsShape) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the shape following behavior of the actor: Mode 'position' forces the actor to strictly adhere to a given shape. + * In contrast, in mode 'follow' the actor tries to follow the shape as best as it can. This may be restricted by the + * 'Performance' properties (for vehicles), dynamic constraints of an external agent (if the actor is not controlled by the + * default controller) and/or control loop implementation. In mode 'follow' the resulting path of the entity is not + * guaranteed to be identical for every simulation environment. Default value if omitted: position + * + * @return value of model property followingMode + */ + virtual void SetFollowingMode(const FollowingMode followingMode) = 0; + + /** + * From OpenSCENARIO class model specification: + * The value for a predefined rate (Unit: [delta/s]), time (Unit: [s]) or distance (Unit: [m]) to acquire the target value. + * Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute dynamicsDimension + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDynamicsDimension(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute dynamicsShape + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDynamicsShape(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute followingMode + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFollowingMode(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute dynamicsDimension + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDynamicsDimension() const = 0; + /** + * Get the parameter for the attribute dynamicsShape + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDynamicsShape() const = 0; + /** + * Get the parameter for the attribute followingMode + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFollowingMode() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute dynamicsDimension is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDynamicsDimensionParameterized() = 0; + /** + * Retrieves whether the attribute dynamicsShape is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDynamicsShapeParameterized() = 0; + /** + * Retrieves whether the attribute followingMode is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFollowingModeParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetFollowingMode() will return false); + */ + virtual void ResetFollowingMode() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TraveledDistanceCondition' + * From OpenSCENARIO class model specification: + * Logical expression in condition becomes true after the triggering entity/entities have traveled the given distance. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITraveledDistanceConditionWriter : public IOpenScenarioElementWriter, public ITraveledDistanceCondition + { + public: + virtual ~ITraveledDistanceConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Amount of traveled distance. Unit: [m]. Range: [0..inf[. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Trigger' + * From OpenSCENARIO class model specification: + * A trigger is defined as an association of condition groups. A trigger evaluates to true if at least one of the + * associated condition groups evaluates to true, otherwise it evaluates to false (OR operation). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITriggerWriter : public IOpenScenarioElementWriter, public ITrigger + { + public: + virtual ~ITriggerWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * List of condition groups as a container of conditions. Omitting this attribute is deprecated. + * + * @return value of model property conditionGroups + */ + virtual void SetConditionGroups(std::vector>& conditionGroups) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * List of condition groups as a container of conditions. Omitting this attribute is deprecated. + * + * @return a list of writers for model property conditionGroups + */ + virtual std::vector> GetWriterConditionGroups() const = 0; + /** + * Resets the optional property (IsSetConditionGroups() will return false); + */ + virtual void ResetConditionGroups() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'TriggeringEntities' + * From OpenSCENARIO class model specification: + * A collection of entities evaluated for an EntityCondition to be triggered. It is optional whether the condition must be + * fulfilled any or all of the objects. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ITriggeringEntitiesWriter : public IOpenScenarioElementWriter, public ITriggeringEntities + { + public: + virtual ~ITriggeringEntitiesWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All or any. + * + * @return value of model property triggeringEntitiesRule + */ + virtual void SetTriggeringEntitiesRule(const TriggeringEntitiesRule triggeringEntitiesRule) = 0; + + /** + * From OpenSCENARIO class model specification: + * List of referenced entities that trigger the condition. + * + * @return value of model property entityRefs + */ + virtual void SetEntityRefs(std::vector>& entityRefs) = 0; + + /** + * Set a parameter for the attribute triggeringEntitiesRule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTriggeringEntitiesRule(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute triggeringEntitiesRule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTriggeringEntitiesRule() const = 0; + + /** + * Retrieves whether the attribute triggeringEntitiesRule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTriggeringEntitiesRuleParameterized() = 0; + + // children + + /** + * From OpenSCENARIO class model specification: + * List of referenced entities that trigger the condition. + * + * @return a list of writers for model property entityRefs + */ + virtual std::vector> GetWriterEntityRefs() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UniformDistribution' + * From OpenSCENARIO class model specification: + * Uniform distribution which can be applied to a single parameter. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUniformDistributionWriter : public IOpenScenarioElementWriter, public IUniformDistribution + { + public: + virtual ~IUniformDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and upper limit of the uniform distribution regarding to the definition space. + * + * @return value of model property range + */ + virtual void SetRange(std::shared_ptr range) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Defines the lower limit and upper limit of the uniform distribution regarding to the definition space. + * + * @return a writer for model property range + */ + virtual std::shared_ptr GetWriterRange() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UsedArea' + * From OpenSCENARIO class model specification: + * The area that is used by the entities. When using big road network and/or scene files (several GB, e.g. for whole + * Europe), a simulator shall not load the whole road network for performance reasons. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUsedAreaWriter : public IOpenScenarioElementWriter, public IUsedArea + { + public: + virtual ~IUsedAreaWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Definition of the used area. A minimum of 2 positions needs to be provided. + * + * @return value of model property positions + */ + virtual void SetPositions(std::vector>& positions) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Definition of the used area. A minimum of 2 positions needs to be provided. + * + * @return a list of writers for model property positions + */ + virtual std::vector> GetWriterPositions() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedAction' + * From OpenSCENARIO class model specification: + * Used to either issue a command to the simulation environment (e.g. test software, system under test, simulation models) + * or start an external script. Allows the user to activate custom actions in their simulation user software. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedActionWriter : public IOpenScenarioElementWriter, public IUserDefinedAction + { + public: + virtual ~IUserDefinedActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The available commands are subject of a contract between simulation environment provider and scenario author. + * + * @return value of model property customCommandAction + */ + virtual void SetCustomCommandAction(std::shared_ptr customCommandAction) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * The available commands are subject of a contract between simulation environment provider and scenario author. + * + * @return a writer for model property customCommandAction + */ + virtual std::shared_ptr GetWriterCustomCommandAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedAnimation' + * From OpenSCENARIO class model specification: + * Definition of user defined animation types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedAnimationWriter : public IOpenScenarioElementWriter, public IUserDefinedAnimation + { + public: + virtual ~IUserDefinedAnimationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The available user defined animation types are subject of a contract between simulation environment provider and + * scenario author. + * + * @return value of model property userDefinedAnimationType + */ + virtual void SetUserDefinedAnimationType(const std::string userDefinedAnimationType) = 0; + + /** + * Set a parameter for the attribute userDefinedAnimationType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToUserDefinedAnimationType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute userDefinedAnimationType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromUserDefinedAnimationType() const = 0; + + /** + * Retrieves whether the attribute userDefinedAnimationType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsUserDefinedAnimationTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedComponent' + * From OpenSCENARIO class model specification: + * Type of the user defined component. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedComponentWriter : public IOpenScenarioElementWriter, public IUserDefinedComponent + { + public: + virtual ~IUserDefinedComponentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * User defined component type. + * + * @return value of model property userDefinedComponentType + */ + virtual void SetUserDefinedComponentType(const std::string userDefinedComponentType) = 0; + + /** + * Set a parameter for the attribute userDefinedComponentType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToUserDefinedComponentType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute userDefinedComponentType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromUserDefinedComponentType() const = 0; + + /** + * Retrieves whether the attribute userDefinedComponentType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsUserDefinedComponentTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedDistribution' + * From OpenSCENARIO class model specification: + * Indicates a user defined distribution which can be deterministic or stochastic. This distribution contains a property + * with the name type and some user defined content. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedDistributionWriter : public IOpenScenarioElementWriter, public IUserDefinedDistribution + { + public: + virtual ~IUserDefinedDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * User defined content. + * + * @return value of model property content + */ + virtual void SetContent(const std::string content) = 0; + + /** + * From OpenSCENARIO class model specification: + * Defines the type of the UserDefinedDistribution + * + * @return value of model property type + */ + virtual void SetType(const std::string type) = 0; + + /** + * Set a parameter for the attribute content + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToContent(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute type + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute content + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromContent() const = 0; + /** + * Get the parameter for the attribute type + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromType() const = 0; + + /** + * Retrieves whether the attribute content is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsContentParameterized() = 0; + /** + * Retrieves whether the attribute type is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedLight' + * From OpenSCENARIO class model specification: + * Definition of user defined light types. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedLightWriter : public IOpenScenarioElementWriter, public IUserDefinedLight + { + public: + virtual ~IUserDefinedLightWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The available user defined light types are subject of a contract between simulation environment provider and scenario + * author. + * + * @return value of model property userDefinedLightType + */ + virtual void SetUserDefinedLightType(const std::string userDefinedLightType) = 0; + + /** + * Set a parameter for the attribute userDefinedLightType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToUserDefinedLightType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute userDefinedLightType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromUserDefinedLightType() const = 0; + + /** + * Retrieves whether the attribute userDefinedLightType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsUserDefinedLightTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'UserDefinedValueCondition' + * From OpenSCENARIO class model specification: + * This condition acts as a wrapper for external custom conditions which are implemented in the simulation user software. + * It can compare e.g. complex types, which are not covered by the primitive types of OpenSCENARIO (boolean, int, + * double...). This condition is considered true if the given external value verifies the specified relation rule (<, + * <=, ==, >=, >) relatively to the provided reference value. +The external value can only be set from outside the + * scenario. Therefore this condition creates an interface from the scenario to the simulator or other components (e.g. + * test software, test case, system under test or simulation models). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IUserDefinedValueConditionWriter : public IOpenScenarioElementWriter, public IUserDefinedValueCondition + { + public: + virtual ~IUserDefinedValueConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the external value. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * The operator (less, greater, equal). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference value the external value is compared to. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ValueConstraint' + * From OpenSCENARIO class model specification: + * Value constraints represent a single rule to a given parameter in a parameter declaration. Note that value must match + * the type of the enclosing parameter declaration. A ValueConstraint for parameter declaration of type "string" must use + * either "equalTo" or "notEqualTo" for the rule property. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueConstraintWriter : public IOpenScenarioElementWriter, public IValueConstraint + { + public: + virtual ~IValueConstraintWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Available operators for the validation of the constraint. Note that either "equalTo" or "notEqualTo" must be used in + * parameter declarations of type "string". + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * A constant value, parameter or parameter expression. The value must match the type of the enclosing parameter + * declaration. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ValueConstraintGroup' + * From OpenSCENARIO class model specification: + * A ValueConstraintGroup represents a set of logical constraints which need to evaluate to true for a defined parameter + * value to start the simulation. A constraint group needs to have at least one constraint. +Multiple constraint groups are + * combined by an OR. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueConstraintGroupWriter : public IOpenScenarioElementWriter, public IValueConstraintGroup + { + public: + virtual ~IValueConstraintGroupWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Defines one or more constraints for a constraint group. Multiple constraints are combined by an AND. + * + * @return value of model property constraints + */ + virtual void SetConstraints(std::vector>& constraints) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Defines one or more constraints for a constraint group. Multiple constraints are combined by an AND. + * + * @return a list of writers for model property constraints + */ + virtual std::vector> GetWriterConstraints() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'ValueSetDistribution' + * From OpenSCENARIO class model specification: + * Deterministic multi-parameter distribution, where one or multiple sets of parameter values can be defined. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IValueSetDistributionWriter : public IOpenScenarioElementWriter, public IValueSetDistribution + { + public: + virtual ~IValueSetDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Set of parameter values that have to be assigned for a single concrete scenario. + * + * @return value of model property parameterValueSets + */ + virtual void SetParameterValueSets(std::vector>& parameterValueSets) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * Set of parameter values that have to be assigned for a single concrete scenario. + * + * @return a list of writers for model property parameterValueSets + */ + virtual std::vector> GetWriterParameterValueSets() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableAction' + * From OpenSCENARIO class model specification: + * Set or modify a variable. (Be aware of the data type). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableActionWriter : public IOpenScenarioElementWriter, public IVariableAction + { + public: + virtual ~IVariableActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the variable. + * + * @return value of model property variableRef + */ + virtual void SetVariableRef(std::shared_ptr> variableRef) = 0; + + /** + * From OpenSCENARIO class model specification: + * New value for the variable. + * + * @return value of model property setAction + */ + virtual void SetSetAction(std::shared_ptr setAction) = 0; + + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the variable (Add value or multiply by value). + * + * @return value of model property modifyAction + */ + virtual void SetModifyAction(std::shared_ptr modifyAction) = 0; + + /** + * Set a parameter for the attribute variableRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVariableRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute variableRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVariableRef() const = 0; + + /** + * Retrieves whether the attribute variableRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVariableRefParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * New value for the variable. + * + * @return a writer for model property setAction + */ + virtual std::shared_ptr GetWriterSetAction() const = 0; + /** + * From OpenSCENARIO class model specification: + * Modifying rule for the variable (Add value or multiply by value). + * + * @return a writer for model property modifyAction + */ + virtual std::shared_ptr GetWriterModifyAction() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableAddValueRule' + * From OpenSCENARIO class model specification: + * Defines an addition of a value to a variable as part of a ModifyRule. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableAddValueRuleWriter : public IOpenScenarioElementWriter, public IVariableAddValueRule + { + public: + virtual ~IVariableAddValueRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Add value to existing variable. + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableCondition' + * From OpenSCENARIO class model specification: + * Compares a named variable's value to a reference value. The logical operator used for comparison is defined by the rule + * attribute. Less and greater operators will only be supported if the value given as string can unambiguously be converted + * into a scalar value (e.g. value=5, value=16.667). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableConditionWriter : public IOpenScenarioElementWriter, public IVariableCondition + { + public: + virtual ~IVariableConditionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The operator (<, <=, ==, >=, >). + * + * @return value of model property rule + */ + virtual void SetRule(const Rule rule) = 0; + + /** + * From OpenSCENARIO class model specification: + * Value to which the value of the variable shall be compared to. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the variable that must be defined. + * + * @return value of model property variableRef + */ + virtual void SetVariableRef(std::shared_ptr> variableRef) = 0; + + /** + * Set a parameter for the attribute rule + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRule(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute variableRef + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVariableRef(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute rule + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRule() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + /** + * Get the parameter for the attribute variableRef + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVariableRef() const = 0; + + /** + * Retrieves whether the attribute rule is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRuleParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + /** + * Retrieves whether the attribute variableRef is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVariableRefParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableDeclaration' + * From OpenSCENARIO class model specification: + * Declaration of a typed variable with a name and a default value. Its value can change during runtime either from within + * the scenario (OSC Model instance) by using a VariableAction or can be also set from external side, e.g. by a test + * software. For this the Simulator Core needs to provide an interface to change variable values. The value can be used to + * either trigger Events in the scenario with VariableConditions or it can be used on external side, e.g. a test software + * to trigger test steps. For this the Simulator Core needs to provide an interface to read the variable values. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableDeclarationWriter : public IOpenScenarioElementWriter, public IVariableDeclaration + { + public: + virtual ~IVariableDeclarationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Name of the variable. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Initialization value of the variable (must be convertible to variableType). + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * From OpenSCENARIO class model specification: + * Type of the variable. + * + * @return value of model property variableType + */ + virtual void SetVariableType(const ParameterType variableType) = 0; + + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute variableType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVariableType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + /** + * Get the parameter for the attribute variableType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVariableType() const = 0; + + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + /** + * Retrieves whether the attribute variableType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVariableTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableModifyAction' + * From OpenSCENARIO class model specification: + * Modify a variable according to given rules. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableModifyActionWriter : public IOpenScenarioElementWriter, public IVariableModifyAction + { + public: + virtual ~IVariableModifyActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a variable or multiply a variable by a value. Has to match the variable type. + * + * @return value of model property rule + */ + virtual void SetRule(std::shared_ptr rule) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Either adding a value to a variable or multiply a variable by a value. Has to match the variable type. + * + * @return a writer for model property rule + */ + virtual std::shared_ptr GetWriterRule() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableModifyRule' + * From OpenSCENARIO class model specification: + * Enclosing type for either adding a value to a variable or multiply the variable by a value. Has to be match the variable + * type. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableModifyRuleWriter : public IOpenScenarioElementWriter, public IVariableModifyRule + { + public: + virtual ~IVariableModifyRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Adding a value to a variable. + * + * @return value of model property addValue + */ + virtual void SetAddValue(std::shared_ptr addValue) = 0; + + /** + * From OpenSCENARIO class model specification: + * Multiply a variable by a value. + * + * @return value of model property multiplyByValue + */ + virtual void SetMultiplyByValue(std::shared_ptr multiplyByValue) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * Adding a value to a variable. + * + * @return a writer for model property addValue + */ + virtual std::shared_ptr GetWriterAddValue() const = 0; + /** + * From OpenSCENARIO class model specification: + * Multiply a variable by a value. + * + * @return a writer for model property multiplyByValue + */ + virtual std::shared_ptr GetWriterMultiplyByValue() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableMultiplyByValueRule' + * From OpenSCENARIO class model specification: + * Multiply a variable by a value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableMultiplyByValueRuleWriter : public IOpenScenarioElementWriter, public IVariableMultiplyByValueRule + { + public: + virtual ~IVariableMultiplyByValueRuleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Multiply existing variable by the value (be aware of the variable data type). + * + * @return value of model property value + */ + virtual void SetValue(const double value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VariableSetAction' + * From OpenSCENARIO class model specification: + * Setting a variable to a given value. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVariableSetActionWriter : public IOpenScenarioElementWriter, public IVariableSetAction + { + public: + virtual ~IVariableSetActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The new value for the variable. + * + * @return value of model property value + */ + virtual void SetValue(const std::string value) = 0; + + /** + * Set a parameter for the attribute value + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToValue(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute value + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromValue() const = 0; + + /** + * Retrieves whether the attribute value is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsValueParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Vehicle' + * From OpenSCENARIO class model specification: + * Definition of a vehicle type in a scenario or in a catalog. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleWriter : public IOpenScenarioElementWriter, public IVehicle, public ICatalogElementWriter + { + public: + virtual ~IVehicleWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The mass of a vehicle. Unit: [kg]. Range: [0..inf[. + * + * @return value of model property mass + */ + virtual void SetMass(const double mass) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the model of the vehicle as a model type or a relative or absolute file path. + * + * @return value of model property model3d + */ + virtual void SetModel3d(const std::string model3d) = 0; + + /** + * From OpenSCENARIO class model specification: + * Name of the vehicle type. + * + * @return value of model property name + */ + virtual void SetName(const std::string name) = 0; + + /** + * From OpenSCENARIO class model specification: + * Role of the vehicle (ambulance, police,...). The default vehicle role if not specified is None. + * + * @return value of model property role + */ + virtual void SetRole(const Role role) = 0; + + /** + * From OpenSCENARIO class model specification: + * Category of the vehicle (bicycle, train,...). + * + * @return value of model property vehicleCategory + */ + virtual void SetVehicleCategory(const VehicleCategory vehicleCategory) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return value of model property parameterDeclarations + */ + virtual void SetParameterDeclarations(std::vector>& parameterDeclarations) = 0; + + /** + * From OpenSCENARIO class model specification: + * The three dimensional bounding box that encloses the vehicle. + * + * @return value of model property boundingBox + */ + virtual void SetBoundingBox(std::shared_ptr boundingBox) = 0; + + /** + * From OpenSCENARIO class model specification: + * Performance properties of the vehicle. + * + * @return value of model property performance + */ + virtual void SetPerformance(std::shared_ptr performance) = 0; + + /** + * From OpenSCENARIO class model specification: + * A set of axles (front, rear, additional) and their geometric locations. + * + * @return value of model property axles + */ + virtual void SetAxles(std::shared_ptr axles) = 0; + + /** + * From OpenSCENARIO class model specification: + * Properties of the vehicle. + * + * @return value of model property properties + */ + virtual void SetProperties(std::shared_ptr properties) = 0; + + /** + * From OpenSCENARIO class model specification: + * Tow vehicle mounting point for optional trailer. + * + * @return value of model property trailerHitch + */ + virtual void SetTrailerHitch(std::shared_ptr trailerHitch) = 0; + + /** + * From OpenSCENARIO class model specification: + * Trailer vehicle mounting point for connecting to a tow vehicle. + * + * @return value of model property trailerCoupler + */ + virtual void SetTrailerCoupler(std::shared_ptr trailerCoupler) = 0; + + /** + * From OpenSCENARIO class model specification: + * Initially connected trailer vehicle. Can be defined inline or a reference to a trailer in a catalog or the scenario + * file. + * + * @return value of model property trailer + */ + virtual void SetTrailer(std::shared_ptr trailer) = 0; + + /** + * Set a parameter for the attribute mass + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToMass(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute model3d + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToModel3d(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute name + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToName(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute role + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRole(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute vehicleCategory + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVehicleCategory(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute mass + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromMass() const = 0; + /** + * Get the parameter for the attribute model3d + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromModel3d() const = 0; + /** + * Get the parameter for the attribute name + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromName() const = 0; + /** + * Get the parameter for the attribute role + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRole() const = 0; + /** + * Get the parameter for the attribute vehicleCategory + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVehicleCategory() const = 0; + + /** + * Retrieves whether the attribute mass is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsMassParameterized() = 0; + /** + * Retrieves whether the attribute model3d is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsModel3dParameterized() = 0; + /** + * Retrieves whether the attribute name is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsNameParameterized() = 0; + /** + * Retrieves whether the attribute role is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoleParameterized() = 0; + /** + * Retrieves whether the attribute vehicleCategory is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVehicleCategoryParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The three dimensional bounding box that encloses the vehicle. + * + * @return a writer for model property boundingBox + */ + virtual std::shared_ptr GetWriterBoundingBox() const = 0; + /** + * From OpenSCENARIO class model specification: + * Performance properties of the vehicle. + * + * @return a writer for model property performance + */ + virtual std::shared_ptr GetWriterPerformance() const = 0; + /** + * From OpenSCENARIO class model specification: + * A set of axles (front, rear, additional) and their geometric locations. + * + * @return a writer for model property axles + */ + virtual std::shared_ptr GetWriterAxles() const = 0; + /** + * From OpenSCENARIO class model specification: + * Properties of the vehicle. + * + * @return a writer for model property properties + */ + virtual std::shared_ptr GetWriterProperties() const = 0; + /** + * From OpenSCENARIO class model specification: + * Tow vehicle mounting point for optional trailer. + * + * @return a writer for model property trailerHitch + */ + virtual std::shared_ptr GetWriterTrailerHitch() const = 0; + /** + * From OpenSCENARIO class model specification: + * Trailer vehicle mounting point for connecting to a tow vehicle. + * + * @return a writer for model property trailerCoupler + */ + virtual std::shared_ptr GetWriterTrailerCoupler() const = 0; + /** + * From OpenSCENARIO class model specification: + * Initially connected trailer vehicle. Can be defined inline or a reference to a trailer in a catalog or the scenario + * file. + * + * @return a writer for model property trailer + */ + virtual std::shared_ptr GetWriterTrailer() const = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of additional parameters. + * + * @return a list of writers for model property parameterDeclarations + */ + virtual std::vector> GetWriterParameterDeclarations() const = 0; + /** + * Resets the optional property (IsSetMass() will return false); + */ + virtual void ResetMass() = 0; + + /** + * Resets the optional property (IsSetModel3d() will return false); + */ + virtual void ResetModel3d() = 0; + + /** + * Resets the optional property (IsSetRole() will return false); + */ + virtual void ResetRole() = 0; + + /** + * Resets the optional property (IsSetParameterDeclarations() will return false); + */ + virtual void ResetParameterDeclarations() = 0; + + /** + * Resets the optional property (IsSetProperties() will return false); + */ + virtual void ResetProperties() = 0; + + /** + * Resets the optional property (IsSetTrailerHitch() will return false); + */ + virtual void ResetTrailerHitch() = 0; + + /** + * Resets the optional property (IsSetTrailerCoupler() will return false); + */ + virtual void ResetTrailerCoupler() = 0; + + /** + * Resets the optional property (IsSetTrailer() will return false); + */ + virtual void ResetTrailer() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleCatalogLocation' + * From OpenSCENARIO class model specification: + * The directory where to look up vehicle catalogs. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCatalogLocationWriter : public IOpenScenarioElementWriter, public IVehicleCatalogLocation + { + public: + virtual ~IVehicleCatalogLocationWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return value of model property directory + */ + virtual void SetDirectory(std::shared_ptr directory) = 0; + + + + + // children + /** + * From OpenSCENARIO class model specification: + * All catalogs files in this directory must be evaluated. + * + * @return a writer for model property directory + */ + virtual std::shared_ptr GetWriterDirectory() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleCategoryDistribution' + * From OpenSCENARIO class model specification: + * A distribution for vehicle in traffic. Category of vehicles and their weight (measure of relative likelihood, check + * VehicleCategoryDistributionEntry). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCategoryDistributionWriter : public IOpenScenarioElementWriter, public IVehicleCategoryDistribution + { + public: + virtual ~IVehicleCategoryDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle categories and their weight within the distribution. + * + * @return value of model property vehicleCategoryDistributionEntries + */ + virtual void SetVehicleCategoryDistributionEntries(std::vector>& vehicleCategoryDistributionEntries) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle categories and their weight within the distribution. + * + * @return a list of writers for model property vehicleCategoryDistributionEntries + */ + virtual std::vector> GetWriterVehicleCategoryDistributionEntries() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleCategoryDistributionEntry' + * From OpenSCENARIO class model specification: + * Represents the weight of a given vehicle category within a traffic definition. The relative probability for the + * occurence of this category is defined by the weight devided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleCategoryDistributionEntryWriter : public IOpenScenarioElementWriter, public IVehicleCategoryDistributionEntry + { + public: + virtual ~IVehicleCategoryDistributionEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The category of the vehicles that appear in traffic. + * + * @return value of model property category + */ + virtual void SetCategory(const VehicleCategory category) = 0; + + /** + * From OpenSCENARIO class model specification: + * The weight of a vehicle category within a traffic distribution. Range: [0..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * Set a parameter for the attribute category + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCategory(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute category + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCategory() const = 0; + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute category is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCategoryParameterized() = 0; + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleComponent' + * From OpenSCENARIO class model specification: + * Type of the vehicle component. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleComponentWriter : public IOpenScenarioElementWriter, public IVehicleComponent + { + public: + virtual ~IVehicleComponentWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Available component types attached to a vehicle. + * + * @return value of model property vehicleComponentType + */ + virtual void SetVehicleComponentType(const VehicleComponentType vehicleComponentType) = 0; + + /** + * Set a parameter for the attribute vehicleComponentType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVehicleComponentType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute vehicleComponentType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVehicleComponentType() const = 0; + + /** + * Retrieves whether the attribute vehicleComponentType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVehicleComponentTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleLight' + * From OpenSCENARIO class model specification: + * Type of the vehicle light. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleLightWriter : public IOpenScenarioElementWriter, public IVehicleLight + { + public: + virtual ~IVehicleLightWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Available light types attached to a vehicle. + * + * @return value of model property vehicleLightType + */ + virtual void SetVehicleLightType(const VehicleLightType vehicleLightType) = 0; + + /** + * Set a parameter for the attribute vehicleLightType + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToVehicleLightType(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute vehicleLightType + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromVehicleLightType() const = 0; + + /** + * Retrieves whether the attribute vehicleLightType is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsVehicleLightTypeParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleRoleDistribution' + * From OpenSCENARIO class model specification: + * A distribution for vehicle in traffic. Roles of vehicles and their weight (measure of relative likelihood, check + * VehicleRoleDistributionEntry). + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleRoleDistributionWriter : public IOpenScenarioElementWriter, public IVehicleRoleDistribution + { + public: + virtual ~IVehicleRoleDistributionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle roles and their weight within the distribution. + * + * @return value of model property vehicleRoleDistributionEntries + */ + virtual void SetVehicleRoleDistributionEntries(std::vector>& vehicleRoleDistributionEntries) = 0; + + + + + // children + + /** + * From OpenSCENARIO class model specification: + * List of elements that pair vehicle roles and their weight within the distribution. + * + * @return a list of writers for model property vehicleRoleDistributionEntries + */ + virtual std::vector> GetWriterVehicleRoleDistributionEntries() const = 0; + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VehicleRoleDistributionEntry' + * From OpenSCENARIO class model specification: + * Represents the weight of a given vehicle role within a traffic definition. The relative probability for the occurrence + * of this role is defined by the weight divided by the sum of all weights of this distribution. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVehicleRoleDistributionEntryWriter : public IOpenScenarioElementWriter, public IVehicleRoleDistributionEntry + { + public: + virtual ~IVehicleRoleDistributionEntryWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The role of the vehicles that appear in traffic. + * + * @return value of model property role + */ + virtual void SetRole(const Role role) = 0; + + /** + * From OpenSCENARIO class model specification: + * The weight of a vehicle role within a traffic distribution. Range: [0..inf[. + * + * @return value of model property weight + */ + virtual void SetWeight(const double weight) = 0; + + /** + * Set a parameter for the attribute role + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRole(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute weight + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToWeight(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute role + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRole() const = 0; + /** + * Get the parameter for the attribute weight + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromWeight() const = 0; + + /** + * Retrieves whether the attribute role is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRoleParameterized() = 0; + /** + * Retrieves whether the attribute weight is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsWeightParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Vertex' + * From OpenSCENARIO class model specification: + * Vertex of a polygonal chain (polyline) trajectory specification. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVertexWriter : public IOpenScenarioElementWriter, public IVertex + { + public: + virtual ~IVertexWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Optional time specification of the vertex. + * + * @return value of model property time + */ + virtual void SetTime(const double time) = 0; + + /** + * From OpenSCENARIO class model specification: + * Position of the vertex. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute time + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTime(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute time + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTime() const = 0; + + /** + * Retrieves whether the attribute time is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTimeParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Position of the vertex. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + /** + * Resets the optional property (IsSetTime() will return false); + */ + virtual void ResetTime() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'VisibilityAction' + * From OpenSCENARIO class model specification: + * Action that toggles (on or off) an entity's visibility attributes, with respect to sensors, other traffic or the + * graphics engine. The default for entities is that they are visible everywhere. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IVisibilityActionWriter : public IOpenScenarioElementWriter, public IVisibilityAction + { + public: + virtual ~IVisibilityActionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible in image generator(s). False: actor is not visible in image generator(s). + * + * @return value of model property graphics + */ + virtual void SetGraphics(const bool graphics) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible in sensor(s). False: actor is not visible in sensor(s). + * + * @return value of model property sensors + */ + virtual void SetSensors(const bool sensors) = 0; + + /** + * From OpenSCENARIO class model specification: + * True: actor is visible for other traffic participants, particularly for autonomous driver models. False: actor is not + * visible for other traffic participants. + * + * @return value of model property traffic + */ + virtual void SetTraffic(const bool traffic) = 0; + + /** + * From OpenSCENARIO class model specification: + * Reference to names of single sensors, for which the actor shall be (not) visible. For the other not named sensors + * implicitly the opposite applies. If no sensor references are provided, the actor is (not) visible for all sensors. E.g. + * a false positive for the front camera and lidar sensor could be specified with traffic="false", sensors="true", + * SensorReferenceSet={SensorReference{name="front camera"}, SensorReference{name="lidar"}}. The semantics of the sensor + * names are subject of a contract between the author of a scenario and the provider of a simulation environment. + * + * @return value of model property sensorReferenceSet + */ + virtual void SetSensorReferenceSet(std::shared_ptr sensorReferenceSet) = 0; + + /** + * Set a parameter for the attribute graphics + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToGraphics(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute sensors + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSensors(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute traffic + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTraffic(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute graphics + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromGraphics() const = 0; + /** + * Get the parameter for the attribute sensors + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSensors() const = 0; + /** + * Get the parameter for the attribute traffic + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTraffic() const = 0; + + /** + * Retrieves whether the attribute graphics is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsGraphicsParameterized() = 0; + /** + * Retrieves whether the attribute sensors is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSensorsParameterized() = 0; + /** + * Retrieves whether the attribute traffic is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTrafficParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Reference to names of single sensors, for which the actor shall be (not) visible. For the other not named sensors + * implicitly the opposite applies. If no sensor references are provided, the actor is (not) visible for all sensors. E.g. + * a false positive for the front camera and lidar sensor could be specified with traffic="false", sensors="true", + * SensorReferenceSet={SensorReference{name="front camera"}, SensorReference{name="lidar"}}. The semantics of the sensor + * names are subject of a contract between the author of a scenario and the provider of a simulation environment. + * + * @return a writer for model property sensorReferenceSet + */ + virtual std::shared_ptr GetWriterSensorReferenceSet() const = 0; + + /** + * Resets the optional property (IsSetSensorReferenceSet() will return false); + */ + virtual void ResetSensorReferenceSet() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Waypoint' + * From OpenSCENARIO class model specification: + * Reference position used to form a route. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWaypointWriter : public IOpenScenarioElementWriter, public IWaypoint + { + public: + virtual ~IWaypointWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The corresponding routing strategy (fastest, shortest, random, leastIntersections). + * + * @return value of model property routeStrategy + */ + virtual void SetRouteStrategy(const RouteStrategy routeStrategy) = 0; + + /** + * From OpenSCENARIO class model specification: + * The reference position to form the route. + * + * @return value of model property position + */ + virtual void SetPosition(std::shared_ptr position) = 0; + + /** + * Set a parameter for the attribute routeStrategy + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToRouteStrategy(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute routeStrategy + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromRouteStrategy() const = 0; + + /** + * Retrieves whether the attribute routeStrategy is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRouteStrategyParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * The reference position to form the route. + * + * @return a writer for model property position + */ + virtual std::shared_ptr GetWriterPosition() const = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Weather' + * From OpenSCENARIO class model specification: + * Defines the weather conditions in terms of light, fog, precipitation, cloud, temperature and atmospheric pressure + * states. If one of the conditions is missing it means that it doesn't change. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWeatherWriter : public IOpenScenarioElementWriter, public IWeather + { + public: + virtual ~IWeatherWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * Reference atmospheric pressure at z=0.0 in world coordinate system. Unit: [Pa]. Range: [80000..120000]. The actual + * atmospheric pressure around the entities of the scenario has to be calculated depending on their z position. See also + * the Standard Atmosphere as defined in ISO2533. + * + * @return value of model property atmosphericPressure + */ + virtual void SetAtmosphericPressure(const double atmosphericPressure) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the cloud state, i.e. cloud state and sky visualization settings. + * + * @return value of model property cloudState + */ + virtual void SetCloudState(const CloudState cloudState) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of cloud states using the fractional cloud cover in oktas. + * + * @return value of model property fractionalCloudCover + */ + virtual void SetFractionalCloudCover(const FractionalCloudCover fractionalCloudCover) = 0; + + /** + * From OpenSCENARIO class model specification: + * Outside temperature at z=0.0 in world coordinate system. Unit: [K]. Range: [170..340]. The actual outside temperature + * around the entities of the scenario has to be calculated depending on their z position. + * + * @return value of model property temperature + */ + virtual void SetTemperature(const double temperature) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the sun, i.e. position and intensity. + * + * @return value of model property sun + */ + virtual void SetSun(std::shared_ptr sun) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of fog, i.e. visual range and bounding box. + * + * @return value of model property fog + */ + virtual void SetFog(std::shared_ptr fog) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of precipitation, i.e. type and intensity. + * + * @return value of model property precipitation + */ + virtual void SetPrecipitation(std::shared_ptr precipitation) = 0; + + /** + * From OpenSCENARIO class model specification: + * Definition of the wind: direction and speed. + * + * @return value of model property wind + */ + virtual void SetWind(std::shared_ptr wind) = 0; + + /** + * From OpenSCENARIO class model specification: + * Image reference to represent the sky. Mutually exclusive with "fractionalCloudCover". If the image also contains + * lighting information (HDRi) it is also mutually exclusive with "sun". + * + * @return value of model property domeImage + */ + virtual void SetDomeImage(std::shared_ptr domeImage) = 0; + + /** + * Set a parameter for the attribute atmosphericPressure + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToAtmosphericPressure(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute cloudState + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToCloudState(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute fractionalCloudCover + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToFractionalCloudCover(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute temperature + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToTemperature(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute atmosphericPressure + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromAtmosphericPressure() const = 0; + /** + * Get the parameter for the attribute cloudState + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromCloudState() const = 0; + /** + * Get the parameter for the attribute fractionalCloudCover + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromFractionalCloudCover() const = 0; + /** + * Get the parameter for the attribute temperature + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromTemperature() const = 0; + + /** + * Retrieves whether the attribute atmosphericPressure is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsAtmosphericPressureParameterized() = 0; + /** + * Retrieves whether the attribute cloudState is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsCloudStateParameterized() = 0; + /** + * Retrieves whether the attribute fractionalCloudCover is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsFractionalCloudCoverParameterized() = 0; + /** + * Retrieves whether the attribute temperature is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsTemperatureParameterized() = 0; + + // children + /** + * From OpenSCENARIO class model specification: + * Definition of the sun, i.e. position and intensity. + * + * @return a writer for model property sun + */ + virtual std::shared_ptr GetWriterSun() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of fog, i.e. visual range and bounding box. + * + * @return a writer for model property fog + */ + virtual std::shared_ptr GetWriterFog() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of precipitation, i.e. type and intensity. + * + * @return a writer for model property precipitation + */ + virtual std::shared_ptr GetWriterPrecipitation() const = 0; + /** + * From OpenSCENARIO class model specification: + * Definition of the wind: direction and speed. + * + * @return a writer for model property wind + */ + virtual std::shared_ptr GetWriterWind() const = 0; + /** + * From OpenSCENARIO class model specification: + * Image reference to represent the sky. Mutually exclusive with "fractionalCloudCover". If the image also contains + * lighting information (HDRi) it is also mutually exclusive with "sun". + * + * @return a writer for model property domeImage + */ + virtual std::shared_ptr GetWriterDomeImage() const = 0; + + /** + * Resets the optional property (IsSetAtmosphericPressure() will return false); + */ + virtual void ResetAtmosphericPressure() = 0; + + /** + * Resets the optional property (IsSetCloudState() will return false); + */ + virtual void ResetCloudState() = 0; + + /** + * Resets the optional property (IsSetFractionalCloudCover() will return false); + */ + virtual void ResetFractionalCloudCover() = 0; + + /** + * Resets the optional property (IsSetTemperature() will return false); + */ + virtual void ResetTemperature() = 0; + + /** + * Resets the optional property (IsSetSun() will return false); + */ + virtual void ResetSun() = 0; + + /** + * Resets the optional property (IsSetFog() will return false); + */ + virtual void ResetFog() = 0; + + /** + * Resets the optional property (IsSetPrecipitation() will return false); + */ + virtual void ResetPrecipitation() = 0; + + /** + * Resets the optional property (IsSetWind() will return false); + */ + virtual void ResetWind() = 0; + + /** + * Resets the optional property (IsSetDomeImage() will return false); + */ + virtual void ResetDomeImage() = 0; + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Wind' + * From OpenSCENARIO class model specification: + * Defines wind properties. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWindWriter : public IOpenScenarioElementWriter, public IWind + { + public: + virtual ~IWindWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The target direction of the wind (not the origin direction) in the ground/xy-plane of the world coordinate system. + * Corresponds to the heading/yaw angle. x-axis-direction is 0 rad. Unit: [rad]. Range: [0..2*PI[. + * + * @return value of model property direction + */ + virtual void SetDirection(const double direction) = 0; + + /** + * From OpenSCENARIO class model specification: + * The wind speed. Unit: [m/s]. Range: [0..inf[ + * + * @return value of model property speed + */ + virtual void SetSpeed(const double speed) = 0; + + /** + * Set a parameter for the attribute direction + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToDirection(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute speed + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToSpeed(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute direction + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromDirection() const = 0; + /** + * Get the parameter for the attribute speed + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromSpeed() const = 0; + + /** + * Retrieves whether the attribute direction is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsDirectionParameterized() = 0; + /** + * Retrieves whether the attribute speed is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsSpeedParameterized() = 0; + + // children + + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'WorldPosition' + * From OpenSCENARIO class model specification: + * A position which is fixed in the inertial reference frame of the simulation environment, the so-called world coordinate + * system. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IWorldPositionWriter : public IOpenScenarioElementWriter, public IWorldPosition + { + public: + virtual ~IWorldPositionWriter() = default; + + // Setters for all attributes + + /** + * From OpenSCENARIO class model specification: + * The heading angle of the object, defining a mathematically positive rotation about the z-axis (see ISO 8855:2011). + * Missing value is interpreted as 0. Unit: [rad]. + * + * @return value of model property h + */ + virtual void SetH(const double h) = 0; + + /** + * From OpenSCENARIO class model specification: + * The pitch angle of the object, defining a mathematically positive rotation about the y-axis (see ISO 8855:2011). Missing + * value is interpreted as 0. Unit: [rad]. + * + * @return value of model property p + */ + virtual void SetP(const double p) = 0; + + /** + * From OpenSCENARIO class model specification: + * The roll angle of the object, defining a mathematically positive rotation about the x-axis (see ISO 8855:2011). Missing + * value is interpreted as 0. Unit: [rad]. + * + * @return value of model property r + */ + virtual void SetR(const double r) = 0; + + /** + * From OpenSCENARIO class model specification: + * The x coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property x + */ + virtual void SetX(const double x) = 0; + + /** + * From OpenSCENARIO class model specification: + * The y coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property y + */ + virtual void SetY(const double y) = 0; + + /** + * From OpenSCENARIO class model specification: + * The z coordinate value. Missing value is interpreted as 0. Unit: [m]. + * + * @return value of model property z + */ + virtual void SetZ(const double z) = 0; + + /** + * Set a parameter for the attribute h + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToH(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute p + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToP(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute r + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToR(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute x + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToX(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute y + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToY(std::string& parameterName) = 0; + /** + * Set a parameter for the attribute z + * + * @param parameterName the name of the parameter (without $) + */ + virtual void WriteParameterToZ(std::string& parameterName) = 0; + + /** + * Get the parameter for the attribute h + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromH() const = 0; + /** + * Get the parameter for the attribute p + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromP() const = 0; + /** + * Get the parameter for the attribute r + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromR() const = 0; + /** + * Get the parameter for the attribute x + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromX() const = 0; + /** + * Get the parameter for the attribute y + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromY() const = 0; + /** + * Get the parameter for the attribute z + * + * @return the name of the parameter (without $). Null if not parameter set or if attribute is empty. + */ + virtual std::string GetParameterFromZ() const = 0; + + /** + * Retrieves whether the attribute h is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsHParameterized() = 0; + /** + * Retrieves whether the attribute p is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsPParameterized() = 0; + /** + * Retrieves whether the attribute r is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsRParameterized() = 0; + /** + * Retrieves whether the attribute x is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsXParameterized() = 0; + /** + * Retrieves whether the attribute y is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsYParameterized() = 0; + /** + * Retrieves whether the attribute z is parametrized. + * + * @return true if ${property.name.toMemberName()} is paramterized. + */ + virtual bool IsZParameterized() = 0; + + // children + + /** + * Resets the optional property (IsSetH() will return false); + */ + virtual void ResetH() = 0; + + /** + * Resets the optional property (IsSetP() will return false); + */ + virtual void ResetP() = 0; + + /** + * Resets the optional property (IsSetR() will return false); + */ + virtual void ResetR() = 0; + + /** + * Resets the optional property (IsSetZ() will return false); + */ + virtual void ResetZ() = 0; + + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/writer/ApiWriterInterfacesV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/writer/ApiWriterInterfacesV1_3.h new file mode 100644 index 00000000..282731de --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/writer/ApiWriterInterfacesV1_3.h @@ -0,0 +1,116 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "IOpenScenarioModelElement.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'CatalogElement' + * From OpenSCENARIO class model specification: + * Instances of the types Controller, Environment, Maneuver, MiscObject, Pedestrian, Route, Trajectory and Vehicle are + * considered as instances of type CatalogElement. Or less formal: controller, environments, maneuvers, miscellaneous + * objects, pedestrians, routes, trajectories and vehicles are catalog elements. A catalog element is either a controller, + * an environment, a maneuver, a miscellaneous object, a pedestrian, a route, a trajectory or a vehicle. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ICatalogElementWriter: public virtual IOpenScenarioModelElement + { + public: + ICatalogElementWriter() = default; + virtual ~ICatalogElementWriter() = default; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'Entity' + * From OpenSCENARIO class model specification: + * Instances of the types ScenarioObject, ScenarioObjectTemplate, EntitySelection and SpawnedObject are considered to be + * instances of type Entity. Or less formal: scenario objects and entity selections are both entities. An entity is either + * a scenario object or an entity selection. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IEntityWriter: public virtual IOpenScenarioModelElement + { + public: + IEntityWriter() = default; + virtual ~IEntityWriter() = default; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'MotionControlAction' + * From OpenSCENARIO class model specification: + * Some private actions affect motion control and therefore imply a control strategy. These actions are considered + * instances of MotionControlAction such as LaneChangeAction, LateralDistanceAction or SynchronizeAction. Others like + * TeleportAction don’t imply such a dynamic behavior. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IMotionControlActionWriter: public virtual IOpenScenarioModelElement + { + public: + IMotionControlActionWriter() = default; + virtual ~IMotionControlActionWriter() = default; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'SpawnedObject' + * From OpenSCENARIO class model specification: + * An instances of SpawnedObject is considered an instance of Entity. SpawnedObject represents objects that are spawned + * dynamically during runtime by sources and swarms. It is transient which means that it is not represented in the XSD. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ISpawnedObjectWriter: public virtual IOpenScenarioModelElement + { + public: + ISpawnedObjectWriter() = default; + virtual ~ISpawnedObjectWriter() = default; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A Writer for the type 'StoryboardElement' + * From OpenSCENARIO class model specification: + * Instances of the types Story, Act, Action, Event and Maneuver are considered to be instances of type StoryboardElement. + * Or less formal: story, acts, actions, events, maneuvers are storyboard elements. A storyboard element is either a story, + * an act, an event, an action or a maneuver. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IStoryboardElementWriter: public virtual IOpenScenarioModelElement + { + public: + IStoryboardElementWriter() = default; + virtual ~IStoryboardElementWriter() = default; + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/api/writer/IOpenScenarioWriterFactoryV1_3.h b/cpp/openScenarioLib/generated/v1_3/api/writer/IOpenScenarioWriterFactoryV1_3.h new file mode 100644 index 00000000..14efa1e5 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/api/writer/IOpenScenarioWriterFactoryV1_3.h @@ -0,0 +1,333 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once +#include +#include "ApiClassWriterInterfacesV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Implementation of IOpenScenarioWriterFactor + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IOpenScenarioWriterFactory + { + public: + virtual std::shared_ptr CreateAbsoluteSpeedWriter() = 0; + virtual std::shared_ptr CreateAbsoluteTargetLaneWriter() = 0; + virtual std::shared_ptr CreateAbsoluteTargetLaneOffsetWriter() = 0; + virtual std::shared_ptr CreateAbsoluteTargetSpeedWriter() = 0; + virtual std::shared_ptr CreateAccelerationConditionWriter() = 0; + virtual std::shared_ptr CreateAcquirePositionActionWriter() = 0; + virtual std::shared_ptr CreateActWriter() = 0; + virtual std::shared_ptr CreateActionWriter() = 0; + virtual std::shared_ptr CreateActivateControllerActionWriter() = 0; + virtual std::shared_ptr CreateActorsWriter() = 0; + virtual std::shared_ptr CreateAddEntityActionWriter() = 0; + virtual std::shared_ptr CreateAngleConditionWriter() = 0; + virtual std::shared_ptr CreateAnimationActionWriter() = 0; + virtual std::shared_ptr CreateAnimationFileWriter() = 0; + virtual std::shared_ptr CreateAnimationStateWriter() = 0; + virtual std::shared_ptr CreateAnimationTypeWriter() = 0; + virtual std::shared_ptr CreateAppearanceActionWriter() = 0; + virtual std::shared_ptr CreateAssignControllerActionWriter() = 0; + virtual std::shared_ptr CreateAssignRouteActionWriter() = 0; + virtual std::shared_ptr CreateAutomaticGearWriter() = 0; + virtual std::shared_ptr CreateAxleWriter() = 0; + virtual std::shared_ptr CreateAxlesWriter() = 0; + virtual std::shared_ptr CreateBoundingBoxWriter() = 0; + virtual std::shared_ptr CreateBrakeWriter() = 0; + virtual std::shared_ptr CreateBrakeInputWriter() = 0; + virtual std::shared_ptr CreateByEntityConditionWriter() = 0; + virtual std::shared_ptr CreateByObjectTypeWriter() = 0; + virtual std::shared_ptr CreateByTypeWriter() = 0; + virtual std::shared_ptr CreateByValueConditionWriter() = 0; + virtual std::shared_ptr CreateCatalogWriter() = 0; + virtual std::shared_ptr CreateCatalogDefinitionWriter() = 0; + virtual std::shared_ptr CreateCatalogLocationsWriter() = 0; + virtual std::shared_ptr CreateCatalogReferenceWriter() = 0; + virtual std::shared_ptr CreateCenterWriter() = 0; + virtual std::shared_ptr CreateCentralSwarmObjectWriter() = 0; + virtual std::shared_ptr CreateClothoidWriter() = 0; + virtual std::shared_ptr CreateClothoidSplineWriter() = 0; + virtual std::shared_ptr CreateClothoidSplineSegmentWriter() = 0; + virtual std::shared_ptr CreateCollisionConditionWriter() = 0; + virtual std::shared_ptr CreateColorWriter() = 0; + virtual std::shared_ptr CreateColorCmykWriter() = 0; + virtual std::shared_ptr CreateColorRgbWriter() = 0; + virtual std::shared_ptr CreateComponentAnimationWriter() = 0; + virtual std::shared_ptr CreateConditionWriter() = 0; + virtual std::shared_ptr CreateConditionGroupWriter() = 0; + virtual std::shared_ptr CreateConnectTrailerActionWriter() = 0; + virtual std::shared_ptr CreateControlPointWriter() = 0; + virtual std::shared_ptr CreateControllerWriter() = 0; + virtual std::shared_ptr CreateControllerActionWriter() = 0; + virtual std::shared_ptr CreateControllerCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateControllerDistributionWriter() = 0; + virtual std::shared_ptr CreateControllerDistributionEntryWriter() = 0; + virtual std::shared_ptr CreateCustomCommandActionWriter() = 0; + virtual std::shared_ptr CreateCustomContentWriter() = 0; + virtual std::shared_ptr CreateDeleteEntityActionWriter() = 0; + virtual std::shared_ptr CreateDeterministicWriter() = 0; + virtual std::shared_ptr CreateDeterministicMultiParameterDistributionWriter() = 0; + virtual std::shared_ptr CreateDeterministicMultiParameterDistributionTypeWriter() = 0; + virtual std::shared_ptr CreateDeterministicParameterDistributionWriter() = 0; + virtual std::shared_ptr CreateDeterministicSingleParameterDistributionWriter() = 0; + virtual std::shared_ptr CreateDeterministicSingleParameterDistributionTypeWriter() = 0; + virtual std::shared_ptr CreateDimensionsWriter() = 0; + virtual std::shared_ptr CreateDirectionOfTravelDistributionWriter() = 0; + virtual std::shared_ptr CreateDirectoryWriter() = 0; + virtual std::shared_ptr CreateDisconnectTrailerActionWriter() = 0; + virtual std::shared_ptr CreateDistanceConditionWriter() = 0; + virtual std::shared_ptr CreateDistributionDefinitionWriter() = 0; + virtual std::shared_ptr CreateDistributionRangeWriter() = 0; + virtual std::shared_ptr CreateDistributionSetWriter() = 0; + virtual std::shared_ptr CreateDistributionSetElementWriter() = 0; + virtual std::shared_ptr CreateDomeImageWriter() = 0; + virtual std::shared_ptr CreateDynamicConstraintsWriter() = 0; + virtual std::shared_ptr CreateEndOfRoadConditionWriter() = 0; + virtual std::shared_ptr CreateEntitiesWriter() = 0; + virtual std::shared_ptr CreateEntityActionWriter() = 0; + virtual std::shared_ptr CreateEntityConditionWriter() = 0; + virtual std::shared_ptr CreateEntityDistributionWriter() = 0; + virtual std::shared_ptr CreateEntityDistributionEntryWriter() = 0; + virtual std::shared_ptr CreateEntityObjectWriter() = 0; + virtual std::shared_ptr CreateEntityRefWriter() = 0; + virtual std::shared_ptr CreateEntitySelectionWriter() = 0; + virtual std::shared_ptr CreateEnvironmentWriter() = 0; + virtual std::shared_ptr CreateEnvironmentActionWriter() = 0; + virtual std::shared_ptr CreateEnvironmentCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateEventWriter() = 0; + virtual std::shared_ptr CreateExternalObjectReferenceWriter() = 0; + virtual std::shared_ptr CreateFileWriter() = 0; + virtual std::shared_ptr CreateFileHeaderWriter() = 0; + virtual std::shared_ptr CreateFinalSpeedWriter() = 0; + virtual std::shared_ptr CreateFogWriter() = 0; + virtual std::shared_ptr CreateFollowTrajectoryActionWriter() = 0; + virtual std::shared_ptr CreateGearWriter() = 0; + virtual std::shared_ptr CreateGeoPositionWriter() = 0; + virtual std::shared_ptr CreateGlobalActionWriter() = 0; + virtual std::shared_ptr CreateHistogramWriter() = 0; + virtual std::shared_ptr CreateHistogramBinWriter() = 0; + virtual std::shared_ptr CreateInRoutePositionWriter() = 0; + virtual std::shared_ptr CreateInfrastructureActionWriter() = 0; + virtual std::shared_ptr CreateInitWriter() = 0; + virtual std::shared_ptr CreateInitActionsWriter() = 0; + virtual std::shared_ptr CreateKnotWriter() = 0; + virtual std::shared_ptr CreateLaneWriter() = 0; + virtual std::shared_ptr CreateLaneChangeActionWriter() = 0; + virtual std::shared_ptr CreateLaneChangeTargetWriter() = 0; + virtual std::shared_ptr CreateLaneOffsetActionWriter() = 0; + virtual std::shared_ptr CreateLaneOffsetActionDynamicsWriter() = 0; + virtual std::shared_ptr CreateLaneOffsetTargetWriter() = 0; + virtual std::shared_ptr CreateLanePositionWriter() = 0; + virtual std::shared_ptr CreateLateralActionWriter() = 0; + virtual std::shared_ptr CreateLateralDistanceActionWriter() = 0; + virtual std::shared_ptr CreateLicenseWriter() = 0; + virtual std::shared_ptr CreateLightStateWriter() = 0; + virtual std::shared_ptr CreateLightStateActionWriter() = 0; + virtual std::shared_ptr CreateLightTypeWriter() = 0; + virtual std::shared_ptr CreateLogNormalDistributionWriter() = 0; + virtual std::shared_ptr CreateLongitudinalActionWriter() = 0; + virtual std::shared_ptr CreateLongitudinalDistanceActionWriter() = 0; + virtual std::shared_ptr CreateManeuverWriter() = 0; + virtual std::shared_ptr CreateManeuverCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateManeuverGroupWriter() = 0; + virtual std::shared_ptr CreateManualGearWriter() = 0; + virtual std::shared_ptr CreateMiscObjectWriter() = 0; + virtual std::shared_ptr CreateMiscObjectCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateModifyRuleWriter() = 0; + virtual std::shared_ptr CreateMonitorDeclarationWriter() = 0; + virtual std::shared_ptr CreateNoneWriter() = 0; + virtual std::shared_ptr CreateNormalDistributionWriter() = 0; + virtual std::shared_ptr CreateNurbsWriter() = 0; + virtual std::shared_ptr CreateObjectControllerWriter() = 0; + virtual std::shared_ptr CreateOffroadConditionWriter() = 0; + virtual std::shared_ptr CreateOpenScenarioWriter() = 0; + virtual std::shared_ptr CreateOpenScenarioCategoryWriter() = 0; + virtual std::shared_ptr CreateOrientationWriter() = 0; + virtual std::shared_ptr CreateOverrideBrakeActionWriter() = 0; + virtual std::shared_ptr CreateOverrideClutchActionWriter() = 0; + virtual std::shared_ptr CreateOverrideControllerValueActionWriter() = 0; + virtual std::shared_ptr CreateOverrideGearActionWriter() = 0; + virtual std::shared_ptr CreateOverrideParkingBrakeActionWriter() = 0; + virtual std::shared_ptr CreateOverrideSteeringWheelActionWriter() = 0; + virtual std::shared_ptr CreateOverrideThrottleActionWriter() = 0; + virtual std::shared_ptr CreateParameterActionWriter() = 0; + virtual std::shared_ptr CreateParameterAddValueRuleWriter() = 0; + virtual std::shared_ptr CreateParameterAssignmentWriter() = 0; + virtual std::shared_ptr CreateParameterConditionWriter() = 0; + virtual std::shared_ptr CreateParameterDeclarationWriter() = 0; + virtual std::shared_ptr CreateParameterModifyActionWriter() = 0; + virtual std::shared_ptr CreateParameterMultiplyByValueRuleWriter() = 0; + virtual std::shared_ptr CreateParameterSetActionWriter() = 0; + virtual std::shared_ptr CreateParameterValueDistributionWriter() = 0; + virtual std::shared_ptr CreateParameterValueDistributionDefinitionWriter() = 0; + virtual std::shared_ptr CreateParameterValueSetWriter() = 0; + virtual std::shared_ptr CreatePedestrianWriter() = 0; + virtual std::shared_ptr CreatePedestrianAnimationWriter() = 0; + virtual std::shared_ptr CreatePedestrianCatalogLocationWriter() = 0; + virtual std::shared_ptr CreatePedestrianGestureWriter() = 0; + virtual std::shared_ptr CreatePerformanceWriter() = 0; + virtual std::shared_ptr CreatePhaseWriter() = 0; + virtual std::shared_ptr CreatePoissonDistributionWriter() = 0; + virtual std::shared_ptr CreatePolygonWriter() = 0; + virtual std::shared_ptr CreatePolylineWriter() = 0; + virtual std::shared_ptr CreatePositionWriter() = 0; + virtual std::shared_ptr CreatePositionInLaneCoordinatesWriter() = 0; + virtual std::shared_ptr CreatePositionInRoadCoordinatesWriter() = 0; + virtual std::shared_ptr CreatePositionOfCurrentEntityWriter() = 0; + virtual std::shared_ptr CreatePrecipitationWriter() = 0; + virtual std::shared_ptr CreatePrivateWriter() = 0; + virtual std::shared_ptr CreatePrivateActionWriter() = 0; + virtual std::shared_ptr CreateProbabilityDistributionSetWriter() = 0; + virtual std::shared_ptr CreateProbabilityDistributionSetElementWriter() = 0; + virtual std::shared_ptr CreatePropertiesWriter() = 0; + virtual std::shared_ptr CreatePropertyWriter() = 0; + virtual std::shared_ptr CreateRandomRouteActionWriter() = 0; + virtual std::shared_ptr CreateRangeWriter() = 0; + virtual std::shared_ptr CreateReachPositionConditionWriter() = 0; + virtual std::shared_ptr CreateRelativeAngleConditionWriter() = 0; + virtual std::shared_ptr CreateRelativeClearanceConditionWriter() = 0; + virtual std::shared_ptr CreateRelativeDistanceConditionWriter() = 0; + virtual std::shared_ptr CreateRelativeLanePositionWriter() = 0; + virtual std::shared_ptr CreateRelativeLaneRangeWriter() = 0; + virtual std::shared_ptr CreateRelativeObjectPositionWriter() = 0; + virtual std::shared_ptr CreateRelativeRoadPositionWriter() = 0; + virtual std::shared_ptr CreateRelativeSpeedConditionWriter() = 0; + virtual std::shared_ptr CreateRelativeSpeedToMasterWriter() = 0; + virtual std::shared_ptr CreateRelativeTargetLaneWriter() = 0; + virtual std::shared_ptr CreateRelativeTargetLaneOffsetWriter() = 0; + virtual std::shared_ptr CreateRelativeTargetSpeedWriter() = 0; + virtual std::shared_ptr CreateRelativeWorldPositionWriter() = 0; + virtual std::shared_ptr CreateRoadConditionWriter() = 0; + virtual std::shared_ptr CreateRoadCursorWriter() = 0; + virtual std::shared_ptr CreateRoadNetworkWriter() = 0; + virtual std::shared_ptr CreateRoadPositionWriter() = 0; + virtual std::shared_ptr CreateRoadRangeWriter() = 0; + virtual std::shared_ptr CreateRouteWriter() = 0; + virtual std::shared_ptr CreateRouteCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateRoutePositionWriter() = 0; + virtual std::shared_ptr CreateRouteRefWriter() = 0; + virtual std::shared_ptr CreateRoutingActionWriter() = 0; + virtual std::shared_ptr CreateScenarioDefinitionWriter() = 0; + virtual std::shared_ptr CreateScenarioObjectWriter() = 0; + virtual std::shared_ptr CreateScenarioObjectTemplateWriter() = 0; + virtual std::shared_ptr CreateSelectedEntitiesWriter() = 0; + virtual std::shared_ptr CreateSensorReferenceWriter() = 0; + virtual std::shared_ptr CreateSensorReferenceSetWriter() = 0; + virtual std::shared_ptr CreateSetMonitorActionWriter() = 0; + virtual std::shared_ptr CreateShapeWriter() = 0; + virtual std::shared_ptr CreateSimulationTimeConditionWriter() = 0; + virtual std::shared_ptr CreateSpeedActionWriter() = 0; + virtual std::shared_ptr CreateSpeedActionTargetWriter() = 0; + virtual std::shared_ptr CreateSpeedConditionWriter() = 0; + virtual std::shared_ptr CreateSpeedProfileActionWriter() = 0; + virtual std::shared_ptr CreateSpeedProfileEntryWriter() = 0; + virtual std::shared_ptr CreateStandStillConditionWriter() = 0; + virtual std::shared_ptr CreateSteadyStateWriter() = 0; + virtual std::shared_ptr CreateStochasticWriter() = 0; + virtual std::shared_ptr CreateStochasticDistributionWriter() = 0; + virtual std::shared_ptr CreateStochasticDistributionTypeWriter() = 0; + virtual std::shared_ptr CreateStoryWriter() = 0; + virtual std::shared_ptr CreateStoryboardWriter() = 0; + virtual std::shared_ptr CreateStoryboardElementStateConditionWriter() = 0; + virtual std::shared_ptr CreateSunWriter() = 0; + virtual std::shared_ptr CreateSynchronizeActionWriter() = 0; + virtual std::shared_ptr CreateTargetDistanceSteadyStateWriter() = 0; + virtual std::shared_ptr CreateTargetTimeSteadyStateWriter() = 0; + virtual std::shared_ptr CreateTeleportActionWriter() = 0; + virtual std::shared_ptr CreateTimeHeadwayConditionWriter() = 0; + virtual std::shared_ptr CreateTimeOfDayWriter() = 0; + virtual std::shared_ptr CreateTimeOfDayConditionWriter() = 0; + virtual std::shared_ptr CreateTimeReferenceWriter() = 0; + virtual std::shared_ptr CreateTimeToCollisionConditionWriter() = 0; + virtual std::shared_ptr CreateTimeToCollisionConditionTargetWriter() = 0; + virtual std::shared_ptr CreateTimingWriter() = 0; + virtual std::shared_ptr CreateTrafficActionWriter() = 0; + virtual std::shared_ptr CreateTrafficAreaWriter() = 0; + virtual std::shared_ptr CreateTrafficAreaActionWriter() = 0; + virtual std::shared_ptr CreateTrafficDefinitionWriter() = 0; + virtual std::shared_ptr CreateTrafficDistributionWriter() = 0; + virtual std::shared_ptr CreateTrafficDistributionEntryWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalActionWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalConditionWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalControllerWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalControllerActionWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalControllerConditionWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalGroupStateWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalStateWriter() = 0; + virtual std::shared_ptr CreateTrafficSignalStateActionWriter() = 0; + virtual std::shared_ptr CreateTrafficSinkActionWriter() = 0; + virtual std::shared_ptr CreateTrafficSourceActionWriter() = 0; + virtual std::shared_ptr CreateTrafficStopActionWriter() = 0; + virtual std::shared_ptr CreateTrafficSwarmActionWriter() = 0; + virtual std::shared_ptr CreateTrailerWriter() = 0; + virtual std::shared_ptr CreateTrailerActionWriter() = 0; + virtual std::shared_ptr CreateTrailerCouplerWriter() = 0; + virtual std::shared_ptr CreateTrailerHitchWriter() = 0; + virtual std::shared_ptr CreateTrajectoryWriter() = 0; + virtual std::shared_ptr CreateTrajectoryCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateTrajectoryFollowingModeWriter() = 0; + virtual std::shared_ptr CreateTrajectoryPositionWriter() = 0; + virtual std::shared_ptr CreateTrajectoryRefWriter() = 0; + virtual std::shared_ptr CreateTransitionDynamicsWriter() = 0; + virtual std::shared_ptr CreateTraveledDistanceConditionWriter() = 0; + virtual std::shared_ptr CreateTriggerWriter() = 0; + virtual std::shared_ptr CreateTriggeringEntitiesWriter() = 0; + virtual std::shared_ptr CreateUniformDistributionWriter() = 0; + virtual std::shared_ptr CreateUsedAreaWriter() = 0; + virtual std::shared_ptr CreateUserDefinedActionWriter() = 0; + virtual std::shared_ptr CreateUserDefinedAnimationWriter() = 0; + virtual std::shared_ptr CreateUserDefinedComponentWriter() = 0; + virtual std::shared_ptr CreateUserDefinedDistributionWriter() = 0; + virtual std::shared_ptr CreateUserDefinedLightWriter() = 0; + virtual std::shared_ptr CreateUserDefinedValueConditionWriter() = 0; + virtual std::shared_ptr CreateValueConstraintWriter() = 0; + virtual std::shared_ptr CreateValueConstraintGroupWriter() = 0; + virtual std::shared_ptr CreateValueSetDistributionWriter() = 0; + virtual std::shared_ptr CreateVariableActionWriter() = 0; + virtual std::shared_ptr CreateVariableAddValueRuleWriter() = 0; + virtual std::shared_ptr CreateVariableConditionWriter() = 0; + virtual std::shared_ptr CreateVariableDeclarationWriter() = 0; + virtual std::shared_ptr CreateVariableModifyActionWriter() = 0; + virtual std::shared_ptr CreateVariableModifyRuleWriter() = 0; + virtual std::shared_ptr CreateVariableMultiplyByValueRuleWriter() = 0; + virtual std::shared_ptr CreateVariableSetActionWriter() = 0; + virtual std::shared_ptr CreateVehicleWriter() = 0; + virtual std::shared_ptr CreateVehicleCatalogLocationWriter() = 0; + virtual std::shared_ptr CreateVehicleCategoryDistributionWriter() = 0; + virtual std::shared_ptr CreateVehicleCategoryDistributionEntryWriter() = 0; + virtual std::shared_ptr CreateVehicleComponentWriter() = 0; + virtual std::shared_ptr CreateVehicleLightWriter() = 0; + virtual std::shared_ptr CreateVehicleRoleDistributionWriter() = 0; + virtual std::shared_ptr CreateVehicleRoleDistributionEntryWriter() = 0; + virtual std::shared_ptr CreateVertexWriter() = 0; + virtual std::shared_ptr CreateVisibilityActionWriter() = 0; + virtual std::shared_ptr CreateWaypointWriter() = 0; + virtual std::shared_ptr CreateWeatherWriter() = 0; + virtual std::shared_ptr CreateWindWriter() = 0; + virtual std::shared_ptr CreateWorldPositionWriter() = 0; + + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.cpp new file mode 100644 index 00000000..d70f5177 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.cpp @@ -0,0 +1,271 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CatalogHelperV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A helper class for the catalog elements. This class provides conversion methods for all subclasses of ICatalogElement + * and a method for providing the name + * + * @author RA Consulting OpenSCENARIO generation facility + */ + + /** + * Tests for the type IController + * @param catalogElement the catalog element + * @return true if the catalog element is of type IController + */ + bool CatalogHelper::IsController(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IEnvironment + * @param catalogElement the catalog element + * @return true if the catalog element is of type IEnvironment + */ + bool CatalogHelper::IsEnvironment(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IManeuver + * @param catalogElement the catalog element + * @return true if the catalog element is of type IManeuver + */ + bool CatalogHelper::IsManeuver(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IMiscObject + * @param catalogElement the catalog element + * @return true if the catalog element is of type IMiscObject + */ + bool CatalogHelper::IsMiscObject(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IPedestrian + * @param catalogElement the catalog element + * @return true if the catalog element is of type IPedestrian + */ + bool CatalogHelper::IsPedestrian(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IRoute + * @param catalogElement the catalog element + * @return true if the catalog element is of type IRoute + */ + bool CatalogHelper::IsRoute(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type ITrajectory + * @param catalogElement the catalog element + * @return true if the catalog element is of type ITrajectory + */ + bool CatalogHelper::IsTrajectory(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Tests for the type IVehicle + * @param catalogElement the catalog element + * @return true if the catalog element is of type IVehicle + */ + bool CatalogHelper::IsVehicle(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast(catalogElement) != nullptr; + } + + /** + * Conversion to type IController + * @param catalogElement the catalog element + * @return converted value of type IController or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsController(std::shared_ptr& catalogElement) + { + if (IsController(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IEnvironment + * @param catalogElement the catalog element + * @return converted value of type IEnvironment or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsEnvironment(std::shared_ptr& catalogElement) + { + if (IsEnvironment(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IManeuver + * @param catalogElement the catalog element + * @return converted value of type IManeuver or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsManeuver(std::shared_ptr& catalogElement) + { + if (IsManeuver(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IMiscObject + * @param catalogElement the catalog element + * @return converted value of type IMiscObject or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsMiscObject(std::shared_ptr& catalogElement) + { + if (IsMiscObject(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IPedestrian + * @param catalogElement the catalog element + * @return converted value of type IPedestrian or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsPedestrian(std::shared_ptr& catalogElement) + { + if (IsPedestrian(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IRoute + * @param catalogElement the catalog element + * @return converted value of type IRoute or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsRoute(std::shared_ptr& catalogElement) + { + if (IsRoute(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type ITrajectory + * @param catalogElement the catalog element + * @return converted value of type ITrajectory or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsTrajectory(std::shared_ptr& catalogElement) + { + if (IsTrajectory(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Conversion to type IVehicle + * @param catalogElement the catalog element + * @return converted value of type IVehicle or null if the catalogElement + * cannot be converted + */ + std::shared_ptr CatalogHelper::AsVehicle(std::shared_ptr& catalogElement) + { + if (IsVehicle(catalogElement)) + return std::dynamic_pointer_cast(catalogElement); + return std::shared_ptr(nullptr); + } + + /** + * Provides the name of the catalogElement + * @param catalogElement the catalog element + * @return the name of the catalogElement + * cannot be converted + */ + std::string CatalogHelper::GetName(std::shared_ptr& catalogElement) + { + if (IsController(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsEnvironment(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsManeuver(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsMiscObject(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsPedestrian(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsRoute(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsTrajectory(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + if (IsVehicle(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetName(); + return ""; + } + /** + * Provides the ParameterDeclarations of the catalogElement + * @param catalogElement the catalog element + * @return The list with the parameter declarations + */ + std::vector> CatalogHelper::GetParameterDeclarations(std::shared_ptr& catalogElement) + { + if (IsController(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsEnvironment(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsManeuver(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsMiscObject(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsPedestrian(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsRoute(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsTrajectory(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + if (IsVehicle(catalogElement)) + return std::dynamic_pointer_cast(catalogElement)->GetParameterDeclarations(); + return std::vector>(); + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.h b/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.h new file mode 100644 index 00000000..cf9784a6 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/catalog/CatalogHelperV1_3.h @@ -0,0 +1,175 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "ApiClassInterfacesV1_3.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * A helper class for the catalog elements. This class provides conversion methods for all subclasses of ICatalogElement + * and a method for providing the name + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogHelper + { + public: + /** + * Tests for the type IController + * @param catalogElement the catalog element + * @return true if the catalog element is of type IController + */ + OPENSCENARIOLIB_EXP static bool IsController(std::shared_ptr& catalogElement); + + /** + * Tests for the type IEnvironment + * @param catalogElement the catalog element + * @return true if the catalog element is of type IEnvironment + */ + OPENSCENARIOLIB_EXP static bool IsEnvironment(std::shared_ptr& catalogElement); + + /** + * Tests for the type IManeuver + * @param catalogElement the catalog element + * @return true if the catalog element is of type IManeuver + */ + OPENSCENARIOLIB_EXP static bool IsManeuver(std::shared_ptr& catalogElement); + + /** + * Tests for the type IMiscObject + * @param catalogElement the catalog element + * @return true if the catalog element is of type IMiscObject + */ + OPENSCENARIOLIB_EXP static bool IsMiscObject(std::shared_ptr& catalogElement); + + /** + * Tests for the type IPedestrian + * @param catalogElement the catalog element + * @return true if the catalog element is of type IPedestrian + */ + OPENSCENARIOLIB_EXP static bool IsPedestrian(std::shared_ptr& catalogElement); + + /** + * Tests for the type IRoute + * @param catalogElement the catalog element + * @return true if the catalog element is of type IRoute + */ + OPENSCENARIOLIB_EXP static bool IsRoute(std::shared_ptr& catalogElement); + + /** + * Tests for the type ITrajectory + * @param catalogElement the catalog element + * @return true if the catalog element is of type ITrajectory + */ + OPENSCENARIOLIB_EXP static bool IsTrajectory(std::shared_ptr& catalogElement); + + /** + * Tests for the type IVehicle + * @param catalogElement the catalog element + * @return true if the catalog element is of type IVehicle + */ + OPENSCENARIOLIB_EXP static bool IsVehicle(std::shared_ptr& catalogElement); + + /** + * Conversion to type IController + * @param catalogElement the catalog element + * @return converted value of type IController or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsController(std::shared_ptr& catalogElement); + + /** + * Conversion to type IEnvironment + * @param catalogElement the catalog element + * @return converted value of type IEnvironment or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsEnvironment(std::shared_ptr& catalogElement); + + /** + * Conversion to type IManeuver + * @param catalogElement the catalog element + * @return converted value of type IManeuver or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsManeuver(std::shared_ptr& catalogElement); + + /** + * Conversion to type IMiscObject + * @param catalogElement the catalog element + * @return converted value of type IMiscObject or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsMiscObject(std::shared_ptr& catalogElement); + + /** + * Conversion to type IPedestrian + * @param catalogElement the catalog element + * @return converted value of type IPedestrian or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsPedestrian(std::shared_ptr& catalogElement); + + /** + * Conversion to type IRoute + * @param catalogElement the catalog element + * @return converted value of type IRoute or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsRoute(std::shared_ptr& catalogElement); + + /** + * Conversion to type ITrajectory + * @param catalogElement the catalog element + * @return converted value of type ITrajectory or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsTrajectory(std::shared_ptr& catalogElement); + + /** + * Conversion to type IVehicle + * @param catalogElement the catalog element + * @return converted value of type IVehicle or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr AsVehicle(std::shared_ptr& catalogElement); + + /** + * Provides the name of the catalogElement + * @param catalogElement the catalog element + * @return the name of the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::string GetName(std::shared_ptr& catalogElement); + + /** + * Provides the ParameterDeclarations of the catalogElement + * @param catalogElement the catalog element + * @return The list with the parameter declarations + */ + OPENSCENARIOLIB_EXP static std::vector> GetParameterDeclarations(std::shared_ptr& catalogElement); + + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/IScenarioCheckerV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/IScenarioCheckerV1_3.h new file mode 100644 index 00000000..639ef730 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/IScenarioCheckerV1_3.h @@ -0,0 +1,356 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "IParserMessageLogger.h" +#include "ApiClassInterfacesV1_3.h" +#include "ICheckerRule.h" +#include "MemLeakDetection.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Provides a method for every type of the osc model to add checker rules. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class IScenarioChecker + { + public: + IScenarioChecker() = default; + virtual ~IScenarioChecker() = default; + + /** + * Checks the scenario in a file context + * + * @param messageLogger the logger for file context + * @param openScenario the root of the tree + */ + + virtual void CheckScenarioInFileContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) = 0; + + /** + * Checks the scenario in a tree context + * + * @param messageLogger the logger for file context + * @param openScenario the root of the tree + */ + + virtual void CheckScenarioInTreeContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) = 0; + + virtual void AddAbsoluteSpeedCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAbsoluteTargetLaneCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAbsoluteTargetLaneOffsetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAbsoluteTargetSpeedCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAccelerationConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAcquirePositionActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddActCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddActivateControllerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddActorsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAddEntityActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAngleConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAnimationActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAnimationFileCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAnimationStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAnimationTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAppearanceActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAssignControllerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAssignRouteActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAutomaticGearCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAxleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddAxlesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddBoundingBoxCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddBrakeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddBrakeInputCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddByEntityConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddByObjectTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddByTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddByValueConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCatalogCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCatalogDefinitionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCatalogLocationsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCatalogReferenceCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCenterCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCentralSwarmObjectCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddClothoidCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddClothoidSplineCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddClothoidSplineSegmentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCollisionConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddColorCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddColorCmykCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddColorRgbCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddComponentAnimationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddConditionGroupCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddConnectTrailerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControlPointCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControllerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControllerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControllerCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControllerDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddControllerDistributionEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCustomCommandActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddCustomContentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeleteEntityActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicMultiParameterDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicMultiParameterDistributionTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicParameterDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicSingleParameterDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDeterministicSingleParameterDistributionTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDimensionsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDirectionOfTravelDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDirectoryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDisconnectTrailerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDistanceConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDistributionDefinitionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDistributionRangeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDistributionSetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDistributionSetElementCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDomeImageCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddDynamicConstraintsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEndOfRoadConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntitiesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityDistributionEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityObjectCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntityRefCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEntitySelectionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEnvironmentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEnvironmentActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEnvironmentCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddEventCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddExternalObjectReferenceCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddFileCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddFileHeaderCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddFinalSpeedCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddFogCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddFollowTrajectoryActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddGearCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddGeoPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddGlobalActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddHistogramCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddHistogramBinCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddInRoutePositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddInfrastructureActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddInitCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddInitActionsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddKnotCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneChangeActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneChangeTargetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneOffsetActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneOffsetActionDynamicsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLaneOffsetTargetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLanePositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLateralActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLateralDistanceActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLicenseCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLightStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLightStateActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLightTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLogNormalDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLongitudinalActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddLongitudinalDistanceActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddManeuverCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddManeuverCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddManeuverGroupCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddManualGearCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddMiscObjectCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddMiscObjectCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddModifyRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddMonitorDeclarationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddNoneCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddNormalDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddNurbsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddObjectControllerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOffroadConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOpenScenarioCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOpenScenarioCategoryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOrientationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideBrakeActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideClutchActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideControllerValueActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideGearActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideParkingBrakeActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideSteeringWheelActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddOverrideThrottleActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterAddValueRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterAssignmentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterDeclarationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterModifyActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterMultiplyByValueRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterSetActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterValueDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterValueDistributionDefinitionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddParameterValueSetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPedestrianCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPedestrianAnimationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPedestrianCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPedestrianGestureCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPerformanceCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPhaseCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPoissonDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPolygonCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPolylineCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPositionInLaneCoordinatesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPositionInRoadCoordinatesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPositionOfCurrentEntityCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPrecipitationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPrivateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPrivateActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddProbabilityDistributionSetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddProbabilityDistributionSetElementCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPropertiesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddPropertyCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRandomRouteActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRangeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddReachPositionConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeAngleConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeClearanceConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeDistanceConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeLanePositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeLaneRangeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeObjectPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeRoadPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeSpeedConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeSpeedToMasterCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeTargetLaneCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeTargetLaneOffsetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeTargetSpeedCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRelativeWorldPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoadConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoadCursorCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoadNetworkCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoadPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoadRangeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRouteCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRouteCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoutePositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRouteRefCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddRoutingActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddScenarioDefinitionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddScenarioObjectCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddScenarioObjectTemplateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSelectedEntitiesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSensorReferenceCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSensorReferenceSetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSetMonitorActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddShapeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSimulationTimeConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSpeedActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSpeedActionTargetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSpeedConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSpeedProfileActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSpeedProfileEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStandStillConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSteadyStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStochasticCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStochasticDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStochasticDistributionTypeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStoryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStoryboardCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddStoryboardElementStateConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSunCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddSynchronizeActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTargetDistanceSteadyStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTargetTimeSteadyStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTeleportActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeHeadwayConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeOfDayCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeOfDayConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeReferenceCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeToCollisionConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimeToCollisionConditionTargetCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTimingCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficAreaCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficAreaActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficDefinitionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficDistributionEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalControllerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalControllerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalControllerConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalGroupStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalStateCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSignalStateActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSinkActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSourceActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficStopActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrafficSwarmActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrailerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrailerActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrailerCouplerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrailerHitchCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrajectoryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrajectoryCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrajectoryFollowingModeCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrajectoryPositionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTrajectoryRefCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTransitionDynamicsCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTraveledDistanceConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTriggerCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddTriggeringEntitiesCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUniformDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUsedAreaCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedAnimationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedComponentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedLightCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddUserDefinedValueConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddValueConstraintCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddValueConstraintGroupCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddValueSetDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableAddValueRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableConditionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableDeclarationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableModifyActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableModifyRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableMultiplyByValueRuleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVariableSetActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleCatalogLocationCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleCategoryDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleCategoryDistributionEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleComponentCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleLightCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleRoleDistributionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVehicleRoleDistributionEntryCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVertexCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddVisibilityActionCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddWaypointCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddWeatherCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddWindCheckerRule(std::shared_ptr checkerRule) = 0; + virtual void AddWorldPositionCheckerRule(std::shared_ptr checkerRule) = 0; + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.cpp new file mode 100644 index 00000000..3c0a98ca --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.cpp @@ -0,0 +1,2101 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ScenarioCheckerImplV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void ScenarioCheckerImpl::CheckScenarioInFileContext(std::shared_ptr messageLogger, const std::shared_ptr openScenario) + { + ApplyOpenScenarioCheckerRules(std::dynamic_pointer_cast(messageLogger), openScenario, MODE_FILE); + } + + void ScenarioCheckerImpl::CheckScenarioInTreeContext(std::shared_ptr messageLogger, const std::shared_ptr openScenario) + { + ApplyOpenScenarioCheckerRules(std::dynamic_pointer_cast(messageLogger), openScenario, MODE_TREE); + } + + void ScenarioCheckerImpl::AddAbsoluteSpeedCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteSpeed).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAbsoluteSpeed).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAbsoluteTargetLaneCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetLane).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAbsoluteTargetLane).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAbsoluteTargetLaneOffsetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetLaneOffset).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAbsoluteTargetLaneOffset).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAbsoluteTargetSpeedCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetSpeed).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAbsoluteTargetSpeed).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAccelerationConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAccelerationCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAccelerationCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAcquirePositionActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAcquirePositionAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAcquirePositionAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddActCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAct).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAct).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddActivateControllerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IActivateControllerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IActivateControllerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddActorsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IActors).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IActors).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAddEntityActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAddEntityAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAddEntityAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAngleConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAngleCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAngleCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAnimationActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAnimationAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAnimationFileCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationFile).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAnimationFile).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAnimationStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAnimationState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAnimationTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAnimationType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAppearanceActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAppearanceAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAppearanceAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAssignControllerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAssignControllerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAssignControllerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAssignRouteActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAssignRouteAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAssignRouteAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAutomaticGearCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAutomaticGear).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAutomaticGear).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAxleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAxle).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAxle).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddAxlesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAxles).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IAxles).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddBoundingBoxCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBoundingBox).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IBoundingBox).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddBrakeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBrake).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IBrake).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddBrakeInputCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBrakeInput).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IBrakeInput).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddByEntityConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByEntityCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IByEntityCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddByObjectTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByObjectType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IByObjectType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddByTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IByType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddByValueConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByValueCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IByValueCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCatalogCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalog).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICatalog).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCatalogDefinitionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogDefinition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICatalogDefinition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCatalogLocationsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogLocations).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICatalogLocations).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCatalogReferenceCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogReference).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICatalogReference).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCenterCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICenter).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICenter).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCentralSwarmObjectCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICentralSwarmObject).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICentralSwarmObject).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddClothoidCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoid).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IClothoid).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddClothoidSplineCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoidSpline).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IClothoidSpline).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddClothoidSplineSegmentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoidSplineSegment).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IClothoidSplineSegment).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCollisionConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICollisionCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICollisionCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddColorCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColor).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IColor).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddColorCmykCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColorCmyk).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IColorCmyk).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddColorRgbCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColorRgb).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IColorRgb).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddComponentAnimationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IComponentAnimation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IComponentAnimation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddConditionGroupCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IConditionGroup).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IConditionGroup).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddConnectTrailerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IConnectTrailerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IConnectTrailerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControlPointCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControlPoint).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IControlPoint).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControllerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IController).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IController).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControllerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IControllerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControllerCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IControllerCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControllerDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IControllerDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddControllerDistributionEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerDistributionEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IControllerDistributionEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCustomCommandActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICustomCommandAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICustomCommandAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddCustomContentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICustomContent).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ICustomContent).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeleteEntityActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeleteEntityAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeleteEntityAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministic).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministic).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicMultiParameterDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicMultiParameterDistributionTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistributionType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistributionType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicParameterDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicParameterDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministicParameterDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicSingleParameterDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDeterministicSingleParameterDistributionTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistributionType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistributionType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDimensionsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDimensions).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDimensions).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDirectionOfTravelDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDirectionOfTravelDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDirectionOfTravelDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDirectoryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDirectory).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDirectory).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDisconnectTrailerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDisconnectTrailerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDisconnectTrailerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDistanceConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistanceCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDistanceCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDistributionDefinitionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionDefinition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDistributionDefinition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDistributionRangeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionRange).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDistributionRange).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDistributionSetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionSet).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDistributionSet).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDistributionSetElementCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionSetElement).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDistributionSetElement).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDomeImageCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDomeImage).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDomeImage).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddDynamicConstraintsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDynamicConstraints).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IDynamicConstraints).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEndOfRoadConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEndOfRoadCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEndOfRoadCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntitiesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntities).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntities).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityDistributionEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityDistributionEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityDistributionEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityObjectCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityObject).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityObject).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntityRefCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityRef).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntityRef).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEntitySelectionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntitySelection).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEntitySelection).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEnvironmentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironment).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEnvironment).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEnvironmentActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironmentAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEnvironmentAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEnvironmentCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironmentCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEnvironmentCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddEventCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEvent).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IEvent).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddExternalObjectReferenceCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IExternalObjectReference).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IExternalObjectReference).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddFileCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFile).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IFile).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddFileHeaderCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFileHeader).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IFileHeader).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddFinalSpeedCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFinalSpeed).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IFinalSpeed).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddFogCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFog).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IFog).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddFollowTrajectoryActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFollowTrajectoryAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IFollowTrajectoryAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddGearCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGear).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IGear).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddGeoPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGeoPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IGeoPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddGlobalActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGlobalAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IGlobalAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddHistogramCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IHistogram).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IHistogram).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddHistogramBinCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IHistogramBin).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IHistogramBin).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddInRoutePositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInRoutePosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IInRoutePosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddInfrastructureActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInfrastructureAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IInfrastructureAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddInitCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInit).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IInit).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddInitActionsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInitActions).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IInitActions).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddKnotCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IKnot).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IKnot).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILane).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILane).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneChangeActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneChangeAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILaneChangeAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneChangeTargetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneChangeTarget).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILaneChangeTarget).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneOffsetActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILaneOffsetAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneOffsetActionDynamicsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetActionDynamics).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILaneOffsetActionDynamics).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLaneOffsetTargetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetTarget).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILaneOffsetTarget).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLanePositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILanePosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILanePosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLateralActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILateralAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILateralAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLateralDistanceActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILateralDistanceAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILateralDistanceAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLicenseCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILicense).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILicense).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLightStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILightState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLightStateActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightStateAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILightStateAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLightTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILightType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLogNormalDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILogNormalDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILogNormalDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLongitudinalActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILongitudinalAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILongitudinalAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddLongitudinalDistanceActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILongitudinalDistanceAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ILongitudinalDistanceAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddManeuverCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuver).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IManeuver).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddManeuverCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuverCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IManeuverCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddManeuverGroupCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuverGroup).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IManeuverGroup).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddManualGearCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManualGear).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IManualGear).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddMiscObjectCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMiscObject).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IMiscObject).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddMiscObjectCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMiscObjectCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IMiscObjectCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddModifyRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IModifyRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IModifyRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddMonitorDeclarationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMonitorDeclaration).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IMonitorDeclaration).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddNoneCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INone).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(INone).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddNormalDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INormalDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(INormalDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddNurbsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INurbs).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(INurbs).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddObjectControllerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IObjectController).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IObjectController).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOffroadConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOffroadCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOffroadCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOpenScenarioCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOpenScenario).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOpenScenario).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOpenScenarioCategoryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOpenScenarioCategory).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOpenScenarioCategory).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOrientationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOrientation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOrientation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideBrakeActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideBrakeAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideBrakeAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideClutchActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideClutchAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideClutchAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideControllerValueActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideControllerValueAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideControllerValueAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideGearActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideGearAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideGearAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideParkingBrakeActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideParkingBrakeAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideParkingBrakeAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideSteeringWheelActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideSteeringWheelAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideSteeringWheelAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddOverrideThrottleActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideThrottleAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IOverrideThrottleAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterAddValueRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAddValueRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterAddValueRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterAssignmentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAssignment).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterAssignment).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterDeclarationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterDeclaration).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterDeclaration).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterModifyActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterModifyAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterModifyAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterMultiplyByValueRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterMultiplyByValueRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterMultiplyByValueRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterSetActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterSetAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterSetAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterValueDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterValueDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterValueDistributionDefinitionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueDistributionDefinition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterValueDistributionDefinition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddParameterValueSetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueSet).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IParameterValueSet).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPedestrianCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrian).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPedestrian).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPedestrianAnimationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianAnimation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPedestrianAnimation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPedestrianCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPedestrianCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPedestrianGestureCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianGesture).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPedestrianGesture).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPerformanceCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPerformance).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPerformance).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPhaseCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPhase).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPhase).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPoissonDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPoissonDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPoissonDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPolygonCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPolygon).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPolygon).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPolylineCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPolyline).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPolyline).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPositionInLaneCoordinatesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionInLaneCoordinates).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPositionInLaneCoordinates).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPositionInRoadCoordinatesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionInRoadCoordinates).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPositionInRoadCoordinates).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPositionOfCurrentEntityCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionOfCurrentEntity).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPositionOfCurrentEntity).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPrecipitationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrecipitation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPrecipitation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPrivateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrivate).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPrivate).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPrivateActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrivateAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IPrivateAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddProbabilityDistributionSetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProbabilityDistributionSet).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IProbabilityDistributionSet).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddProbabilityDistributionSetElementCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProbabilityDistributionSetElement).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IProbabilityDistributionSetElement).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPropertiesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProperties).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IProperties).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddPropertyCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProperty).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IProperty).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRandomRouteActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRandomRouteAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRandomRouteAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRangeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRange).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRange).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddReachPositionConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IReachPositionCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IReachPositionCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeAngleConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeAngleCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeAngleCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeClearanceConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeClearanceCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeClearanceCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeDistanceConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeDistanceCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeDistanceCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeLanePositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeLanePosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeLanePosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeLaneRangeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeLaneRange).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeLaneRange).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeObjectPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeObjectPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeObjectPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeRoadPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeRoadPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeRoadPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeSpeedConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeSpeedCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeSpeedCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeSpeedToMasterCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeSpeedToMaster).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeSpeedToMaster).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeTargetLaneCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetLane).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeTargetLane).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeTargetLaneOffsetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetLaneOffset).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeTargetLaneOffset).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeTargetSpeedCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetSpeed).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeTargetSpeed).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRelativeWorldPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeWorldPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRelativeWorldPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoadConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoadCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoadCursorCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadCursor).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoadCursor).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoadNetworkCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadNetwork).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoadNetwork).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoadPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoadPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoadRangeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadRange).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoadRange).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRouteCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoute).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoute).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRouteCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRouteCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRouteCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoutePositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoutePosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoutePosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRouteRefCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRouteRef).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRouteRef).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddRoutingActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoutingAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IRoutingAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddScenarioDefinitionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioDefinition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IScenarioDefinition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddScenarioObjectCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioObject).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IScenarioObject).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddScenarioObjectTemplateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioObjectTemplate).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IScenarioObjectTemplate).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSelectedEntitiesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISelectedEntities).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISelectedEntities).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSensorReferenceCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISensorReference).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISensorReference).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSensorReferenceSetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISensorReferenceSet).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISensorReferenceSet).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSetMonitorActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISetMonitorAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISetMonitorAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddShapeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IShape).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IShape).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSimulationTimeConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISimulationTimeCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISimulationTimeCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSpeedActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISpeedAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSpeedActionTargetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedActionTarget).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISpeedActionTarget).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSpeedConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISpeedCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSpeedProfileActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedProfileAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISpeedProfileAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSpeedProfileEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedProfileEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISpeedProfileEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStandStillConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStandStillCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStandStillCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSteadyStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISteadyState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISteadyState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStochasticCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochastic).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStochastic).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStochasticDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochasticDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStochasticDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStochasticDistributionTypeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochasticDistributionType).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStochasticDistributionType).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStoryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStory).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStory).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStoryboardCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStoryboard).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStoryboard).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddStoryboardElementStateConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStoryboardElementStateCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IStoryboardElementStateCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSunCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISun).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISun).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddSynchronizeActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISynchronizeAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ISynchronizeAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTargetDistanceSteadyStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITargetDistanceSteadyState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITargetDistanceSteadyState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTargetTimeSteadyStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITargetTimeSteadyState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITargetTimeSteadyState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTeleportActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITeleportAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITeleportAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeHeadwayConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeHeadwayCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeHeadwayCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeOfDayCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeOfDay).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeOfDay).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeOfDayConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeOfDayCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeOfDayCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeReferenceCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeReference).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeReference).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeToCollisionConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeToCollisionCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeToCollisionCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimeToCollisionConditionTargetCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeToCollisionConditionTarget).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITimeToCollisionConditionTarget).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTimingCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITiming).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITiming).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficAreaCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficArea).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficArea).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficAreaActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficAreaAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficAreaAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficDefinitionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDefinition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficDefinition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficDistributionEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDistributionEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficDistributionEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalControllerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalController).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalController).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalControllerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalControllerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalControllerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalControllerConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalControllerCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalControllerCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalGroupStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalGroupState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalGroupState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalStateCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalState).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalState).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSignalStateActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalStateAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSignalStateAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSinkActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSinkAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSinkAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSourceActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSourceAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSourceAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficStopActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficStopAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficStopAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrafficSwarmActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSwarmAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrafficSwarmAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrailerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailer).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrailer).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrailerActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrailerAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrailerCouplerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerCoupler).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrailerCoupler).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrailerHitchCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerHitch).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrailerHitch).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrajectoryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectory).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrajectory).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrajectoryCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrajectoryCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrajectoryFollowingModeCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryFollowingMode).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrajectoryFollowingMode).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrajectoryPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrajectoryPosition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTrajectoryRefCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryRef).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrajectoryRef).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTransitionDynamicsCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITransitionDynamics).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITransitionDynamics).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTraveledDistanceConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITraveledDistanceCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITraveledDistanceCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTriggerCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrigger).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITrigger).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddTriggeringEntitiesCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITriggeringEntities).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(ITriggeringEntities).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUniformDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUniformDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUniformDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUsedAreaCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUsedArea).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUsedArea).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedAnimationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedAnimation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedAnimation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedComponentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedComponent).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedComponent).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedLightCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedLight).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedLight).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddUserDefinedValueConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedValueCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IUserDefinedValueCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddValueConstraintCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueConstraint).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IValueConstraint).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddValueConstraintGroupCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueConstraintGroup).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IValueConstraintGroup).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddValueSetDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueSetDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IValueSetDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableAddValueRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableAddValueRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableAddValueRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableConditionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableCondition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableCondition).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableDeclarationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableDeclaration).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableDeclaration).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableModifyActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableModifyAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableModifyAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableModifyRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableModifyRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableModifyRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableMultiplyByValueRuleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableMultiplyByValueRule).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableMultiplyByValueRule).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVariableSetActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableSetAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVariableSetAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicle).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicle).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleCatalogLocationCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCatalogLocation).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleCatalogLocation).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleCategoryDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCategoryDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleCategoryDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleCategoryDistributionEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCategoryDistributionEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleCategoryDistributionEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleComponentCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleComponent).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleComponent).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleLightCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleLight).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleLight).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleRoleDistributionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleRoleDistribution).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleRoleDistribution).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVehicleRoleDistributionEntryCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleRoleDistributionEntry).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVehicleRoleDistributionEntry).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVertexCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVertex).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVertex).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddVisibilityActionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVisibilityAction).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IVisibilityAction).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddWaypointCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWaypoint).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IWaypoint).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddWeatherCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWeather).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IWeather).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddWindCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWind).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IWind).name()] = checkerRulesForType; + } + + void ScenarioCheckerImpl::AddWorldPositionCheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWorldPosition).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(IWorldPosition).name()] = checkerRulesForType; + } + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.h new file mode 100644 index 00000000..c5918fcf --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.h @@ -0,0 +1,9248 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include "IParserMessageLogger.h" +#include "ICheckerRule.h" +#include "IScenarioCheckerV1_3.h" +#include "ApiClassInterfacesV1_3.h" +#include "MemLeakDetection.h" +#include +#include "ExportDefinitions.h" +#include "IContentMessageLogger.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioCheckerImpl: public IScenarioChecker + { + private: + enum ContextMode { MODE_TREE, MODE_FILE }; + + //string is typeid(class).name() + std::map>> _typeToCheckerRuleList; + void ApplyAbsoluteSpeedCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteSpeed).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSteadyState = typedObject->GetSteadyState(); + if ( kSteadyState) + { + ApplySteadyStateCheckerRules(messageLogger, kSteadyState, contextMode); + } + } + void ApplyAbsoluteTargetLaneCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetLane).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAbsoluteTargetLaneOffsetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetLaneOffset).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAbsoluteTargetSpeedCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAbsoluteTargetSpeed).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAccelerationConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAccelerationCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAcquirePositionActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAcquirePositionAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyActCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAct).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kManeuverGroups = typedObject->GetManeuverGroups(); + for(auto& kListItem: kManeuverGroups) + { + if ( kListItem ) + ApplyManeuverGroupCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kStartTrigger = typedObject->GetStartTrigger(); + if ( kStartTrigger) + { + ApplyTriggerCheckerRules(messageLogger, kStartTrigger, contextMode); + } + const auto kStopTrigger = typedObject->GetStopTrigger(); + if ( kStopTrigger) + { + ApplyTriggerCheckerRules(messageLogger, kStopTrigger, contextMode); + } + } + void ApplyActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kGlobalAction = typedObject->GetGlobalAction(); + if ( kGlobalAction) + { + ApplyGlobalActionCheckerRules(messageLogger, kGlobalAction, contextMode); + } + const auto kUserDefinedAction = typedObject->GetUserDefinedAction(); + if ( kUserDefinedAction) + { + ApplyUserDefinedActionCheckerRules(messageLogger, kUserDefinedAction, contextMode); + } + const auto kPrivateAction = typedObject->GetPrivateAction(); + if ( kPrivateAction) + { + ApplyPrivateActionCheckerRules(messageLogger, kPrivateAction, contextMode); + } + } + void ApplyActivateControllerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IActivateControllerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyActorsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IActors).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityRefs = typedObject->GetEntityRefs(); + for(auto& kListItem: kEntityRefs) + { + if ( kListItem ) + ApplyEntityRefCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyAddEntityActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAddEntityAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyAngleConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAngleCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAnimationActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAnimationType = typedObject->GetAnimationType(); + if ( kAnimationType) + { + ApplyAnimationTypeCheckerRules(messageLogger, kAnimationType, contextMode); + } + const auto kAnimationState = typedObject->GetAnimationState(); + if ( kAnimationState) + { + ApplyAnimationStateCheckerRules(messageLogger, kAnimationState, contextMode); + } + } + void ApplyAnimationFileCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationFile).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kFile = typedObject->GetFile(); + if ( kFile) + { + ApplyFileCheckerRules(messageLogger, kFile, contextMode); + } + } + void ApplyAnimationStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAnimationTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAnimationType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kComponentAnimation = typedObject->GetComponentAnimation(); + if ( kComponentAnimation) + { + ApplyComponentAnimationCheckerRules(messageLogger, kComponentAnimation, contextMode); + } + const auto kPedestrianAnimation = typedObject->GetPedestrianAnimation(); + if ( kPedestrianAnimation) + { + ApplyPedestrianAnimationCheckerRules(messageLogger, kPedestrianAnimation, contextMode); + } + const auto kAnimationFile = typedObject->GetAnimationFile(); + if ( kAnimationFile) + { + ApplyAnimationFileCheckerRules(messageLogger, kAnimationFile, contextMode); + } + const auto kUserDefinedAnimation = typedObject->GetUserDefinedAnimation(); + if ( kUserDefinedAnimation) + { + ApplyUserDefinedAnimationCheckerRules(messageLogger, kUserDefinedAnimation, contextMode); + } + } + void ApplyAppearanceActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAppearanceAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLightStateAction = typedObject->GetLightStateAction(); + if ( kLightStateAction) + { + ApplyLightStateActionCheckerRules(messageLogger, kLightStateAction, contextMode); + } + const auto kAnimationAction = typedObject->GetAnimationAction(); + if ( kAnimationAction) + { + ApplyAnimationActionCheckerRules(messageLogger, kAnimationAction, contextMode); + } + } + void ApplyAssignControllerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAssignControllerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kController = typedObject->GetController(); + if ( kController) + { + ApplyControllerCheckerRules(messageLogger, kController, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + const auto kObjectController = typedObject->GetObjectController(); + if ( kObjectController) + { + ApplyObjectControllerCheckerRules(messageLogger, kObjectController, contextMode); + } + } + void ApplyAssignRouteActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAssignRouteAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRoute = typedObject->GetRoute(); + if ( kRoute) + { + ApplyRouteCheckerRules(messageLogger, kRoute, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + } + void ApplyAutomaticGearCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAutomaticGear).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAxleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAxle).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyAxlesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IAxles).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kFrontAxle = typedObject->GetFrontAxle(); + if ( kFrontAxle) + { + ApplyAxleCheckerRules(messageLogger, kFrontAxle, contextMode); + } + const auto kRearAxle = typedObject->GetRearAxle(); + if ( kRearAxle) + { + ApplyAxleCheckerRules(messageLogger, kRearAxle, contextMode); + } + const auto kAdditionalAxles = typedObject->GetAdditionalAxles(); + for(auto& kListItem: kAdditionalAxles) + { + if ( kListItem ) + ApplyAxleCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyBoundingBoxCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBoundingBox).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCenter = typedObject->GetCenter(); + if ( kCenter) + { + ApplyCenterCheckerRules(messageLogger, kCenter, contextMode); + } + const auto kDimensions = typedObject->GetDimensions(); + if ( kDimensions) + { + ApplyDimensionsCheckerRules(messageLogger, kDimensions, contextMode); + } + } + void ApplyBrakeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBrake).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyBrakeInputCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IBrakeInput).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kBrakePercent = typedObject->GetBrakePercent(); + if ( kBrakePercent) + { + ApplyBrakeCheckerRules(messageLogger, kBrakePercent, contextMode); + } + const auto kBrakeForce = typedObject->GetBrakeForce(); + if ( kBrakeForce) + { + ApplyBrakeCheckerRules(messageLogger, kBrakeForce, contextMode); + } + } + void ApplyByEntityConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByEntityCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTriggeringEntities = typedObject->GetTriggeringEntities(); + if ( kTriggeringEntities) + { + ApplyTriggeringEntitiesCheckerRules(messageLogger, kTriggeringEntities, contextMode); + } + const auto kEntityCondition = typedObject->GetEntityCondition(); + if ( kEntityCondition) + { + ApplyEntityConditionCheckerRules(messageLogger, kEntityCondition, contextMode); + } + } + void ApplyByObjectTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByObjectType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyByTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyByValueConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IByValueCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterCondition = typedObject->GetParameterCondition(); + if ( kParameterCondition) + { + ApplyParameterConditionCheckerRules(messageLogger, kParameterCondition, contextMode); + } + const auto kTimeOfDayCondition = typedObject->GetTimeOfDayCondition(); + if ( kTimeOfDayCondition) + { + ApplyTimeOfDayConditionCheckerRules(messageLogger, kTimeOfDayCondition, contextMode); + } + const auto kSimulationTimeCondition = typedObject->GetSimulationTimeCondition(); + if ( kSimulationTimeCondition) + { + ApplySimulationTimeConditionCheckerRules(messageLogger, kSimulationTimeCondition, contextMode); + } + const auto kStoryboardElementStateCondition = typedObject->GetStoryboardElementStateCondition(); + if ( kStoryboardElementStateCondition) + { + ApplyStoryboardElementStateConditionCheckerRules(messageLogger, kStoryboardElementStateCondition, contextMode); + } + const auto kUserDefinedValueCondition = typedObject->GetUserDefinedValueCondition(); + if ( kUserDefinedValueCondition) + { + ApplyUserDefinedValueConditionCheckerRules(messageLogger, kUserDefinedValueCondition, contextMode); + } + const auto kTrafficSignalCondition = typedObject->GetTrafficSignalCondition(); + if ( kTrafficSignalCondition) + { + ApplyTrafficSignalConditionCheckerRules(messageLogger, kTrafficSignalCondition, contextMode); + } + const auto kTrafficSignalControllerCondition = typedObject->GetTrafficSignalControllerCondition(); + if ( kTrafficSignalControllerCondition) + { + ApplyTrafficSignalControllerConditionCheckerRules(messageLogger, kTrafficSignalControllerCondition, contextMode); + } + const auto kVariableCondition = typedObject->GetVariableCondition(); + if ( kVariableCondition) + { + ApplyVariableConditionCheckerRules(messageLogger, kVariableCondition, contextMode); + } + } + void ApplyCatalogCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalog).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicles = typedObject->GetVehicles(); + for(auto& kListItem: kVehicles) + { + if ( kListItem ) + ApplyVehicleCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kControllers = typedObject->GetControllers(); + for(auto& kListItem: kControllers) + { + if ( kListItem ) + ApplyControllerCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kPedestrians = typedObject->GetPedestrians(); + for(auto& kListItem: kPedestrians) + { + if ( kListItem ) + ApplyPedestrianCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kMiscObjects = typedObject->GetMiscObjects(); + for(auto& kListItem: kMiscObjects) + { + if ( kListItem ) + ApplyMiscObjectCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kEnvironments = typedObject->GetEnvironments(); + for(auto& kListItem: kEnvironments) + { + if ( kListItem ) + ApplyEnvironmentCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kManeuvers = typedObject->GetManeuvers(); + for(auto& kListItem: kManeuvers) + { + if ( kListItem ) + ApplyManeuverCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kTrajectories = typedObject->GetTrajectories(); + for(auto& kListItem: kTrajectories) + { + if ( kListItem ) + ApplyTrajectoryCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kRoutes = typedObject->GetRoutes(); + for(auto& kListItem: kRoutes) + { + if ( kListItem ) + ApplyRouteCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyCatalogDefinitionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogDefinition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCatalog = typedObject->GetCatalog(); + if ( kCatalog) + { + ApplyCatalogCheckerRules(messageLogger, kCatalog, contextMode); + } + } + void ApplyCatalogLocationsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogLocations).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleCatalog = typedObject->GetVehicleCatalog(); + if ( kVehicleCatalog) + { + ApplyVehicleCatalogLocationCheckerRules(messageLogger, kVehicleCatalog, contextMode); + } + const auto kControllerCatalog = typedObject->GetControllerCatalog(); + if ( kControllerCatalog) + { + ApplyControllerCatalogLocationCheckerRules(messageLogger, kControllerCatalog, contextMode); + } + const auto kPedestrianCatalog = typedObject->GetPedestrianCatalog(); + if ( kPedestrianCatalog) + { + ApplyPedestrianCatalogLocationCheckerRules(messageLogger, kPedestrianCatalog, contextMode); + } + const auto kMiscObjectCatalog = typedObject->GetMiscObjectCatalog(); + if ( kMiscObjectCatalog) + { + ApplyMiscObjectCatalogLocationCheckerRules(messageLogger, kMiscObjectCatalog, contextMode); + } + const auto kEnvironmentCatalog = typedObject->GetEnvironmentCatalog(); + if ( kEnvironmentCatalog) + { + ApplyEnvironmentCatalogLocationCheckerRules(messageLogger, kEnvironmentCatalog, contextMode); + } + const auto kManeuverCatalog = typedObject->GetManeuverCatalog(); + if ( kManeuverCatalog) + { + ApplyManeuverCatalogLocationCheckerRules(messageLogger, kManeuverCatalog, contextMode); + } + const auto kTrajectoryCatalog = typedObject->GetTrajectoryCatalog(); + if ( kTrajectoryCatalog) + { + ApplyTrajectoryCatalogLocationCheckerRules(messageLogger, kTrajectoryCatalog, contextMode); + } + const auto kRouteCatalog = typedObject->GetRouteCatalog(); + if ( kRouteCatalog) + { + ApplyRouteCatalogLocationCheckerRules(messageLogger, kRouteCatalog, contextMode); + } + } + void ApplyCatalogReferenceCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICatalogReference).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterAssignments = typedObject->GetParameterAssignments(); + for(auto& kListItem: kParameterAssignments) + { + if ( kListItem ) + ApplyParameterAssignmentCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyCenterCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICenter).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyCentralSwarmObjectCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICentralSwarmObject).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyClothoidCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoid).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyClothoidSplineCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoidSpline).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSegments = typedObject->GetSegments(); + for(auto& kListItem: kSegments) + { + if ( kListItem ) + ApplyClothoidSplineSegmentCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyClothoidSplineSegmentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IClothoidSplineSegment).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPositionStart = typedObject->GetPositionStart(); + if ( kPositionStart) + { + ApplyPositionCheckerRules(messageLogger, kPositionStart, contextMode); + } + } + void ApplyCollisionConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICollisionCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityRef = typedObject->GetEntityRef(); + if ( kEntityRef) + { + ApplyEntityRefCheckerRules(messageLogger, kEntityRef, contextMode); + } + const auto kByType = typedObject->GetByType(); + if ( kByType) + { + ApplyByObjectTypeCheckerRules(messageLogger, kByType, contextMode); + } + } + void ApplyColorCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColor).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kColorRgb = typedObject->GetColorRgb(); + if ( kColorRgb) + { + ApplyColorRgbCheckerRules(messageLogger, kColorRgb, contextMode); + } + const auto kColorCmyk = typedObject->GetColorCmyk(); + if ( kColorCmyk) + { + ApplyColorCmykCheckerRules(messageLogger, kColorCmyk, contextMode); + } + } + void ApplyColorCmykCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColorCmyk).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyColorRgbCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IColorRgb).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyComponentAnimationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IComponentAnimation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleComponent = typedObject->GetVehicleComponent(); + if ( kVehicleComponent) + { + ApplyVehicleComponentCheckerRules(messageLogger, kVehicleComponent, contextMode); + } + const auto kUserDefinedComponent = typedObject->GetUserDefinedComponent(); + if ( kUserDefinedComponent) + { + ApplyUserDefinedComponentCheckerRules(messageLogger, kUserDefinedComponent, contextMode); + } + } + void ApplyConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kByEntityCondition = typedObject->GetByEntityCondition(); + if ( kByEntityCondition) + { + ApplyByEntityConditionCheckerRules(messageLogger, kByEntityCondition, contextMode); + } + const auto kByValueCondition = typedObject->GetByValueCondition(); + if ( kByValueCondition) + { + ApplyByValueConditionCheckerRules(messageLogger, kByValueCondition, contextMode); + } + } + void ApplyConditionGroupCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IConditionGroup).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kConditions = typedObject->GetConditions(); + for(auto& kListItem: kConditions) + { + if ( kListItem ) + ApplyConditionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyConnectTrailerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IConnectTrailerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyControlPointCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControlPoint).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyControllerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IController).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyControllerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAssignControllerAction = typedObject->GetAssignControllerAction(); + if ( kAssignControllerAction) + { + ApplyAssignControllerActionCheckerRules(messageLogger, kAssignControllerAction, contextMode); + } + const auto kOverrideControllerValueAction = typedObject->GetOverrideControllerValueAction(); + if ( kOverrideControllerValueAction) + { + ApplyOverrideControllerValueActionCheckerRules(messageLogger, kOverrideControllerValueAction, contextMode); + } + const auto kActivateControllerAction = typedObject->GetActivateControllerAction(); + if ( kActivateControllerAction) + { + ApplyActivateControllerActionCheckerRules(messageLogger, kActivateControllerAction, contextMode); + } + } + void ApplyControllerCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyControllerDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kControllerDistributionEntries = typedObject->GetControllerDistributionEntries(); + for(auto& kListItem: kControllerDistributionEntries) + { + if ( kListItem ) + ApplyControllerDistributionEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyControllerDistributionEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IControllerDistributionEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kController = typedObject->GetController(); + if ( kController) + { + ApplyControllerCheckerRules(messageLogger, kController, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + } + void ApplyCustomCommandActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICustomCommandAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyCustomContentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ICustomContent).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDeleteEntityActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeleteEntityAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDeterministicCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministic).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDeterministicParameterDistributions = typedObject->GetDeterministicParameterDistributions(); + for(auto& kListItem: kDeterministicParameterDistributions) + { + if ( kListItem ) + ApplyDeterministicParameterDistributionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyDeterministicMultiParameterDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDeterministicMultiParameterDistributionType = typedObject->GetDeterministicMultiParameterDistributionType(); + if ( kDeterministicMultiParameterDistributionType) + { + ApplyDeterministicMultiParameterDistributionTypeCheckerRules(messageLogger, kDeterministicMultiParameterDistributionType, contextMode); + } + } + void ApplyDeterministicMultiParameterDistributionTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicMultiParameterDistributionType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kValueSetDistribution = typedObject->GetValueSetDistribution(); + if ( kValueSetDistribution) + { + ApplyValueSetDistributionCheckerRules(messageLogger, kValueSetDistribution, contextMode); + } + } + void ApplyDeterministicParameterDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicParameterDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDeterministicMultiParameterDistribution = typedObject->GetDeterministicMultiParameterDistribution(); + if ( kDeterministicMultiParameterDistribution) + { + ApplyDeterministicMultiParameterDistributionCheckerRules(messageLogger, kDeterministicMultiParameterDistribution, contextMode); + } + const auto kDeterministicSingleParameterDistribution = typedObject->GetDeterministicSingleParameterDistribution(); + if ( kDeterministicSingleParameterDistribution) + { + ApplyDeterministicSingleParameterDistributionCheckerRules(messageLogger, kDeterministicSingleParameterDistribution, contextMode); + } + } + void ApplyDeterministicSingleParameterDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDeterministicSingleParameterDistributionType = typedObject->GetDeterministicSingleParameterDistributionType(); + if ( kDeterministicSingleParameterDistributionType) + { + ApplyDeterministicSingleParameterDistributionTypeCheckerRules(messageLogger, kDeterministicSingleParameterDistributionType, contextMode); + } + } + void ApplyDeterministicSingleParameterDistributionTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDeterministicSingleParameterDistributionType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDistributionSet = typedObject->GetDistributionSet(); + if ( kDistributionSet) + { + ApplyDistributionSetCheckerRules(messageLogger, kDistributionSet, contextMode); + } + const auto kDistributionRange = typedObject->GetDistributionRange(); + if ( kDistributionRange) + { + ApplyDistributionRangeCheckerRules(messageLogger, kDistributionRange, contextMode); + } + const auto kUserDefinedDistribution = typedObject->GetUserDefinedDistribution(); + if ( kUserDefinedDistribution) + { + ApplyUserDefinedDistributionCheckerRules(messageLogger, kUserDefinedDistribution, contextMode); + } + } + void ApplyDimensionsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDimensions).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDirectionOfTravelDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDirectionOfTravelDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDirectoryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDirectory).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDisconnectTrailerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDisconnectTrailerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDistanceConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistanceCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyDistributionDefinitionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionDefinition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDeterministic = typedObject->GetDeterministic(); + if ( kDeterministic) + { + ApplyDeterministicCheckerRules(messageLogger, kDeterministic, contextMode); + } + const auto kStochastic = typedObject->GetStochastic(); + if ( kStochastic) + { + ApplyStochasticCheckerRules(messageLogger, kStochastic, contextMode); + } + } + void ApplyDistributionRangeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionRange).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyDistributionSetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionSet).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kElements = typedObject->GetElements(); + for(auto& kListItem: kElements) + { + if ( kListItem ) + ApplyDistributionSetElementCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyDistributionSetElementCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDistributionSetElement).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyDomeImageCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDomeImage).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDomeFile = typedObject->GetDomeFile(); + if ( kDomeFile) + { + ApplyFileCheckerRules(messageLogger, kDomeFile, contextMode); + } + } + void ApplyDynamicConstraintsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IDynamicConstraints).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyEndOfRoadConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEndOfRoadCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyEntitiesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntities).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kScenarioObjects = typedObject->GetScenarioObjects(); + for(auto& kListItem: kScenarioObjects) + { + if ( kListItem ) + ApplyScenarioObjectCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kEntitySelections = typedObject->GetEntitySelections(); + for(auto& kListItem: kEntitySelections) + { + if ( kListItem ) + ApplyEntitySelectionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyEntityActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAddEntityAction = typedObject->GetAddEntityAction(); + if ( kAddEntityAction) + { + ApplyAddEntityActionCheckerRules(messageLogger, kAddEntityAction, contextMode); + } + const auto kDeleteEntityAction = typedObject->GetDeleteEntityAction(); + if ( kDeleteEntityAction) + { + ApplyDeleteEntityActionCheckerRules(messageLogger, kDeleteEntityAction, contextMode); + } + } + void ApplyEntityConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEndOfRoadCondition = typedObject->GetEndOfRoadCondition(); + if ( kEndOfRoadCondition) + { + ApplyEndOfRoadConditionCheckerRules(messageLogger, kEndOfRoadCondition, contextMode); + } + const auto kCollisionCondition = typedObject->GetCollisionCondition(); + if ( kCollisionCondition) + { + ApplyCollisionConditionCheckerRules(messageLogger, kCollisionCondition, contextMode); + } + const auto kOffroadCondition = typedObject->GetOffroadCondition(); + if ( kOffroadCondition) + { + ApplyOffroadConditionCheckerRules(messageLogger, kOffroadCondition, contextMode); + } + const auto kTimeHeadwayCondition = typedObject->GetTimeHeadwayCondition(); + if ( kTimeHeadwayCondition) + { + ApplyTimeHeadwayConditionCheckerRules(messageLogger, kTimeHeadwayCondition, contextMode); + } + const auto kTimeToCollisionCondition = typedObject->GetTimeToCollisionCondition(); + if ( kTimeToCollisionCondition) + { + ApplyTimeToCollisionConditionCheckerRules(messageLogger, kTimeToCollisionCondition, contextMode); + } + const auto kAccelerationCondition = typedObject->GetAccelerationCondition(); + if ( kAccelerationCondition) + { + ApplyAccelerationConditionCheckerRules(messageLogger, kAccelerationCondition, contextMode); + } + const auto kStandStillCondition = typedObject->GetStandStillCondition(); + if ( kStandStillCondition) + { + ApplyStandStillConditionCheckerRules(messageLogger, kStandStillCondition, contextMode); + } + const auto kSpeedCondition = typedObject->GetSpeedCondition(); + if ( kSpeedCondition) + { + ApplySpeedConditionCheckerRules(messageLogger, kSpeedCondition, contextMode); + } + const auto kRelativeSpeedCondition = typedObject->GetRelativeSpeedCondition(); + if ( kRelativeSpeedCondition) + { + ApplyRelativeSpeedConditionCheckerRules(messageLogger, kRelativeSpeedCondition, contextMode); + } + const auto kTraveledDistanceCondition = typedObject->GetTraveledDistanceCondition(); + if ( kTraveledDistanceCondition) + { + ApplyTraveledDistanceConditionCheckerRules(messageLogger, kTraveledDistanceCondition, contextMode); + } + const auto kReachPositionCondition = typedObject->GetReachPositionCondition(); + if ( kReachPositionCondition) + { + ApplyReachPositionConditionCheckerRules(messageLogger, kReachPositionCondition, contextMode); + } + const auto kDistanceCondition = typedObject->GetDistanceCondition(); + if ( kDistanceCondition) + { + ApplyDistanceConditionCheckerRules(messageLogger, kDistanceCondition, contextMode); + } + const auto kRelativeDistanceCondition = typedObject->GetRelativeDistanceCondition(); + if ( kRelativeDistanceCondition) + { + ApplyRelativeDistanceConditionCheckerRules(messageLogger, kRelativeDistanceCondition, contextMode); + } + const auto kRelativeClearanceCondition = typedObject->GetRelativeClearanceCondition(); + if ( kRelativeClearanceCondition) + { + ApplyRelativeClearanceConditionCheckerRules(messageLogger, kRelativeClearanceCondition, contextMode); + } + const auto kAngleCondition = typedObject->GetAngleCondition(); + if ( kAngleCondition) + { + ApplyAngleConditionCheckerRules(messageLogger, kAngleCondition, contextMode); + } + const auto kRelativeAngleCondition = typedObject->GetRelativeAngleCondition(); + if ( kRelativeAngleCondition) + { + ApplyRelativeAngleConditionCheckerRules(messageLogger, kRelativeAngleCondition, contextMode); + } + } + void ApplyEntityDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityDistributionEntry = typedObject->GetEntityDistributionEntry(); + for(auto& kListItem: kEntityDistributionEntry) + { + if ( kListItem ) + ApplyEntityDistributionEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyEntityDistributionEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityDistributionEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kScenarioObjectTemplate = typedObject->GetScenarioObjectTemplate(); + if ( kScenarioObjectTemplate) + { + ApplyScenarioObjectTemplateCheckerRules(messageLogger, kScenarioObjectTemplate, contextMode); + } + } + void ApplyEntityObjectCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityObject).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + const auto kVehicle = typedObject->GetVehicle(); + if ( kVehicle) + { + ApplyVehicleCheckerRules(messageLogger, kVehicle, contextMode); + } + const auto kPedestrian = typedObject->GetPedestrian(); + if ( kPedestrian) + { + ApplyPedestrianCheckerRules(messageLogger, kPedestrian, contextMode); + } + const auto kMiscObject = typedObject->GetMiscObject(); + if ( kMiscObject) + { + ApplyMiscObjectCheckerRules(messageLogger, kMiscObject, contextMode); + } + const auto kExternalObjectReference = typedObject->GetExternalObjectReference(); + if ( kExternalObjectReference) + { + ApplyExternalObjectReferenceCheckerRules(messageLogger, kExternalObjectReference, contextMode); + } + } + void ApplyEntityRefCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntityRef).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyEntitySelectionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEntitySelection).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kMembers = typedObject->GetMembers(); + if ( kMembers) + { + ApplySelectedEntitiesCheckerRules(messageLogger, kMembers, contextMode); + } + } + void ApplyEnvironmentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironment).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kTimeOfDay = typedObject->GetTimeOfDay(); + if ( kTimeOfDay) + { + ApplyTimeOfDayCheckerRules(messageLogger, kTimeOfDay, contextMode); + } + const auto kWeather = typedObject->GetWeather(); + if ( kWeather) + { + ApplyWeatherCheckerRules(messageLogger, kWeather, contextMode); + } + const auto kRoadCondition = typedObject->GetRoadCondition(); + if ( kRoadCondition) + { + ApplyRoadConditionCheckerRules(messageLogger, kRoadCondition, contextMode); + } + } + void ApplyEnvironmentActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironmentAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEnvironment = typedObject->GetEnvironment(); + if ( kEnvironment) + { + ApplyEnvironmentCheckerRules(messageLogger, kEnvironment, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + } + void ApplyEnvironmentCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEnvironmentCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyEventCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IEvent).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kActions = typedObject->GetActions(); + for(auto& kListItem: kActions) + { + if ( kListItem ) + ApplyActionCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kStartTrigger = typedObject->GetStartTrigger(); + if ( kStartTrigger) + { + ApplyTriggerCheckerRules(messageLogger, kStartTrigger, contextMode); + } + } + void ApplyExternalObjectReferenceCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IExternalObjectReference).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyFileCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFile).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyFileHeaderCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFileHeader).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLicense = typedObject->GetLicense(); + if ( kLicense) + { + ApplyLicenseCheckerRules(messageLogger, kLicense, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyFinalSpeedCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFinalSpeed).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAbsoluteSpeed = typedObject->GetAbsoluteSpeed(); + if ( kAbsoluteSpeed) + { + ApplyAbsoluteSpeedCheckerRules(messageLogger, kAbsoluteSpeed, contextMode); + } + const auto kRelativeSpeedToMaster = typedObject->GetRelativeSpeedToMaster(); + if ( kRelativeSpeedToMaster) + { + ApplyRelativeSpeedToMasterCheckerRules(messageLogger, kRelativeSpeedToMaster, contextMode); + } + } + void ApplyFogCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFog).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kBoundingBox = typedObject->GetBoundingBox(); + if ( kBoundingBox) + { + ApplyBoundingBoxCheckerRules(messageLogger, kBoundingBox, contextMode); + } + } + void ApplyFollowTrajectoryActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IFollowTrajectoryAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrajectory = typedObject->GetTrajectory(); + if ( kTrajectory) + { + ApplyTrajectoryCheckerRules(messageLogger, kTrajectory, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + const auto kTimeReference = typedObject->GetTimeReference(); + if ( kTimeReference) + { + ApplyTimeReferenceCheckerRules(messageLogger, kTimeReference, contextMode); + } + const auto kTrajectoryFollowingMode = typedObject->GetTrajectoryFollowingMode(); + if ( kTrajectoryFollowingMode) + { + ApplyTrajectoryFollowingModeCheckerRules(messageLogger, kTrajectoryFollowingMode, contextMode); + } + const auto kTrajectoryRef = typedObject->GetTrajectoryRef(); + if ( kTrajectoryRef) + { + ApplyTrajectoryRefCheckerRules(messageLogger, kTrajectoryRef, contextMode); + } + } + void ApplyGearCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGear).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kManualGear = typedObject->GetManualGear(); + if ( kManualGear) + { + ApplyManualGearCheckerRules(messageLogger, kManualGear, contextMode); + } + const auto kAutomaticGear = typedObject->GetAutomaticGear(); + if ( kAutomaticGear) + { + ApplyAutomaticGearCheckerRules(messageLogger, kAutomaticGear, contextMode); + } + } + void ApplyGeoPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGeoPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyGlobalActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IGlobalAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEnvironmentAction = typedObject->GetEnvironmentAction(); + if ( kEnvironmentAction) + { + ApplyEnvironmentActionCheckerRules(messageLogger, kEnvironmentAction, contextMode); + } + const auto kEntityAction = typedObject->GetEntityAction(); + if ( kEntityAction) + { + ApplyEntityActionCheckerRules(messageLogger, kEntityAction, contextMode); + } + const auto kInfrastructureAction = typedObject->GetInfrastructureAction(); + if ( kInfrastructureAction) + { + ApplyInfrastructureActionCheckerRules(messageLogger, kInfrastructureAction, contextMode); + } + const auto kSetMonitorAction = typedObject->GetSetMonitorAction(); + if ( kSetMonitorAction) + { + ApplySetMonitorActionCheckerRules(messageLogger, kSetMonitorAction, contextMode); + } + const auto kParameterAction = typedObject->GetParameterAction(); + if ( kParameterAction) + { + ApplyParameterActionCheckerRules(messageLogger, kParameterAction, contextMode); + } + const auto kTrafficAction = typedObject->GetTrafficAction(); + if ( kTrafficAction) + { + ApplyTrafficActionCheckerRules(messageLogger, kTrafficAction, contextMode); + } + const auto kVariableAction = typedObject->GetVariableAction(); + if ( kVariableAction) + { + ApplyVariableActionCheckerRules(messageLogger, kVariableAction, contextMode); + } + } + void ApplyHistogramCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IHistogram).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kBins = typedObject->GetBins(); + for(auto& kListItem: kBins) + { + if ( kListItem ) + ApplyHistogramBinCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyHistogramBinCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IHistogramBin).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyInRoutePositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInRoutePosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kFromCurrentEntity = typedObject->GetFromCurrentEntity(); + if ( kFromCurrentEntity) + { + ApplyPositionOfCurrentEntityCheckerRules(messageLogger, kFromCurrentEntity, contextMode); + } + const auto kFromRoadCoordinates = typedObject->GetFromRoadCoordinates(); + if ( kFromRoadCoordinates) + { + ApplyPositionInRoadCoordinatesCheckerRules(messageLogger, kFromRoadCoordinates, contextMode); + } + const auto kFromLaneCoordinates = typedObject->GetFromLaneCoordinates(); + if ( kFromLaneCoordinates) + { + ApplyPositionInLaneCoordinatesCheckerRules(messageLogger, kFromLaneCoordinates, contextMode); + } + } + void ApplyInfrastructureActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInfrastructureAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficSignalAction = typedObject->GetTrafficSignalAction(); + if ( kTrafficSignalAction) + { + ApplyTrafficSignalActionCheckerRules(messageLogger, kTrafficSignalAction, contextMode); + } + } + void ApplyInitCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInit).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kActions = typedObject->GetActions(); + if ( kActions) + { + ApplyInitActionsCheckerRules(messageLogger, kActions, contextMode); + } + } + void ApplyInitActionsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IInitActions).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kGlobalActions = typedObject->GetGlobalActions(); + for(auto& kListItem: kGlobalActions) + { + if ( kListItem ) + ApplyGlobalActionCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kUserDefinedActions = typedObject->GetUserDefinedActions(); + for(auto& kListItem: kUserDefinedActions) + { + if ( kListItem ) + ApplyUserDefinedActionCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kPrivates = typedObject->GetPrivates(); + for(auto& kListItem: kPrivates) + { + if ( kListItem ) + ApplyPrivateCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyKnotCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IKnot).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyLaneCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILane).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyLaneChangeActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneChangeAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLaneChangeActionDynamics = typedObject->GetLaneChangeActionDynamics(); + if ( kLaneChangeActionDynamics) + { + ApplyTransitionDynamicsCheckerRules(messageLogger, kLaneChangeActionDynamics, contextMode); + } + const auto kLaneChangeTarget = typedObject->GetLaneChangeTarget(); + if ( kLaneChangeTarget) + { + ApplyLaneChangeTargetCheckerRules(messageLogger, kLaneChangeTarget, contextMode); + } + } + void ApplyLaneChangeTargetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneChangeTarget).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRelativeTargetLane = typedObject->GetRelativeTargetLane(); + if ( kRelativeTargetLane) + { + ApplyRelativeTargetLaneCheckerRules(messageLogger, kRelativeTargetLane, contextMode); + } + const auto kAbsoluteTargetLane = typedObject->GetAbsoluteTargetLane(); + if ( kAbsoluteTargetLane) + { + ApplyAbsoluteTargetLaneCheckerRules(messageLogger, kAbsoluteTargetLane, contextMode); + } + } + void ApplyLaneOffsetActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLaneOffsetActionDynamics = typedObject->GetLaneOffsetActionDynamics(); + if ( kLaneOffsetActionDynamics) + { + ApplyLaneOffsetActionDynamicsCheckerRules(messageLogger, kLaneOffsetActionDynamics, contextMode); + } + const auto kLaneOffsetTarget = typedObject->GetLaneOffsetTarget(); + if ( kLaneOffsetTarget) + { + ApplyLaneOffsetTargetCheckerRules(messageLogger, kLaneOffsetTarget, contextMode); + } + } + void ApplyLaneOffsetActionDynamicsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetActionDynamics).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyLaneOffsetTargetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILaneOffsetTarget).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRelativeTargetLaneOffset = typedObject->GetRelativeTargetLaneOffset(); + if ( kRelativeTargetLaneOffset) + { + ApplyRelativeTargetLaneOffsetCheckerRules(messageLogger, kRelativeTargetLaneOffset, contextMode); + } + const auto kAbsoluteTargetLaneOffset = typedObject->GetAbsoluteTargetLaneOffset(); + if ( kAbsoluteTargetLaneOffset) + { + ApplyAbsoluteTargetLaneOffsetCheckerRules(messageLogger, kAbsoluteTargetLaneOffset, contextMode); + } + } + void ApplyLanePositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILanePosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyLateralActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILateralAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLaneChangeAction = typedObject->GetLaneChangeAction(); + if ( kLaneChangeAction) + { + ApplyLaneChangeActionCheckerRules(messageLogger, kLaneChangeAction, contextMode); + } + const auto kLaneOffsetAction = typedObject->GetLaneOffsetAction(); + if ( kLaneOffsetAction) + { + ApplyLaneOffsetActionCheckerRules(messageLogger, kLaneOffsetAction, contextMode); + } + const auto kLateralDistanceAction = typedObject->GetLateralDistanceAction(); + if ( kLateralDistanceAction) + { + ApplyLateralDistanceActionCheckerRules(messageLogger, kLateralDistanceAction, contextMode); + } + } + void ApplyLateralDistanceActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILateralDistanceAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDynamicConstraints = typedObject->GetDynamicConstraints(); + if ( kDynamicConstraints) + { + ApplyDynamicConstraintsCheckerRules(messageLogger, kDynamicConstraints, contextMode); + } + } + void ApplyLicenseCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILicense).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyLightStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kColor = typedObject->GetColor(); + if ( kColor) + { + ApplyColorCheckerRules(messageLogger, kColor, contextMode); + } + } + void ApplyLightStateActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightStateAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLightType = typedObject->GetLightType(); + if ( kLightType) + { + ApplyLightTypeCheckerRules(messageLogger, kLightType, contextMode); + } + const auto kLightState = typedObject->GetLightState(); + if ( kLightState) + { + ApplyLightStateCheckerRules(messageLogger, kLightState, contextMode); + } + } + void ApplyLightTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILightType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleLight = typedObject->GetVehicleLight(); + if ( kVehicleLight) + { + ApplyVehicleLightCheckerRules(messageLogger, kVehicleLight, contextMode); + } + const auto kUserDefinedLight = typedObject->GetUserDefinedLight(); + if ( kUserDefinedLight) + { + ApplyUserDefinedLightCheckerRules(messageLogger, kUserDefinedLight, contextMode); + } + } + void ApplyLogNormalDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILogNormalDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyLongitudinalActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILongitudinalAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSpeedAction = typedObject->GetSpeedAction(); + if ( kSpeedAction) + { + ApplySpeedActionCheckerRules(messageLogger, kSpeedAction, contextMode); + } + const auto kLongitudinalDistanceAction = typedObject->GetLongitudinalDistanceAction(); + if ( kLongitudinalDistanceAction) + { + ApplyLongitudinalDistanceActionCheckerRules(messageLogger, kLongitudinalDistanceAction, contextMode); + } + const auto kSpeedProfileAction = typedObject->GetSpeedProfileAction(); + if ( kSpeedProfileAction) + { + ApplySpeedProfileActionCheckerRules(messageLogger, kSpeedProfileAction, contextMode); + } + } + void ApplyLongitudinalDistanceActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ILongitudinalDistanceAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDynamicConstraints = typedObject->GetDynamicConstraints(); + if ( kDynamicConstraints) + { + ApplyDynamicConstraintsCheckerRules(messageLogger, kDynamicConstraints, contextMode); + } + } + void ApplyManeuverCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuver).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kEvents = typedObject->GetEvents(); + for(auto& kListItem: kEvents) + { + if ( kListItem ) + ApplyEventCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyManeuverCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuverCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyManeuverGroupCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManeuverGroup).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kActors = typedObject->GetActors(); + if ( kActors) + { + ApplyActorsCheckerRules(messageLogger, kActors, contextMode); + } + const auto kCatalogReferences = typedObject->GetCatalogReferences(); + for(auto& kListItem: kCatalogReferences) + { + if ( kListItem ) + ApplyCatalogReferenceCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kManeuvers = typedObject->GetManeuvers(); + for(auto& kListItem: kManeuvers) + { + if ( kListItem ) + ApplyManeuverCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyManualGearCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IManualGear).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyMiscObjectCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMiscObject).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kBoundingBox = typedObject->GetBoundingBox(); + if ( kBoundingBox) + { + ApplyBoundingBoxCheckerRules(messageLogger, kBoundingBox, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyMiscObjectCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMiscObjectCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyModifyRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IModifyRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAddValue = typedObject->GetAddValue(); + if ( kAddValue) + { + ApplyParameterAddValueRuleCheckerRules(messageLogger, kAddValue, contextMode); + } + const auto kMultiplyByValue = typedObject->GetMultiplyByValue(); + if ( kMultiplyByValue) + { + ApplyParameterMultiplyByValueRuleCheckerRules(messageLogger, kMultiplyByValue, contextMode); + } + } + void ApplyMonitorDeclarationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IMonitorDeclaration).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyNoneCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INone).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyNormalDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INormalDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyNurbsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(INurbs).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kControlPoints = typedObject->GetControlPoints(); + for(auto& kListItem: kControlPoints) + { + if ( kListItem ) + ApplyControlPointCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kKnots = typedObject->GetKnots(); + for(auto& kListItem: kKnots) + { + if ( kListItem ) + ApplyKnotCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyObjectControllerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IObjectController).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + const auto kController = typedObject->GetController(); + if ( kController) + { + ApplyControllerCheckerRules(messageLogger, kController, contextMode); + } + } + void ApplyOffroadConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOffroadCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyOpenScenarioCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOpenScenario).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kFileHeader = typedObject->GetFileHeader(); + if ( kFileHeader) + { + ApplyFileHeaderCheckerRules(messageLogger, kFileHeader, contextMode); + } + const auto kOpenScenarioCategory = typedObject->GetOpenScenarioCategory(); + if ( kOpenScenarioCategory) + { + ApplyOpenScenarioCategoryCheckerRules(messageLogger, kOpenScenarioCategory, contextMode); + } + } + void ApplyOpenScenarioCategoryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOpenScenarioCategory).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kScenarioDefinition = typedObject->GetScenarioDefinition(); + if ( kScenarioDefinition) + { + ApplyScenarioDefinitionCheckerRules(messageLogger, kScenarioDefinition, contextMode); + } + const auto kCatalogDefinition = typedObject->GetCatalogDefinition(); + if ( kCatalogDefinition) + { + ApplyCatalogDefinitionCheckerRules(messageLogger, kCatalogDefinition, contextMode); + } + const auto kParameterValueDistributionDefinition = typedObject->GetParameterValueDistributionDefinition(); + if ( kParameterValueDistributionDefinition) + { + ApplyParameterValueDistributionDefinitionCheckerRules(messageLogger, kParameterValueDistributionDefinition, contextMode); + } + } + void ApplyOrientationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOrientation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyOverrideBrakeActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideBrakeAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kBrakeInput = typedObject->GetBrakeInput(); + if ( kBrakeInput) + { + ApplyBrakeInputCheckerRules(messageLogger, kBrakeInput, contextMode); + } + } + void ApplyOverrideClutchActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideClutchAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyOverrideControllerValueActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideControllerValueAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kThrottle = typedObject->GetThrottle(); + if ( kThrottle) + { + ApplyOverrideThrottleActionCheckerRules(messageLogger, kThrottle, contextMode); + } + const auto kBrake = typedObject->GetBrake(); + if ( kBrake) + { + ApplyOverrideBrakeActionCheckerRules(messageLogger, kBrake, contextMode); + } + const auto kClutch = typedObject->GetClutch(); + if ( kClutch) + { + ApplyOverrideClutchActionCheckerRules(messageLogger, kClutch, contextMode); + } + const auto kParkingBrake = typedObject->GetParkingBrake(); + if ( kParkingBrake) + { + ApplyOverrideParkingBrakeActionCheckerRules(messageLogger, kParkingBrake, contextMode); + } + const auto kSteeringWheel = typedObject->GetSteeringWheel(); + if ( kSteeringWheel) + { + ApplyOverrideSteeringWheelActionCheckerRules(messageLogger, kSteeringWheel, contextMode); + } + const auto kGear = typedObject->GetGear(); + if ( kGear) + { + ApplyOverrideGearActionCheckerRules(messageLogger, kGear, contextMode); + } + } + void ApplyOverrideGearActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideGearAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kGear = typedObject->GetGear(); + if ( kGear) + { + ApplyGearCheckerRules(messageLogger, kGear, contextMode); + } + } + void ApplyOverrideParkingBrakeActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideParkingBrakeAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kBrakeInput = typedObject->GetBrakeInput(); + if ( kBrakeInput) + { + ApplyBrakeInputCheckerRules(messageLogger, kBrakeInput, contextMode); + } + } + void ApplyOverrideSteeringWheelActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideSteeringWheelAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyOverrideThrottleActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IOverrideThrottleAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSetAction = typedObject->GetSetAction(); + if ( kSetAction) + { + ApplyParameterSetActionCheckerRules(messageLogger, kSetAction, contextMode); + } + const auto kModifyAction = typedObject->GetModifyAction(); + if ( kModifyAction) + { + ApplyParameterModifyActionCheckerRules(messageLogger, kModifyAction, contextMode); + } + } + void ApplyParameterAddValueRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAddValueRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterAssignmentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterAssignment).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterDeclarationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterDeclaration).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kConstraintGroups = typedObject->GetConstraintGroups(); + for(auto& kListItem: kConstraintGroups) + { + if ( kListItem ) + ApplyValueConstraintGroupCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyParameterModifyActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterModifyAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRule = typedObject->GetRule(); + if ( kRule) + { + ApplyModifyRuleCheckerRules(messageLogger, kRule, contextMode); + } + } + void ApplyParameterMultiplyByValueRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterMultiplyByValueRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterSetActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterSetAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyParameterValueDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kScenarioFile = typedObject->GetScenarioFile(); + if ( kScenarioFile) + { + ApplyFileCheckerRules(messageLogger, kScenarioFile, contextMode); + } + const auto kDistributionDefinition = typedObject->GetDistributionDefinition(); + if ( kDistributionDefinition) + { + ApplyDistributionDefinitionCheckerRules(messageLogger, kDistributionDefinition, contextMode); + } + } + void ApplyParameterValueDistributionDefinitionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueDistributionDefinition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterValueDistribution = typedObject->GetParameterValueDistribution(); + if ( kParameterValueDistribution) + { + ApplyParameterValueDistributionCheckerRules(messageLogger, kParameterValueDistribution, contextMode); + } + } + void ApplyParameterValueSetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IParameterValueSet).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterAssignments = typedObject->GetParameterAssignments(); + for(auto& kListItem: kParameterAssignments) + { + if ( kListItem ) + ApplyParameterAssignmentCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPedestrianCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrian).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kBoundingBox = typedObject->GetBoundingBox(); + if ( kBoundingBox) + { + ApplyBoundingBoxCheckerRules(messageLogger, kBoundingBox, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyPedestrianAnimationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianAnimation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kGestures = typedObject->GetGestures(); + for(auto& kListItem: kGestures) + { + if ( kListItem ) + ApplyPedestrianGestureCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPedestrianCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyPedestrianGestureCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPedestrianGesture).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPerformanceCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPerformance).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPhaseCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPhase).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficSignalStates = typedObject->GetTrafficSignalStates(); + for(auto& kListItem: kTrafficSignalStates) + { + if ( kListItem ) + ApplyTrafficSignalStateCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kTrafficSignalGroupState = typedObject->GetTrafficSignalGroupState(); + if ( kTrafficSignalGroupState) + { + ApplyTrafficSignalGroupStateCheckerRules(messageLogger, kTrafficSignalGroupState, contextMode); + } + } + void ApplyPoissonDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPoissonDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyPolygonCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPolygon).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPositions = typedObject->GetPositions(); + for(auto& kListItem: kPositions) + { + if ( kListItem ) + ApplyPositionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPolylineCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPolyline).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVertices = typedObject->GetVertices(); + for(auto& kListItem: kVertices) + { + if ( kListItem ) + ApplyVertexCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kWorldPosition = typedObject->GetWorldPosition(); + if ( kWorldPosition) + { + ApplyWorldPositionCheckerRules(messageLogger, kWorldPosition, contextMode); + } + const auto kRelativeWorldPosition = typedObject->GetRelativeWorldPosition(); + if ( kRelativeWorldPosition) + { + ApplyRelativeWorldPositionCheckerRules(messageLogger, kRelativeWorldPosition, contextMode); + } + const auto kRelativeObjectPosition = typedObject->GetRelativeObjectPosition(); + if ( kRelativeObjectPosition) + { + ApplyRelativeObjectPositionCheckerRules(messageLogger, kRelativeObjectPosition, contextMode); + } + const auto kRoadPosition = typedObject->GetRoadPosition(); + if ( kRoadPosition) + { + ApplyRoadPositionCheckerRules(messageLogger, kRoadPosition, contextMode); + } + const auto kRelativeRoadPosition = typedObject->GetRelativeRoadPosition(); + if ( kRelativeRoadPosition) + { + ApplyRelativeRoadPositionCheckerRules(messageLogger, kRelativeRoadPosition, contextMode); + } + const auto kLanePosition = typedObject->GetLanePosition(); + if ( kLanePosition) + { + ApplyLanePositionCheckerRules(messageLogger, kLanePosition, contextMode); + } + const auto kRelativeLanePosition = typedObject->GetRelativeLanePosition(); + if ( kRelativeLanePosition) + { + ApplyRelativeLanePositionCheckerRules(messageLogger, kRelativeLanePosition, contextMode); + } + const auto kRoutePosition = typedObject->GetRoutePosition(); + if ( kRoutePosition) + { + ApplyRoutePositionCheckerRules(messageLogger, kRoutePosition, contextMode); + } + const auto kGeoPosition = typedObject->GetGeoPosition(); + if ( kGeoPosition) + { + ApplyGeoPositionCheckerRules(messageLogger, kGeoPosition, contextMode); + } + const auto kTrajectoryPosition = typedObject->GetTrajectoryPosition(); + if ( kTrajectoryPosition) + { + ApplyTrajectoryPositionCheckerRules(messageLogger, kTrajectoryPosition, contextMode); + } + } + void ApplyPositionInLaneCoordinatesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionInLaneCoordinates).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPositionInRoadCoordinatesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionInRoadCoordinates).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPositionOfCurrentEntityCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPositionOfCurrentEntity).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPrecipitationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrecipitation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPrivateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrivate).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPrivateActions = typedObject->GetPrivateActions(); + for(auto& kListItem: kPrivateActions) + { + if ( kListItem ) + ApplyPrivateActionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPrivateActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IPrivateAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLongitudinalAction = typedObject->GetLongitudinalAction(); + if ( kLongitudinalAction) + { + ApplyLongitudinalActionCheckerRules(messageLogger, kLongitudinalAction, contextMode); + } + const auto kLateralAction = typedObject->GetLateralAction(); + if ( kLateralAction) + { + ApplyLateralActionCheckerRules(messageLogger, kLateralAction, contextMode); + } + const auto kVisibilityAction = typedObject->GetVisibilityAction(); + if ( kVisibilityAction) + { + ApplyVisibilityActionCheckerRules(messageLogger, kVisibilityAction, contextMode); + } + const auto kSynchronizeAction = typedObject->GetSynchronizeAction(); + if ( kSynchronizeAction) + { + ApplySynchronizeActionCheckerRules(messageLogger, kSynchronizeAction, contextMode); + } + const auto kActivateControllerAction = typedObject->GetActivateControllerAction(); + if ( kActivateControllerAction) + { + ApplyActivateControllerActionCheckerRules(messageLogger, kActivateControllerAction, contextMode); + } + const auto kControllerAction = typedObject->GetControllerAction(); + if ( kControllerAction) + { + ApplyControllerActionCheckerRules(messageLogger, kControllerAction, contextMode); + } + const auto kTeleportAction = typedObject->GetTeleportAction(); + if ( kTeleportAction) + { + ApplyTeleportActionCheckerRules(messageLogger, kTeleportAction, contextMode); + } + const auto kRoutingAction = typedObject->GetRoutingAction(); + if ( kRoutingAction) + { + ApplyRoutingActionCheckerRules(messageLogger, kRoutingAction, contextMode); + } + const auto kAppearanceAction = typedObject->GetAppearanceAction(); + if ( kAppearanceAction) + { + ApplyAppearanceActionCheckerRules(messageLogger, kAppearanceAction, contextMode); + } + const auto kTrailerAction = typedObject->GetTrailerAction(); + if ( kTrailerAction) + { + ApplyTrailerActionCheckerRules(messageLogger, kTrailerAction, contextMode); + } + } + void ApplyProbabilityDistributionSetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProbabilityDistributionSet).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kElements = typedObject->GetElements(); + for(auto& kListItem: kElements) + { + if ( kListItem ) + ApplyProbabilityDistributionSetElementCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyProbabilityDistributionSetElementCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProbabilityDistributionSetElement).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyPropertiesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProperties).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kProperties = typedObject->GetProperties(); + for(auto& kListItem: kProperties) + { + if ( kListItem ) + ApplyPropertyCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kFiles = typedObject->GetFiles(); + for(auto& kListItem: kFiles) + { + if ( kListItem ) + ApplyFileCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kCustomContent = typedObject->GetCustomContent(); + for(auto& kListItem: kCustomContent) + { + if ( kListItem ) + ApplyCustomContentCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyPropertyCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IProperty).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRandomRouteActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRandomRouteAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRangeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRange).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyReachPositionConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IReachPositionCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyRelativeAngleConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeAngleCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeClearanceConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeClearanceCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRelativeLaneRange = typedObject->GetRelativeLaneRange(); + for(auto& kListItem: kRelativeLaneRange) + { + if ( kListItem ) + ApplyRelativeLaneRangeCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kEntityRef = typedObject->GetEntityRef(); + for(auto& kListItem: kEntityRef) + { + if ( kListItem ) + ApplyEntityRefCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyRelativeDistanceConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeDistanceCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeLanePositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeLanePosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyRelativeLaneRangeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeLaneRange).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeObjectPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeObjectPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyRelativeRoadPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeRoadPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyRelativeSpeedConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeSpeedCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeSpeedToMasterCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeSpeedToMaster).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSteadyState = typedObject->GetSteadyState(); + if ( kSteadyState) + { + ApplySteadyStateCheckerRules(messageLogger, kSteadyState, contextMode); + } + } + void ApplyRelativeTargetLaneCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetLane).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeTargetLaneOffsetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetLaneOffset).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeTargetSpeedCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeTargetSpeed).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyRelativeWorldPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRelativeWorldPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyRoadConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyRoadCursorCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadCursor).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLane = typedObject->GetLane(); + for(auto& kListItem: kLane) + { + if ( kListItem ) + ApplyLaneCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyRoadNetworkCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadNetwork).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kLogicFile = typedObject->GetLogicFile(); + if ( kLogicFile) + { + ApplyFileCheckerRules(messageLogger, kLogicFile, contextMode); + } + const auto kSceneGraphFile = typedObject->GetSceneGraphFile(); + if ( kSceneGraphFile) + { + ApplyFileCheckerRules(messageLogger, kSceneGraphFile, contextMode); + } + const auto kTrafficSignals = typedObject->GetTrafficSignals(); + for(auto& kListItem: kTrafficSignals) + { + if ( kListItem ) + ApplyTrafficSignalControllerCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kUsedArea = typedObject->GetUsedArea(); + if ( kUsedArea) + { + ApplyUsedAreaCheckerRules(messageLogger, kUsedArea, contextMode); + } + } + void ApplyRoadPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + } + void ApplyRoadRangeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoadRange).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRoadCursor = typedObject->GetRoadCursor(); + for(auto& kListItem: kRoadCursor) + { + if ( kListItem ) + ApplyRoadCursorCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyRouteCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoute).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kWaypoints = typedObject->GetWaypoints(); + for(auto& kListItem: kWaypoints) + { + if ( kListItem ) + ApplyWaypointCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyRouteCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRouteCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyRoutePositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoutePosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRouteRef = typedObject->GetRouteRef(); + if ( kRouteRef) + { + ApplyRouteRefCheckerRules(messageLogger, kRouteRef, contextMode); + } + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + const auto kInRoutePosition = typedObject->GetInRoutePosition(); + if ( kInRoutePosition) + { + ApplyInRoutePositionCheckerRules(messageLogger, kInRoutePosition, contextMode); + } + } + void ApplyRouteRefCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRouteRef).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRoute = typedObject->GetRoute(); + if ( kRoute) + { + ApplyRouteCheckerRules(messageLogger, kRoute, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + } + void ApplyRoutingActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IRoutingAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAssignRouteAction = typedObject->GetAssignRouteAction(); + if ( kAssignRouteAction) + { + ApplyAssignRouteActionCheckerRules(messageLogger, kAssignRouteAction, contextMode); + } + const auto kFollowTrajectoryAction = typedObject->GetFollowTrajectoryAction(); + if ( kFollowTrajectoryAction) + { + ApplyFollowTrajectoryActionCheckerRules(messageLogger, kFollowTrajectoryAction, contextMode); + } + const auto kAcquirePositionAction = typedObject->GetAcquirePositionAction(); + if ( kAcquirePositionAction) + { + ApplyAcquirePositionActionCheckerRules(messageLogger, kAcquirePositionAction, contextMode); + } + const auto kRandomRouteAction = typedObject->GetRandomRouteAction(); + if ( kRandomRouteAction) + { + ApplyRandomRouteActionCheckerRules(messageLogger, kRandomRouteAction, contextMode); + } + } + void ApplyScenarioDefinitionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioDefinition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kVariableDeclarations = typedObject->GetVariableDeclarations(); + for(auto& kListItem: kVariableDeclarations) + { + if ( kListItem ) + ApplyVariableDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kMonitorDeclarations = typedObject->GetMonitorDeclarations(); + for(auto& kListItem: kMonitorDeclarations) + { + if ( kListItem ) + ApplyMonitorDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kCatalogLocations = typedObject->GetCatalogLocations(); + if ( kCatalogLocations) + { + ApplyCatalogLocationsCheckerRules(messageLogger, kCatalogLocations, contextMode); + } + const auto kRoadNetwork = typedObject->GetRoadNetwork(); + if ( kRoadNetwork) + { + ApplyRoadNetworkCheckerRules(messageLogger, kRoadNetwork, contextMode); + } + const auto kEntities = typedObject->GetEntities(); + if ( kEntities) + { + ApplyEntitiesCheckerRules(messageLogger, kEntities, contextMode); + } + const auto kStoryboard = typedObject->GetStoryboard(); + if ( kStoryboard) + { + ApplyStoryboardCheckerRules(messageLogger, kStoryboard, contextMode); + } + } + void ApplyScenarioObjectCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioObject).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityObject = typedObject->GetEntityObject(); + if ( kEntityObject) + { + ApplyEntityObjectCheckerRules(messageLogger, kEntityObject, contextMode); + } + const auto kObjectController = typedObject->GetObjectController(); + for(auto& kListItem: kObjectController) + { + if ( kListItem ) + ApplyObjectControllerCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyScenarioObjectTemplateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IScenarioObjectTemplate).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntitiyObject = typedObject->GetEntitiyObject(); + if ( kEntitiyObject) + { + ApplyEntityObjectCheckerRules(messageLogger, kEntitiyObject, contextMode); + } + const auto kObjectController = typedObject->GetObjectController(); + for(auto& kListItem: kObjectController) + { + if ( kListItem ) + ApplyObjectControllerCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplySelectedEntitiesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISelectedEntities).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityRef = typedObject->GetEntityRef(); + for(auto& kListItem: kEntityRef) + { + if ( kListItem ) + ApplyEntityRefCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kByType = typedObject->GetByType(); + for(auto& kListItem: kByType) + { + if ( kListItem ) + ApplyByTypeCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplySensorReferenceCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISensorReference).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySensorReferenceSetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISensorReferenceSet).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSensorReferences = typedObject->GetSensorReferences(); + for(auto& kListItem: kSensorReferences) + { + if ( kListItem ) + ApplySensorReferenceCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplySetMonitorActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISetMonitorAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyShapeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IShape).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPolyline = typedObject->GetPolyline(); + if ( kPolyline) + { + ApplyPolylineCheckerRules(messageLogger, kPolyline, contextMode); + } + const auto kClothoid = typedObject->GetClothoid(); + if ( kClothoid) + { + ApplyClothoidCheckerRules(messageLogger, kClothoid, contextMode); + } + const auto kClothoidSpline = typedObject->GetClothoidSpline(); + if ( kClothoidSpline) + { + ApplyClothoidSplineCheckerRules(messageLogger, kClothoidSpline, contextMode); + } + const auto kNurbs = typedObject->GetNurbs(); + if ( kNurbs) + { + ApplyNurbsCheckerRules(messageLogger, kNurbs, contextMode); + } + } + void ApplySimulationTimeConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISimulationTimeCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySpeedActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSpeedActionDynamics = typedObject->GetSpeedActionDynamics(); + if ( kSpeedActionDynamics) + { + ApplyTransitionDynamicsCheckerRules(messageLogger, kSpeedActionDynamics, contextMode); + } + const auto kSpeedActionTarget = typedObject->GetSpeedActionTarget(); + if ( kSpeedActionTarget) + { + ApplySpeedActionTargetCheckerRules(messageLogger, kSpeedActionTarget, contextMode); + } + } + void ApplySpeedActionTargetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedActionTarget).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRelativeTargetSpeed = typedObject->GetRelativeTargetSpeed(); + if ( kRelativeTargetSpeed) + { + ApplyRelativeTargetSpeedCheckerRules(messageLogger, kRelativeTargetSpeed, contextMode); + } + const auto kAbsoluteTargetSpeed = typedObject->GetAbsoluteTargetSpeed(); + if ( kAbsoluteTargetSpeed) + { + ApplyAbsoluteTargetSpeedCheckerRules(messageLogger, kAbsoluteTargetSpeed, contextMode); + } + } + void ApplySpeedConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySpeedProfileActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedProfileAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDynamicConstraints = typedObject->GetDynamicConstraints(); + if ( kDynamicConstraints) + { + ApplyDynamicConstraintsCheckerRules(messageLogger, kDynamicConstraints, contextMode); + } + const auto kSpeedProfileEntry = typedObject->GetSpeedProfileEntry(); + for(auto& kListItem: kSpeedProfileEntry) + { + if ( kListItem ) + ApplySpeedProfileEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplySpeedProfileEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISpeedProfileEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyStandStillConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStandStillCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySteadyStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISteadyState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTargetDistanceSteadyState = typedObject->GetTargetDistanceSteadyState(); + if ( kTargetDistanceSteadyState) + { + ApplyTargetDistanceSteadyStateCheckerRules(messageLogger, kTargetDistanceSteadyState, contextMode); + } + const auto kTargetTimeSteadyState = typedObject->GetTargetTimeSteadyState(); + if ( kTargetTimeSteadyState) + { + ApplyTargetTimeSteadyStateCheckerRules(messageLogger, kTargetTimeSteadyState, contextMode); + } + } + void ApplyStochasticCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochastic).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kStochasticDistributions = typedObject->GetStochasticDistributions(); + for(auto& kListItem: kStochasticDistributions) + { + if ( kListItem ) + ApplyStochasticDistributionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyStochasticDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochasticDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kStochasticDistributionType = typedObject->GetStochasticDistributionType(); + if ( kStochasticDistributionType) + { + ApplyStochasticDistributionTypeCheckerRules(messageLogger, kStochasticDistributionType, contextMode); + } + } + void ApplyStochasticDistributionTypeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStochasticDistributionType).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kProbabilityDistributionSet = typedObject->GetProbabilityDistributionSet(); + if ( kProbabilityDistributionSet) + { + ApplyProbabilityDistributionSetCheckerRules(messageLogger, kProbabilityDistributionSet, contextMode); + } + const auto kNormalDistribution = typedObject->GetNormalDistribution(); + if ( kNormalDistribution) + { + ApplyNormalDistributionCheckerRules(messageLogger, kNormalDistribution, contextMode); + } + const auto kLogNormalDistribution = typedObject->GetLogNormalDistribution(); + if ( kLogNormalDistribution) + { + ApplyLogNormalDistributionCheckerRules(messageLogger, kLogNormalDistribution, contextMode); + } + const auto kUniformDistribution = typedObject->GetUniformDistribution(); + if ( kUniformDistribution) + { + ApplyUniformDistributionCheckerRules(messageLogger, kUniformDistribution, contextMode); + } + const auto kPoissonDistribution = typedObject->GetPoissonDistribution(); + if ( kPoissonDistribution) + { + ApplyPoissonDistributionCheckerRules(messageLogger, kPoissonDistribution, contextMode); + } + const auto kHistogram = typedObject->GetHistogram(); + if ( kHistogram) + { + ApplyHistogramCheckerRules(messageLogger, kHistogram, contextMode); + } + const auto kUserDefinedDistribution = typedObject->GetUserDefinedDistribution(); + if ( kUserDefinedDistribution) + { + ApplyUserDefinedDistributionCheckerRules(messageLogger, kUserDefinedDistribution, contextMode); + } + } + void ApplyStoryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStory).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kActs = typedObject->GetActs(); + for(auto& kListItem: kActs) + { + if ( kListItem ) + ApplyActCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyStoryboardCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStoryboard).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kInit = typedObject->GetInit(); + if ( kInit) + { + ApplyInitCheckerRules(messageLogger, kInit, contextMode); + } + const auto kStories = typedObject->GetStories(); + for(auto& kListItem: kStories) + { + if ( kListItem ) + ApplyStoryCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kStopTrigger = typedObject->GetStopTrigger(); + if ( kStopTrigger) + { + ApplyTriggerCheckerRules(messageLogger, kStopTrigger, contextMode); + } + } + void ApplyStoryboardElementStateConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IStoryboardElementStateCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySunCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISun).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplySynchronizeActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ISynchronizeAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTargetPositionMaster = typedObject->GetTargetPositionMaster(); + if ( kTargetPositionMaster) + { + ApplyPositionCheckerRules(messageLogger, kTargetPositionMaster, contextMode); + } + const auto kTargetPosition = typedObject->GetTargetPosition(); + if ( kTargetPosition) + { + ApplyPositionCheckerRules(messageLogger, kTargetPosition, contextMode); + } + const auto kFinalSpeed = typedObject->GetFinalSpeed(); + if ( kFinalSpeed) + { + ApplyFinalSpeedCheckerRules(messageLogger, kFinalSpeed, contextMode); + } + } + void ApplyTargetDistanceSteadyStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITargetDistanceSteadyState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTargetTimeSteadyStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITargetTimeSteadyState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTeleportActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITeleportAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyTimeHeadwayConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeHeadwayCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTimeOfDayCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeOfDay).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTimeOfDayConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeOfDayCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTimeReferenceCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeReference).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kNone = typedObject->GetNone(); + if ( kNone) + { + ApplyNoneCheckerRules(messageLogger, kNone, contextMode); + } + const auto kTiming = typedObject->GetTiming(); + if ( kTiming) + { + ApplyTimingCheckerRules(messageLogger, kTiming, contextMode); + } + } + void ApplyTimeToCollisionConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeToCollisionCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTimeToCollisionConditionTarget = typedObject->GetTimeToCollisionConditionTarget(); + if ( kTimeToCollisionConditionTarget) + { + ApplyTimeToCollisionConditionTargetCheckerRules(messageLogger, kTimeToCollisionConditionTarget, contextMode); + } + } + void ApplyTimeToCollisionConditionTargetCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITimeToCollisionConditionTarget).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + const auto kEntityRef = typedObject->GetEntityRef(); + if ( kEntityRef) + { + ApplyEntityRefCheckerRules(messageLogger, kEntityRef, contextMode); + } + } + void ApplyTimingCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITiming).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficSourceAction = typedObject->GetTrafficSourceAction(); + if ( kTrafficSourceAction) + { + ApplyTrafficSourceActionCheckerRules(messageLogger, kTrafficSourceAction, contextMode); + } + const auto kTrafficSinkAction = typedObject->GetTrafficSinkAction(); + if ( kTrafficSinkAction) + { + ApplyTrafficSinkActionCheckerRules(messageLogger, kTrafficSinkAction, contextMode); + } + const auto kTrafficSwarmAction = typedObject->GetTrafficSwarmAction(); + if ( kTrafficSwarmAction) + { + ApplyTrafficSwarmActionCheckerRules(messageLogger, kTrafficSwarmAction, contextMode); + } + const auto kTrafficAreaAction = typedObject->GetTrafficAreaAction(); + if ( kTrafficAreaAction) + { + ApplyTrafficAreaActionCheckerRules(messageLogger, kTrafficAreaAction, contextMode); + } + const auto kTrafficStopAction = typedObject->GetTrafficStopAction(); + if ( kTrafficStopAction) + { + ApplyTrafficStopActionCheckerRules(messageLogger, kTrafficStopAction, contextMode); + } + } + void ApplyTrafficAreaCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficArea).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPolygon = typedObject->GetPolygon(); + if ( kPolygon) + { + ApplyPolygonCheckerRules(messageLogger, kPolygon, contextMode); + } + const auto kRoadRange = typedObject->GetRoadRange(); + for(auto& kListItem: kRoadRange) + { + if ( kListItem ) + ApplyRoadRangeCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyTrafficAreaActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficAreaAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficDistribution = typedObject->GetTrafficDistribution(); + if ( kTrafficDistribution) + { + ApplyTrafficDistributionCheckerRules(messageLogger, kTrafficDistribution, contextMode); + } + const auto kTrafficArea = typedObject->GetTrafficArea(); + if ( kTrafficArea) + { + ApplyTrafficAreaCheckerRules(messageLogger, kTrafficArea, contextMode); + } + } + void ApplyTrafficDefinitionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDefinition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleCategoryDistribution = typedObject->GetVehicleCategoryDistribution(); + if ( kVehicleCategoryDistribution) + { + ApplyVehicleCategoryDistributionCheckerRules(messageLogger, kVehicleCategoryDistribution, contextMode); + } + const auto kVehicleRoleDistribution = typedObject->GetVehicleRoleDistribution(); + if ( kVehicleRoleDistribution) + { + ApplyVehicleRoleDistributionCheckerRules(messageLogger, kVehicleRoleDistribution, contextMode); + } + const auto kControllerDistribution = typedObject->GetControllerDistribution(); + if ( kControllerDistribution) + { + ApplyControllerDistributionCheckerRules(messageLogger, kControllerDistribution, contextMode); + } + } + void ApplyTrafficDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficDistributionEntry = typedObject->GetTrafficDistributionEntry(); + for(auto& kListItem: kTrafficDistributionEntry) + { + if ( kListItem ) + ApplyTrafficDistributionEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyTrafficDistributionEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficDistributionEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityDistribution = typedObject->GetEntityDistribution(); + if ( kEntityDistribution) + { + ApplyEntityDistributionCheckerRules(messageLogger, kEntityDistribution, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + } + void ApplyTrafficSignalActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrafficSignalControllerAction = typedObject->GetTrafficSignalControllerAction(); + if ( kTrafficSignalControllerAction) + { + ApplyTrafficSignalControllerActionCheckerRules(messageLogger, kTrafficSignalControllerAction, contextMode); + } + const auto kTrafficSignalStateAction = typedObject->GetTrafficSignalStateAction(); + if ( kTrafficSignalStateAction) + { + ApplyTrafficSignalStateActionCheckerRules(messageLogger, kTrafficSignalStateAction, contextMode); + } + } + void ApplyTrafficSignalConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSignalControllerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalController).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPhases = typedObject->GetPhases(); + for(auto& kListItem: kPhases) + { + if ( kListItem ) + ApplyPhaseCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyTrafficSignalControllerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalControllerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSignalControllerConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalControllerCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSignalGroupStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalGroupState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSignalStateCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalState).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSignalStateActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSignalStateAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSinkActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSinkAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + const auto kTrafficDefinition = typedObject->GetTrafficDefinition(); + if ( kTrafficDefinition) + { + ApplyTrafficDefinitionCheckerRules(messageLogger, kTrafficDefinition, contextMode); + } + } + void ApplyTrafficSourceActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSourceAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + const auto kTrafficDefinition = typedObject->GetTrafficDefinition(); + if ( kTrafficDefinition) + { + ApplyTrafficDefinitionCheckerRules(messageLogger, kTrafficDefinition, contextMode); + } + const auto kTrafficDistribution = typedObject->GetTrafficDistribution(); + if ( kTrafficDistribution) + { + ApplyTrafficDistributionCheckerRules(messageLogger, kTrafficDistribution, contextMode); + } + } + void ApplyTrafficStopActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficStopAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrafficSwarmActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrafficSwarmAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCentralObject = typedObject->GetCentralObject(); + if ( kCentralObject) + { + ApplyCentralSwarmObjectCheckerRules(messageLogger, kCentralObject, contextMode); + } + const auto kTrafficDefinition = typedObject->GetTrafficDefinition(); + if ( kTrafficDefinition) + { + ApplyTrafficDefinitionCheckerRules(messageLogger, kTrafficDefinition, contextMode); + } + const auto kTrafficDistribution = typedObject->GetTrafficDistribution(); + if ( kTrafficDistribution) + { + ApplyTrafficDistributionCheckerRules(messageLogger, kTrafficDistribution, contextMode); + } + const auto kInitialSpeedRange = typedObject->GetInitialSpeedRange(); + if ( kInitialSpeedRange) + { + ApplyRangeCheckerRules(messageLogger, kInitialSpeedRange, contextMode); + } + const auto kDirectionOfTravelDistribution = typedObject->GetDirectionOfTravelDistribution(); + if ( kDirectionOfTravelDistribution) + { + ApplyDirectionOfTravelDistributionCheckerRules(messageLogger, kDirectionOfTravelDistribution, contextMode); + } + } + void ApplyTrailerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailer).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrailer = typedObject->GetTrailer(); + if ( kTrailer) + { + ApplyScenarioObjectCheckerRules(messageLogger, kTrailer, contextMode); + } + const auto kTrailerRef = typedObject->GetTrailerRef(); + if ( kTrailerRef) + { + ApplyEntityRefCheckerRules(messageLogger, kTrailerRef, contextMode); + } + } + void ApplyTrailerActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kConnectTrailerAction = typedObject->GetConnectTrailerAction(); + if ( kConnectTrailerAction) + { + ApplyConnectTrailerActionCheckerRules(messageLogger, kConnectTrailerAction, contextMode); + } + const auto kDisconnectTrailerAction = typedObject->GetDisconnectTrailerAction(); + if ( kDisconnectTrailerAction) + { + ApplyDisconnectTrailerActionCheckerRules(messageLogger, kDisconnectTrailerAction, contextMode); + } + } + void ApplyTrailerCouplerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerCoupler).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrailerHitchCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrailerHitch).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrajectoryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectory).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kShape = typedObject->GetShape(); + if ( kShape) + { + ApplyShapeCheckerRules(messageLogger, kShape, contextMode); + } + } + void ApplyTrajectoryCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyTrajectoryFollowingModeCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryFollowingMode).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTrajectoryPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kOrientation = typedObject->GetOrientation(); + if ( kOrientation) + { + ApplyOrientationCheckerRules(messageLogger, kOrientation, contextMode); + } + const auto kTrajectoryRef = typedObject->GetTrajectoryRef(); + if ( kTrajectoryRef) + { + ApplyTrajectoryRefCheckerRules(messageLogger, kTrajectoryRef, contextMode); + } + } + void ApplyTrajectoryRefCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrajectoryRef).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kTrajectory = typedObject->GetTrajectory(); + if ( kTrajectory) + { + ApplyTrajectoryCheckerRules(messageLogger, kTrajectory, contextMode); + } + const auto kCatalogReference = typedObject->GetCatalogReference(); + if ( kCatalogReference) + { + ApplyCatalogReferenceCheckerRules(messageLogger, kCatalogReference, contextMode); + } + } + void ApplyTransitionDynamicsCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITransitionDynamics).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTraveledDistanceConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITraveledDistanceCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyTriggerCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITrigger).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kConditionGroups = typedObject->GetConditionGroups(); + for(auto& kListItem: kConditionGroups) + { + if ( kListItem ) + ApplyConditionGroupCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyTriggeringEntitiesCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(ITriggeringEntities).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kEntityRefs = typedObject->GetEntityRefs(); + for(auto& kListItem: kEntityRefs) + { + if ( kListItem ) + ApplyEntityRefCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyUniformDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUniformDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRange = typedObject->GetRange(); + if ( kRange) + { + ApplyRangeCheckerRules(messageLogger, kRange, contextMode); + } + } + void ApplyUsedAreaCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUsedArea).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPositions = typedObject->GetPositions(); + for(auto& kListItem: kPositions) + { + if ( kListItem ) + ApplyPositionCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyUserDefinedActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kCustomCommandAction = typedObject->GetCustomCommandAction(); + if ( kCustomCommandAction) + { + ApplyCustomCommandActionCheckerRules(messageLogger, kCustomCommandAction, contextMode); + } + } + void ApplyUserDefinedAnimationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedAnimation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyUserDefinedComponentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedComponent).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyUserDefinedDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyUserDefinedLightCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedLight).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyUserDefinedValueConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IUserDefinedValueCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyValueConstraintCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueConstraint).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyValueConstraintGroupCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueConstraintGroup).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kConstraints = typedObject->GetConstraints(); + for(auto& kListItem: kConstraints) + { + if ( kListItem ) + ApplyValueConstraintCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyValueSetDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IValueSetDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterValueSets = typedObject->GetParameterValueSets(); + for(auto& kListItem: kParameterValueSets) + { + if ( kListItem ) + ApplyParameterValueSetCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyVariableActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSetAction = typedObject->GetSetAction(); + if ( kSetAction) + { + ApplyVariableSetActionCheckerRules(messageLogger, kSetAction, contextMode); + } + const auto kModifyAction = typedObject->GetModifyAction(); + if ( kModifyAction) + { + ApplyVariableModifyActionCheckerRules(messageLogger, kModifyAction, contextMode); + } + } + void ApplyVariableAddValueRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableAddValueRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVariableConditionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableCondition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVariableDeclarationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableDeclaration).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVariableModifyActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableModifyAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kRule = typedObject->GetRule(); + if ( kRule) + { + ApplyVariableModifyRuleCheckerRules(messageLogger, kRule, contextMode); + } + } + void ApplyVariableModifyRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableModifyRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kAddValue = typedObject->GetAddValue(); + if ( kAddValue) + { + ApplyVariableAddValueRuleCheckerRules(messageLogger, kAddValue, contextMode); + } + const auto kMultiplyByValue = typedObject->GetMultiplyByValue(); + if ( kMultiplyByValue) + { + ApplyVariableMultiplyByValueRuleCheckerRules(messageLogger, kMultiplyByValue, contextMode); + } + } + void ApplyVariableMultiplyByValueRuleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableMultiplyByValueRule).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVariableSetActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVariableSetAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVehicleCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicle).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kParameterDeclarations = typedObject->GetParameterDeclarations(); + for(auto& kListItem: kParameterDeclarations) + { + if ( kListItem ) + ApplyParameterDeclarationCheckerRules(messageLogger, kListItem, contextMode); + } + const auto kBoundingBox = typedObject->GetBoundingBox(); + if ( kBoundingBox) + { + ApplyBoundingBoxCheckerRules(messageLogger, kBoundingBox, contextMode); + } + const auto kPerformance = typedObject->GetPerformance(); + if ( kPerformance) + { + ApplyPerformanceCheckerRules(messageLogger, kPerformance, contextMode); + } + const auto kAxles = typedObject->GetAxles(); + if ( kAxles) + { + ApplyAxlesCheckerRules(messageLogger, kAxles, contextMode); + } + const auto kProperties = typedObject->GetProperties(); + if ( kProperties) + { + ApplyPropertiesCheckerRules(messageLogger, kProperties, contextMode); + } + const auto kTrailerHitch = typedObject->GetTrailerHitch(); + if ( kTrailerHitch) + { + ApplyTrailerHitchCheckerRules(messageLogger, kTrailerHitch, contextMode); + } + const auto kTrailerCoupler = typedObject->GetTrailerCoupler(); + if ( kTrailerCoupler) + { + ApplyTrailerCouplerCheckerRules(messageLogger, kTrailerCoupler, contextMode); + } + const auto kTrailer = typedObject->GetTrailer(); + if ( kTrailer) + { + ApplyTrailerCheckerRules(messageLogger, kTrailer, contextMode); + } + } + void ApplyVehicleCatalogLocationCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCatalogLocation).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kDirectory = typedObject->GetDirectory(); + if ( kDirectory) + { + ApplyDirectoryCheckerRules(messageLogger, kDirectory, contextMode); + } + } + void ApplyVehicleCategoryDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCategoryDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleCategoryDistributionEntries = typedObject->GetVehicleCategoryDistributionEntries(); + for(auto& kListItem: kVehicleCategoryDistributionEntries) + { + if ( kListItem ) + ApplyVehicleCategoryDistributionEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyVehicleCategoryDistributionEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleCategoryDistributionEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVehicleComponentCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleComponent).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVehicleLightCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleLight).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVehicleRoleDistributionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleRoleDistribution).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kVehicleRoleDistributionEntries = typedObject->GetVehicleRoleDistributionEntries(); + for(auto& kListItem: kVehicleRoleDistributionEntries) + { + if ( kListItem ) + ApplyVehicleRoleDistributionEntryCheckerRules(messageLogger, kListItem, contextMode); + } + } + void ApplyVehicleRoleDistributionEntryCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVehicleRoleDistributionEntry).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyVertexCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVertex).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyVisibilityActionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IVisibilityAction).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSensorReferenceSet = typedObject->GetSensorReferenceSet(); + if ( kSensorReferenceSet) + { + ApplySensorReferenceSetCheckerRules(messageLogger, kSensorReferenceSet, contextMode); + } + } + void ApplyWaypointCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWaypoint).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kPosition = typedObject->GetPosition(); + if ( kPosition) + { + ApplyPositionCheckerRules(messageLogger, kPosition, contextMode); + } + } + void ApplyWeatherCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWeather).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + const auto kSun = typedObject->GetSun(); + if ( kSun) + { + ApplySunCheckerRules(messageLogger, kSun, contextMode); + } + const auto kFog = typedObject->GetFog(); + if ( kFog) + { + ApplyFogCheckerRules(messageLogger, kFog, contextMode); + } + const auto kPrecipitation = typedObject->GetPrecipitation(); + if ( kPrecipitation) + { + ApplyPrecipitationCheckerRules(messageLogger, kPrecipitation, contextMode); + } + const auto kWind = typedObject->GetWind(); + if ( kWind) + { + ApplyWindCheckerRules(messageLogger, kWind, contextMode); + } + const auto kDomeImage = typedObject->GetDomeImage(); + if ( kDomeImage) + { + ApplyDomeImageCheckerRules(messageLogger, kDomeImage, contextMode); + } + } + void ApplyWindCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWind).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + void ApplyWorldPositionCheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(IWorldPosition).name()]; + + auto typedObject = std::dynamic_pointer_cast(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + } + + public: + OPENSCENARIOLIB_EXP void CheckScenarioInFileContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) override; + OPENSCENARIOLIB_EXP void CheckScenarioInTreeContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) override; + OPENSCENARIOLIB_EXP void AddAbsoluteSpeedCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAbsoluteTargetLaneCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAbsoluteTargetLaneOffsetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAbsoluteTargetSpeedCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAccelerationConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAcquirePositionActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddActCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddActivateControllerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddActorsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAddEntityActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAngleConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAnimationActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAnimationFileCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAnimationStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAnimationTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAppearanceActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAssignControllerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAssignRouteActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAutomaticGearCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAxleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddAxlesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddBoundingBoxCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddBrakeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddBrakeInputCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddByEntityConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddByObjectTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddByTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddByValueConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCatalogCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCatalogDefinitionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCatalogLocationsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCatalogReferenceCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCenterCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCentralSwarmObjectCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddClothoidCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddClothoidSplineCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddClothoidSplineSegmentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCollisionConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddColorCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddColorCmykCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddColorRgbCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddComponentAnimationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddConditionGroupCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddConnectTrailerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControlPointCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControllerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControllerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControllerCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControllerDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddControllerDistributionEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCustomCommandActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddCustomContentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeleteEntityActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicMultiParameterDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicMultiParameterDistributionTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicParameterDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicSingleParameterDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDeterministicSingleParameterDistributionTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDimensionsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDirectionOfTravelDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDirectoryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDisconnectTrailerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDistanceConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDistributionDefinitionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDistributionRangeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDistributionSetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDistributionSetElementCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDomeImageCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddDynamicConstraintsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEndOfRoadConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntitiesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityDistributionEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityObjectCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntityRefCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEntitySelectionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEnvironmentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEnvironmentActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEnvironmentCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddEventCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddExternalObjectReferenceCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddFileCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddFileHeaderCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddFinalSpeedCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddFogCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddFollowTrajectoryActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddGearCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddGeoPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddGlobalActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddHistogramCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddHistogramBinCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddInRoutePositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddInfrastructureActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddInitCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddInitActionsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddKnotCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneChangeActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneChangeTargetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneOffsetActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneOffsetActionDynamicsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLaneOffsetTargetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLanePositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLateralActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLateralDistanceActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLicenseCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLightStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLightStateActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLightTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLogNormalDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLongitudinalActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddLongitudinalDistanceActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddManeuverCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddManeuverCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddManeuverGroupCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddManualGearCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddMiscObjectCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddMiscObjectCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddModifyRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddMonitorDeclarationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddNoneCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddNormalDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddNurbsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddObjectControllerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOffroadConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOpenScenarioCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOpenScenarioCategoryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOrientationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideBrakeActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideClutchActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideControllerValueActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideGearActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideParkingBrakeActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideSteeringWheelActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddOverrideThrottleActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterAddValueRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterAssignmentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterDeclarationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterModifyActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterMultiplyByValueRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterSetActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterValueDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterValueDistributionDefinitionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddParameterValueSetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPedestrianCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPedestrianAnimationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPedestrianCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPedestrianGestureCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPerformanceCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPhaseCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPoissonDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPolygonCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPolylineCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPositionInLaneCoordinatesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPositionInRoadCoordinatesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPositionOfCurrentEntityCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPrecipitationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPrivateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPrivateActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddProbabilityDistributionSetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddProbabilityDistributionSetElementCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPropertiesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddPropertyCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRandomRouteActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRangeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddReachPositionConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeAngleConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeClearanceConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeDistanceConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeLanePositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeLaneRangeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeObjectPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeRoadPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeSpeedConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeSpeedToMasterCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeTargetLaneCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeTargetLaneOffsetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeTargetSpeedCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRelativeWorldPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoadConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoadCursorCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoadNetworkCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoadPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoadRangeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRouteCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRouteCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoutePositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRouteRefCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddRoutingActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddScenarioDefinitionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddScenarioObjectCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddScenarioObjectTemplateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSelectedEntitiesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSensorReferenceCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSensorReferenceSetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSetMonitorActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddShapeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSimulationTimeConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSpeedActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSpeedActionTargetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSpeedConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSpeedProfileActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSpeedProfileEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStandStillConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSteadyStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStochasticCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStochasticDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStochasticDistributionTypeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStoryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStoryboardCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddStoryboardElementStateConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSunCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddSynchronizeActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTargetDistanceSteadyStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTargetTimeSteadyStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTeleportActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeHeadwayConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeOfDayCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeOfDayConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeReferenceCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeToCollisionConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimeToCollisionConditionTargetCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTimingCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficAreaCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficAreaActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficDefinitionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficDistributionEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalControllerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalControllerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalControllerConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalGroupStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalStateCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSignalStateActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSinkActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSourceActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficStopActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrafficSwarmActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrailerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrailerActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrailerCouplerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrailerHitchCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrajectoryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrajectoryCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrajectoryFollowingModeCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrajectoryPositionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTrajectoryRefCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTransitionDynamicsCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTraveledDistanceConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTriggerCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddTriggeringEntitiesCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUniformDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUsedAreaCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedAnimationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedComponentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedLightCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddUserDefinedValueConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddValueConstraintCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddValueConstraintGroupCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddValueSetDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableAddValueRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableConditionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableDeclarationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableModifyActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableModifyRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableMultiplyByValueRuleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVariableSetActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleCatalogLocationCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleCategoryDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleCategoryDistributionEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleComponentCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleLightCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleRoleDistributionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVehicleRoleDistributionEntryCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVertexCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddVisibilityActionCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddWaypointCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddWeatherCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddWindCheckerRule(std::shared_ptr checkerRule) override; + OPENSCENARIOLIB_EXP void AddWorldPositionCheckerRule(std::shared_ptr checkerRule) override; + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.cpp new file mode 100644 index 00000000..a9c876f2 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.cpp @@ -0,0 +1,306 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "CardinalityCheckerHelperV1_3.h" +#include "CardinalityCheckerRulesV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void CardinalityCheckerHelper::AddAllCardinalityCheckerRules(std::shared_ptr scenarioChecker) + { + scenarioChecker->AddAbsoluteSpeedCheckerRule(std::shared_ptr(new AbsoluteSpeedCardinalityCheckerRule())); + scenarioChecker->AddAbsoluteTargetLaneCheckerRule(std::shared_ptr(new AbsoluteTargetLaneCardinalityCheckerRule())); + scenarioChecker->AddAbsoluteTargetLaneOffsetCheckerRule(std::shared_ptr(new AbsoluteTargetLaneOffsetCardinalityCheckerRule())); + scenarioChecker->AddAbsoluteTargetSpeedCheckerRule(std::shared_ptr(new AbsoluteTargetSpeedCardinalityCheckerRule())); + scenarioChecker->AddAccelerationConditionCheckerRule(std::shared_ptr(new AccelerationConditionCardinalityCheckerRule())); + scenarioChecker->AddAcquirePositionActionCheckerRule(std::shared_ptr(new AcquirePositionActionCardinalityCheckerRule())); + scenarioChecker->AddActCheckerRule(std::shared_ptr(new ActCardinalityCheckerRule())); + scenarioChecker->AddActionCheckerRule(std::shared_ptr(new ActionCardinalityCheckerRule())); + scenarioChecker->AddActorsCheckerRule(std::shared_ptr(new ActorsCardinalityCheckerRule())); + scenarioChecker->AddAddEntityActionCheckerRule(std::shared_ptr(new AddEntityActionCardinalityCheckerRule())); + scenarioChecker->AddAngleConditionCheckerRule(std::shared_ptr(new AngleConditionCardinalityCheckerRule())); + scenarioChecker->AddAnimationActionCheckerRule(std::shared_ptr(new AnimationActionCardinalityCheckerRule())); + scenarioChecker->AddAnimationFileCheckerRule(std::shared_ptr(new AnimationFileCardinalityCheckerRule())); + scenarioChecker->AddAnimationStateCheckerRule(std::shared_ptr(new AnimationStateCardinalityCheckerRule())); + scenarioChecker->AddAnimationTypeCheckerRule(std::shared_ptr(new AnimationTypeCardinalityCheckerRule())); + scenarioChecker->AddAppearanceActionCheckerRule(std::shared_ptr(new AppearanceActionCardinalityCheckerRule())); + scenarioChecker->AddAssignRouteActionCheckerRule(std::shared_ptr(new AssignRouteActionCardinalityCheckerRule())); + scenarioChecker->AddAutomaticGearCheckerRule(std::shared_ptr(new AutomaticGearCardinalityCheckerRule())); + scenarioChecker->AddAxleCheckerRule(std::shared_ptr(new AxleCardinalityCheckerRule())); + scenarioChecker->AddAxlesCheckerRule(std::shared_ptr(new AxlesCardinalityCheckerRule())); + scenarioChecker->AddBoundingBoxCheckerRule(std::shared_ptr(new BoundingBoxCardinalityCheckerRule())); + scenarioChecker->AddBrakeCheckerRule(std::shared_ptr(new BrakeCardinalityCheckerRule())); + scenarioChecker->AddBrakeInputCheckerRule(std::shared_ptr(new BrakeInputCardinalityCheckerRule())); + scenarioChecker->AddByEntityConditionCheckerRule(std::shared_ptr(new ByEntityConditionCardinalityCheckerRule())); + scenarioChecker->AddByObjectTypeCheckerRule(std::shared_ptr(new ByObjectTypeCardinalityCheckerRule())); + scenarioChecker->AddByTypeCheckerRule(std::shared_ptr(new ByTypeCardinalityCheckerRule())); + scenarioChecker->AddByValueConditionCheckerRule(std::shared_ptr(new ByValueConditionCardinalityCheckerRule())); + scenarioChecker->AddCatalogCheckerRule(std::shared_ptr(new CatalogCardinalityCheckerRule())); + scenarioChecker->AddCatalogDefinitionCheckerRule(std::shared_ptr(new CatalogDefinitionCardinalityCheckerRule())); + scenarioChecker->AddCatalogReferenceCheckerRule(std::shared_ptr(new CatalogReferenceCardinalityCheckerRule())); + scenarioChecker->AddCenterCheckerRule(std::shared_ptr(new CenterCardinalityCheckerRule())); + scenarioChecker->AddCentralSwarmObjectCheckerRule(std::shared_ptr(new CentralSwarmObjectCardinalityCheckerRule())); + scenarioChecker->AddClothoidCheckerRule(std::shared_ptr(new ClothoidCardinalityCheckerRule())); + scenarioChecker->AddClothoidSplineCheckerRule(std::shared_ptr(new ClothoidSplineCardinalityCheckerRule())); + scenarioChecker->AddClothoidSplineSegmentCheckerRule(std::shared_ptr(new ClothoidSplineSegmentCardinalityCheckerRule())); + scenarioChecker->AddCollisionConditionCheckerRule(std::shared_ptr(new CollisionConditionCardinalityCheckerRule())); + scenarioChecker->AddColorCheckerRule(std::shared_ptr(new ColorCardinalityCheckerRule())); + scenarioChecker->AddColorCmykCheckerRule(std::shared_ptr(new ColorCmykCardinalityCheckerRule())); + scenarioChecker->AddColorRgbCheckerRule(std::shared_ptr(new ColorRgbCardinalityCheckerRule())); + scenarioChecker->AddComponentAnimationCheckerRule(std::shared_ptr(new ComponentAnimationCardinalityCheckerRule())); + scenarioChecker->AddConditionCheckerRule(std::shared_ptr(new ConditionCardinalityCheckerRule())); + scenarioChecker->AddConditionGroupCheckerRule(std::shared_ptr(new ConditionGroupCardinalityCheckerRule())); + scenarioChecker->AddConnectTrailerActionCheckerRule(std::shared_ptr(new ConnectTrailerActionCardinalityCheckerRule())); + scenarioChecker->AddControlPointCheckerRule(std::shared_ptr(new ControlPointCardinalityCheckerRule())); + scenarioChecker->AddControllerCheckerRule(std::shared_ptr(new ControllerCardinalityCheckerRule())); + scenarioChecker->AddControllerActionCheckerRule(std::shared_ptr(new ControllerActionCardinalityCheckerRule())); + scenarioChecker->AddControllerCatalogLocationCheckerRule(std::shared_ptr(new ControllerCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddControllerDistributionCheckerRule(std::shared_ptr(new ControllerDistributionCardinalityCheckerRule())); + scenarioChecker->AddControllerDistributionEntryCheckerRule(std::shared_ptr(new ControllerDistributionEntryCardinalityCheckerRule())); + scenarioChecker->AddCustomCommandActionCheckerRule(std::shared_ptr(new CustomCommandActionCardinalityCheckerRule())); + scenarioChecker->AddCustomContentCheckerRule(std::shared_ptr(new CustomContentCardinalityCheckerRule())); + scenarioChecker->AddDeterministicMultiParameterDistributionCheckerRule(std::shared_ptr(new DeterministicMultiParameterDistributionCardinalityCheckerRule())); + scenarioChecker->AddDeterministicMultiParameterDistributionTypeCheckerRule(std::shared_ptr(new DeterministicMultiParameterDistributionTypeCardinalityCheckerRule())); + scenarioChecker->AddDeterministicParameterDistributionCheckerRule(std::shared_ptr(new DeterministicParameterDistributionCardinalityCheckerRule())); + scenarioChecker->AddDeterministicSingleParameterDistributionCheckerRule(std::shared_ptr(new DeterministicSingleParameterDistributionCardinalityCheckerRule())); + scenarioChecker->AddDeterministicSingleParameterDistributionTypeCheckerRule(std::shared_ptr(new DeterministicSingleParameterDistributionTypeCardinalityCheckerRule())); + scenarioChecker->AddDimensionsCheckerRule(std::shared_ptr(new DimensionsCardinalityCheckerRule())); + scenarioChecker->AddDirectionOfTravelDistributionCheckerRule(std::shared_ptr(new DirectionOfTravelDistributionCardinalityCheckerRule())); + scenarioChecker->AddDirectoryCheckerRule(std::shared_ptr(new DirectoryCardinalityCheckerRule())); + scenarioChecker->AddDistanceConditionCheckerRule(std::shared_ptr(new DistanceConditionCardinalityCheckerRule())); + scenarioChecker->AddDistributionDefinitionCheckerRule(std::shared_ptr(new DistributionDefinitionCardinalityCheckerRule())); + scenarioChecker->AddDistributionRangeCheckerRule(std::shared_ptr(new DistributionRangeCardinalityCheckerRule())); + scenarioChecker->AddDistributionSetCheckerRule(std::shared_ptr(new DistributionSetCardinalityCheckerRule())); + scenarioChecker->AddDistributionSetElementCheckerRule(std::shared_ptr(new DistributionSetElementCardinalityCheckerRule())); + scenarioChecker->AddDomeImageCheckerRule(std::shared_ptr(new DomeImageCardinalityCheckerRule())); + scenarioChecker->AddEndOfRoadConditionCheckerRule(std::shared_ptr(new EndOfRoadConditionCardinalityCheckerRule())); + scenarioChecker->AddEntityActionCheckerRule(std::shared_ptr(new EntityActionCardinalityCheckerRule())); + scenarioChecker->AddEntityConditionCheckerRule(std::shared_ptr(new EntityConditionCardinalityCheckerRule())); + scenarioChecker->AddEntityDistributionCheckerRule(std::shared_ptr(new EntityDistributionCardinalityCheckerRule())); + scenarioChecker->AddEntityDistributionEntryCheckerRule(std::shared_ptr(new EntityDistributionEntryCardinalityCheckerRule())); + scenarioChecker->AddEntityObjectCheckerRule(std::shared_ptr(new EntityObjectCardinalityCheckerRule())); + scenarioChecker->AddEntityRefCheckerRule(std::shared_ptr(new EntityRefCardinalityCheckerRule())); + scenarioChecker->AddEntitySelectionCheckerRule(std::shared_ptr(new EntitySelectionCardinalityCheckerRule())); + scenarioChecker->AddEnvironmentCheckerRule(std::shared_ptr(new EnvironmentCardinalityCheckerRule())); + scenarioChecker->AddEnvironmentActionCheckerRule(std::shared_ptr(new EnvironmentActionCardinalityCheckerRule())); + scenarioChecker->AddEnvironmentCatalogLocationCheckerRule(std::shared_ptr(new EnvironmentCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddEventCheckerRule(std::shared_ptr(new EventCardinalityCheckerRule())); + scenarioChecker->AddExternalObjectReferenceCheckerRule(std::shared_ptr(new ExternalObjectReferenceCardinalityCheckerRule())); + scenarioChecker->AddFileCheckerRule(std::shared_ptr(new FileCardinalityCheckerRule())); + scenarioChecker->AddFileHeaderCheckerRule(std::shared_ptr(new FileHeaderCardinalityCheckerRule())); + scenarioChecker->AddFinalSpeedCheckerRule(std::shared_ptr(new FinalSpeedCardinalityCheckerRule())); + scenarioChecker->AddFogCheckerRule(std::shared_ptr(new FogCardinalityCheckerRule())); + scenarioChecker->AddFollowTrajectoryActionCheckerRule(std::shared_ptr(new FollowTrajectoryActionCardinalityCheckerRule())); + scenarioChecker->AddGearCheckerRule(std::shared_ptr(new GearCardinalityCheckerRule())); + scenarioChecker->AddGlobalActionCheckerRule(std::shared_ptr(new GlobalActionCardinalityCheckerRule())); + scenarioChecker->AddHistogramCheckerRule(std::shared_ptr(new HistogramCardinalityCheckerRule())); + scenarioChecker->AddHistogramBinCheckerRule(std::shared_ptr(new HistogramBinCardinalityCheckerRule())); + scenarioChecker->AddInRoutePositionCheckerRule(std::shared_ptr(new InRoutePositionCardinalityCheckerRule())); + scenarioChecker->AddInfrastructureActionCheckerRule(std::shared_ptr(new InfrastructureActionCardinalityCheckerRule())); + scenarioChecker->AddInitCheckerRule(std::shared_ptr(new InitCardinalityCheckerRule())); + scenarioChecker->AddKnotCheckerRule(std::shared_ptr(new KnotCardinalityCheckerRule())); + scenarioChecker->AddLaneCheckerRule(std::shared_ptr(new LaneCardinalityCheckerRule())); + scenarioChecker->AddLaneChangeActionCheckerRule(std::shared_ptr(new LaneChangeActionCardinalityCheckerRule())); + scenarioChecker->AddLaneChangeTargetCheckerRule(std::shared_ptr(new LaneChangeTargetCardinalityCheckerRule())); + scenarioChecker->AddLaneOffsetActionCheckerRule(std::shared_ptr(new LaneOffsetActionCardinalityCheckerRule())); + scenarioChecker->AddLaneOffsetActionDynamicsCheckerRule(std::shared_ptr(new LaneOffsetActionDynamicsCardinalityCheckerRule())); + scenarioChecker->AddLaneOffsetTargetCheckerRule(std::shared_ptr(new LaneOffsetTargetCardinalityCheckerRule())); + scenarioChecker->AddLanePositionCheckerRule(std::shared_ptr(new LanePositionCardinalityCheckerRule())); + scenarioChecker->AddLateralActionCheckerRule(std::shared_ptr(new LateralActionCardinalityCheckerRule())); + scenarioChecker->AddLateralDistanceActionCheckerRule(std::shared_ptr(new LateralDistanceActionCardinalityCheckerRule())); + scenarioChecker->AddLicenseCheckerRule(std::shared_ptr(new LicenseCardinalityCheckerRule())); + scenarioChecker->AddLightStateCheckerRule(std::shared_ptr(new LightStateCardinalityCheckerRule())); + scenarioChecker->AddLightStateActionCheckerRule(std::shared_ptr(new LightStateActionCardinalityCheckerRule())); + scenarioChecker->AddLightTypeCheckerRule(std::shared_ptr(new LightTypeCardinalityCheckerRule())); + scenarioChecker->AddLogNormalDistributionCheckerRule(std::shared_ptr(new LogNormalDistributionCardinalityCheckerRule())); + scenarioChecker->AddLongitudinalActionCheckerRule(std::shared_ptr(new LongitudinalActionCardinalityCheckerRule())); + scenarioChecker->AddLongitudinalDistanceActionCheckerRule(std::shared_ptr(new LongitudinalDistanceActionCardinalityCheckerRule())); + scenarioChecker->AddManeuverCheckerRule(std::shared_ptr(new ManeuverCardinalityCheckerRule())); + scenarioChecker->AddManeuverCatalogLocationCheckerRule(std::shared_ptr(new ManeuverCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddManeuverGroupCheckerRule(std::shared_ptr(new ManeuverGroupCardinalityCheckerRule())); + scenarioChecker->AddManualGearCheckerRule(std::shared_ptr(new ManualGearCardinalityCheckerRule())); + scenarioChecker->AddMiscObjectCheckerRule(std::shared_ptr(new MiscObjectCardinalityCheckerRule())); + scenarioChecker->AddMiscObjectCatalogLocationCheckerRule(std::shared_ptr(new MiscObjectCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddModifyRuleCheckerRule(std::shared_ptr(new ModifyRuleCardinalityCheckerRule())); + scenarioChecker->AddMonitorDeclarationCheckerRule(std::shared_ptr(new MonitorDeclarationCardinalityCheckerRule())); + scenarioChecker->AddNormalDistributionCheckerRule(std::shared_ptr(new NormalDistributionCardinalityCheckerRule())); + scenarioChecker->AddNurbsCheckerRule(std::shared_ptr(new NurbsCardinalityCheckerRule())); + scenarioChecker->AddObjectControllerCheckerRule(std::shared_ptr(new ObjectControllerCardinalityCheckerRule())); + scenarioChecker->AddOffroadConditionCheckerRule(std::shared_ptr(new OffroadConditionCardinalityCheckerRule())); + scenarioChecker->AddOpenScenarioCheckerRule(std::shared_ptr(new OpenScenarioCardinalityCheckerRule())); + scenarioChecker->AddOpenScenarioCategoryCheckerRule(std::shared_ptr(new OpenScenarioCategoryCardinalityCheckerRule())); + scenarioChecker->AddOverrideBrakeActionCheckerRule(std::shared_ptr(new OverrideBrakeActionCardinalityCheckerRule())); + scenarioChecker->AddOverrideClutchActionCheckerRule(std::shared_ptr(new OverrideClutchActionCardinalityCheckerRule())); + scenarioChecker->AddOverrideGearActionCheckerRule(std::shared_ptr(new OverrideGearActionCardinalityCheckerRule())); + scenarioChecker->AddOverrideParkingBrakeActionCheckerRule(std::shared_ptr(new OverrideParkingBrakeActionCardinalityCheckerRule())); + scenarioChecker->AddOverrideSteeringWheelActionCheckerRule(std::shared_ptr(new OverrideSteeringWheelActionCardinalityCheckerRule())); + scenarioChecker->AddOverrideThrottleActionCheckerRule(std::shared_ptr(new OverrideThrottleActionCardinalityCheckerRule())); + scenarioChecker->AddParameterActionCheckerRule(std::shared_ptr(new ParameterActionCardinalityCheckerRule())); + scenarioChecker->AddParameterAddValueRuleCheckerRule(std::shared_ptr(new ParameterAddValueRuleCardinalityCheckerRule())); + scenarioChecker->AddParameterAssignmentCheckerRule(std::shared_ptr(new ParameterAssignmentCardinalityCheckerRule())); + scenarioChecker->AddParameterConditionCheckerRule(std::shared_ptr(new ParameterConditionCardinalityCheckerRule())); + scenarioChecker->AddParameterDeclarationCheckerRule(std::shared_ptr(new ParameterDeclarationCardinalityCheckerRule())); + scenarioChecker->AddParameterModifyActionCheckerRule(std::shared_ptr(new ParameterModifyActionCardinalityCheckerRule())); + scenarioChecker->AddParameterMultiplyByValueRuleCheckerRule(std::shared_ptr(new ParameterMultiplyByValueRuleCardinalityCheckerRule())); + scenarioChecker->AddParameterSetActionCheckerRule(std::shared_ptr(new ParameterSetActionCardinalityCheckerRule())); + scenarioChecker->AddParameterValueDistributionCheckerRule(std::shared_ptr(new ParameterValueDistributionCardinalityCheckerRule())); + scenarioChecker->AddParameterValueDistributionDefinitionCheckerRule(std::shared_ptr(new ParameterValueDistributionDefinitionCardinalityCheckerRule())); + scenarioChecker->AddParameterValueSetCheckerRule(std::shared_ptr(new ParameterValueSetCardinalityCheckerRule())); + scenarioChecker->AddPedestrianCheckerRule(std::shared_ptr(new PedestrianCardinalityCheckerRule())); + scenarioChecker->AddPedestrianCatalogLocationCheckerRule(std::shared_ptr(new PedestrianCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddPedestrianGestureCheckerRule(std::shared_ptr(new PedestrianGestureCardinalityCheckerRule())); + scenarioChecker->AddPerformanceCheckerRule(std::shared_ptr(new PerformanceCardinalityCheckerRule())); + scenarioChecker->AddPhaseCheckerRule(std::shared_ptr(new PhaseCardinalityCheckerRule())); + scenarioChecker->AddPoissonDistributionCheckerRule(std::shared_ptr(new PoissonDistributionCardinalityCheckerRule())); + scenarioChecker->AddPolygonCheckerRule(std::shared_ptr(new PolygonCardinalityCheckerRule())); + scenarioChecker->AddPolylineCheckerRule(std::shared_ptr(new PolylineCardinalityCheckerRule())); + scenarioChecker->AddPositionCheckerRule(std::shared_ptr(new PositionCardinalityCheckerRule())); + scenarioChecker->AddPositionInLaneCoordinatesCheckerRule(std::shared_ptr(new PositionInLaneCoordinatesCardinalityCheckerRule())); + scenarioChecker->AddPositionInRoadCoordinatesCheckerRule(std::shared_ptr(new PositionInRoadCoordinatesCardinalityCheckerRule())); + scenarioChecker->AddPositionOfCurrentEntityCheckerRule(std::shared_ptr(new PositionOfCurrentEntityCardinalityCheckerRule())); + scenarioChecker->AddPrecipitationCheckerRule(std::shared_ptr(new PrecipitationCardinalityCheckerRule())); + scenarioChecker->AddPrivateCheckerRule(std::shared_ptr(new PrivateCardinalityCheckerRule())); + scenarioChecker->AddPrivateActionCheckerRule(std::shared_ptr(new PrivateActionCardinalityCheckerRule())); + scenarioChecker->AddProbabilityDistributionSetCheckerRule(std::shared_ptr(new ProbabilityDistributionSetCardinalityCheckerRule())); + scenarioChecker->AddProbabilityDistributionSetElementCheckerRule(std::shared_ptr(new ProbabilityDistributionSetElementCardinalityCheckerRule())); + scenarioChecker->AddPropertyCheckerRule(std::shared_ptr(new PropertyCardinalityCheckerRule())); + scenarioChecker->AddRangeCheckerRule(std::shared_ptr(new RangeCardinalityCheckerRule())); + scenarioChecker->AddReachPositionConditionCheckerRule(std::shared_ptr(new ReachPositionConditionCardinalityCheckerRule())); + scenarioChecker->AddRelativeAngleConditionCheckerRule(std::shared_ptr(new RelativeAngleConditionCardinalityCheckerRule())); + scenarioChecker->AddRelativeClearanceConditionCheckerRule(std::shared_ptr(new RelativeClearanceConditionCardinalityCheckerRule())); + scenarioChecker->AddRelativeDistanceConditionCheckerRule(std::shared_ptr(new RelativeDistanceConditionCardinalityCheckerRule())); + scenarioChecker->AddRelativeLanePositionCheckerRule(std::shared_ptr(new RelativeLanePositionCardinalityCheckerRule())); + scenarioChecker->AddRelativeObjectPositionCheckerRule(std::shared_ptr(new RelativeObjectPositionCardinalityCheckerRule())); + scenarioChecker->AddRelativeRoadPositionCheckerRule(std::shared_ptr(new RelativeRoadPositionCardinalityCheckerRule())); + scenarioChecker->AddRelativeSpeedConditionCheckerRule(std::shared_ptr(new RelativeSpeedConditionCardinalityCheckerRule())); + scenarioChecker->AddRelativeSpeedToMasterCheckerRule(std::shared_ptr(new RelativeSpeedToMasterCardinalityCheckerRule())); + scenarioChecker->AddRelativeTargetLaneCheckerRule(std::shared_ptr(new RelativeTargetLaneCardinalityCheckerRule())); + scenarioChecker->AddRelativeTargetLaneOffsetCheckerRule(std::shared_ptr(new RelativeTargetLaneOffsetCardinalityCheckerRule())); + scenarioChecker->AddRelativeTargetSpeedCheckerRule(std::shared_ptr(new RelativeTargetSpeedCardinalityCheckerRule())); + scenarioChecker->AddRelativeWorldPositionCheckerRule(std::shared_ptr(new RelativeWorldPositionCardinalityCheckerRule())); + scenarioChecker->AddRoadConditionCheckerRule(std::shared_ptr(new RoadConditionCardinalityCheckerRule())); + scenarioChecker->AddRoadCursorCheckerRule(std::shared_ptr(new RoadCursorCardinalityCheckerRule())); + scenarioChecker->AddRoadPositionCheckerRule(std::shared_ptr(new RoadPositionCardinalityCheckerRule())); + scenarioChecker->AddRoadRangeCheckerRule(std::shared_ptr(new RoadRangeCardinalityCheckerRule())); + scenarioChecker->AddRouteCheckerRule(std::shared_ptr(new RouteCardinalityCheckerRule())); + scenarioChecker->AddRouteCatalogLocationCheckerRule(std::shared_ptr(new RouteCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddRoutePositionCheckerRule(std::shared_ptr(new RoutePositionCardinalityCheckerRule())); + scenarioChecker->AddRouteRefCheckerRule(std::shared_ptr(new RouteRefCardinalityCheckerRule())); + scenarioChecker->AddRoutingActionCheckerRule(std::shared_ptr(new RoutingActionCardinalityCheckerRule())); + scenarioChecker->AddScenarioDefinitionCheckerRule(std::shared_ptr(new ScenarioDefinitionCardinalityCheckerRule())); + scenarioChecker->AddScenarioObjectCheckerRule(std::shared_ptr(new ScenarioObjectCardinalityCheckerRule())); + scenarioChecker->AddScenarioObjectTemplateCheckerRule(std::shared_ptr(new ScenarioObjectTemplateCardinalityCheckerRule())); + scenarioChecker->AddSelectedEntitiesCheckerRule(std::shared_ptr(new SelectedEntitiesCardinalityCheckerRule())); + scenarioChecker->AddSensorReferenceCheckerRule(std::shared_ptr(new SensorReferenceCardinalityCheckerRule())); + scenarioChecker->AddSensorReferenceSetCheckerRule(std::shared_ptr(new SensorReferenceSetCardinalityCheckerRule())); + scenarioChecker->AddSetMonitorActionCheckerRule(std::shared_ptr(new SetMonitorActionCardinalityCheckerRule())); + scenarioChecker->AddShapeCheckerRule(std::shared_ptr(new ShapeCardinalityCheckerRule())); + scenarioChecker->AddSimulationTimeConditionCheckerRule(std::shared_ptr(new SimulationTimeConditionCardinalityCheckerRule())); + scenarioChecker->AddSpeedActionCheckerRule(std::shared_ptr(new SpeedActionCardinalityCheckerRule())); + scenarioChecker->AddSpeedActionTargetCheckerRule(std::shared_ptr(new SpeedActionTargetCardinalityCheckerRule())); + scenarioChecker->AddSpeedConditionCheckerRule(std::shared_ptr(new SpeedConditionCardinalityCheckerRule())); + scenarioChecker->AddSpeedProfileActionCheckerRule(std::shared_ptr(new SpeedProfileActionCardinalityCheckerRule())); + scenarioChecker->AddSpeedProfileEntryCheckerRule(std::shared_ptr(new SpeedProfileEntryCardinalityCheckerRule())); + scenarioChecker->AddStandStillConditionCheckerRule(std::shared_ptr(new StandStillConditionCardinalityCheckerRule())); + scenarioChecker->AddSteadyStateCheckerRule(std::shared_ptr(new SteadyStateCardinalityCheckerRule())); + scenarioChecker->AddStochasticCheckerRule(std::shared_ptr(new StochasticCardinalityCheckerRule())); + scenarioChecker->AddStochasticDistributionCheckerRule(std::shared_ptr(new StochasticDistributionCardinalityCheckerRule())); + scenarioChecker->AddStochasticDistributionTypeCheckerRule(std::shared_ptr(new StochasticDistributionTypeCardinalityCheckerRule())); + scenarioChecker->AddStoryCheckerRule(std::shared_ptr(new StoryCardinalityCheckerRule())); + scenarioChecker->AddStoryboardCheckerRule(std::shared_ptr(new StoryboardCardinalityCheckerRule())); + scenarioChecker->AddStoryboardElementStateConditionCheckerRule(std::shared_ptr(new StoryboardElementStateConditionCardinalityCheckerRule())); + scenarioChecker->AddSunCheckerRule(std::shared_ptr(new SunCardinalityCheckerRule())); + scenarioChecker->AddSynchronizeActionCheckerRule(std::shared_ptr(new SynchronizeActionCardinalityCheckerRule())); + scenarioChecker->AddTargetDistanceSteadyStateCheckerRule(std::shared_ptr(new TargetDistanceSteadyStateCardinalityCheckerRule())); + scenarioChecker->AddTargetTimeSteadyStateCheckerRule(std::shared_ptr(new TargetTimeSteadyStateCardinalityCheckerRule())); + scenarioChecker->AddTeleportActionCheckerRule(std::shared_ptr(new TeleportActionCardinalityCheckerRule())); + scenarioChecker->AddTimeHeadwayConditionCheckerRule(std::shared_ptr(new TimeHeadwayConditionCardinalityCheckerRule())); + scenarioChecker->AddTimeOfDayCheckerRule(std::shared_ptr(new TimeOfDayCardinalityCheckerRule())); + scenarioChecker->AddTimeOfDayConditionCheckerRule(std::shared_ptr(new TimeOfDayConditionCardinalityCheckerRule())); + scenarioChecker->AddTimeReferenceCheckerRule(std::shared_ptr(new TimeReferenceCardinalityCheckerRule())); + scenarioChecker->AddTimeToCollisionConditionCheckerRule(std::shared_ptr(new TimeToCollisionConditionCardinalityCheckerRule())); + scenarioChecker->AddTimeToCollisionConditionTargetCheckerRule(std::shared_ptr(new TimeToCollisionConditionTargetCardinalityCheckerRule())); + scenarioChecker->AddTimingCheckerRule(std::shared_ptr(new TimingCardinalityCheckerRule())); + scenarioChecker->AddTrafficActionCheckerRule(std::shared_ptr(new TrafficActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficAreaCheckerRule(std::shared_ptr(new TrafficAreaCardinalityCheckerRule())); + scenarioChecker->AddTrafficAreaActionCheckerRule(std::shared_ptr(new TrafficAreaActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficDefinitionCheckerRule(std::shared_ptr(new TrafficDefinitionCardinalityCheckerRule())); + scenarioChecker->AddTrafficDistributionCheckerRule(std::shared_ptr(new TrafficDistributionCardinalityCheckerRule())); + scenarioChecker->AddTrafficDistributionEntryCheckerRule(std::shared_ptr(new TrafficDistributionEntryCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalActionCheckerRule(std::shared_ptr(new TrafficSignalActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalConditionCheckerRule(std::shared_ptr(new TrafficSignalConditionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalControllerCheckerRule(std::shared_ptr(new TrafficSignalControllerCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalControllerActionCheckerRule(std::shared_ptr(new TrafficSignalControllerActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalControllerConditionCheckerRule(std::shared_ptr(new TrafficSignalControllerConditionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalGroupStateCheckerRule(std::shared_ptr(new TrafficSignalGroupStateCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalStateCheckerRule(std::shared_ptr(new TrafficSignalStateCardinalityCheckerRule())); + scenarioChecker->AddTrafficSignalStateActionCheckerRule(std::shared_ptr(new TrafficSignalStateActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSinkActionCheckerRule(std::shared_ptr(new TrafficSinkActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSourceActionCheckerRule(std::shared_ptr(new TrafficSourceActionCardinalityCheckerRule())); + scenarioChecker->AddTrafficSwarmActionCheckerRule(std::shared_ptr(new TrafficSwarmActionCardinalityCheckerRule())); + scenarioChecker->AddTrailerCheckerRule(std::shared_ptr(new TrailerCardinalityCheckerRule())); + scenarioChecker->AddTrailerActionCheckerRule(std::shared_ptr(new TrailerActionCardinalityCheckerRule())); + scenarioChecker->AddTrailerCouplerCheckerRule(std::shared_ptr(new TrailerCouplerCardinalityCheckerRule())); + scenarioChecker->AddTrailerHitchCheckerRule(std::shared_ptr(new TrailerHitchCardinalityCheckerRule())); + scenarioChecker->AddTrajectoryCheckerRule(std::shared_ptr(new TrajectoryCardinalityCheckerRule())); + scenarioChecker->AddTrajectoryCatalogLocationCheckerRule(std::shared_ptr(new TrajectoryCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddTrajectoryFollowingModeCheckerRule(std::shared_ptr(new TrajectoryFollowingModeCardinalityCheckerRule())); + scenarioChecker->AddTrajectoryPositionCheckerRule(std::shared_ptr(new TrajectoryPositionCardinalityCheckerRule())); + scenarioChecker->AddTrajectoryRefCheckerRule(std::shared_ptr(new TrajectoryRefCardinalityCheckerRule())); + scenarioChecker->AddTransitionDynamicsCheckerRule(std::shared_ptr(new TransitionDynamicsCardinalityCheckerRule())); + scenarioChecker->AddTraveledDistanceConditionCheckerRule(std::shared_ptr(new TraveledDistanceConditionCardinalityCheckerRule())); + scenarioChecker->AddTriggeringEntitiesCheckerRule(std::shared_ptr(new TriggeringEntitiesCardinalityCheckerRule())); + scenarioChecker->AddUniformDistributionCheckerRule(std::shared_ptr(new UniformDistributionCardinalityCheckerRule())); + scenarioChecker->AddUsedAreaCheckerRule(std::shared_ptr(new UsedAreaCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedActionCheckerRule(std::shared_ptr(new UserDefinedActionCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedAnimationCheckerRule(std::shared_ptr(new UserDefinedAnimationCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedComponentCheckerRule(std::shared_ptr(new UserDefinedComponentCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedDistributionCheckerRule(std::shared_ptr(new UserDefinedDistributionCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedLightCheckerRule(std::shared_ptr(new UserDefinedLightCardinalityCheckerRule())); + scenarioChecker->AddUserDefinedValueConditionCheckerRule(std::shared_ptr(new UserDefinedValueConditionCardinalityCheckerRule())); + scenarioChecker->AddValueConstraintCheckerRule(std::shared_ptr(new ValueConstraintCardinalityCheckerRule())); + scenarioChecker->AddValueConstraintGroupCheckerRule(std::shared_ptr(new ValueConstraintGroupCardinalityCheckerRule())); + scenarioChecker->AddValueSetDistributionCheckerRule(std::shared_ptr(new ValueSetDistributionCardinalityCheckerRule())); + scenarioChecker->AddVariableActionCheckerRule(std::shared_ptr(new VariableActionCardinalityCheckerRule())); + scenarioChecker->AddVariableAddValueRuleCheckerRule(std::shared_ptr(new VariableAddValueRuleCardinalityCheckerRule())); + scenarioChecker->AddVariableConditionCheckerRule(std::shared_ptr(new VariableConditionCardinalityCheckerRule())); + scenarioChecker->AddVariableDeclarationCheckerRule(std::shared_ptr(new VariableDeclarationCardinalityCheckerRule())); + scenarioChecker->AddVariableModifyActionCheckerRule(std::shared_ptr(new VariableModifyActionCardinalityCheckerRule())); + scenarioChecker->AddVariableModifyRuleCheckerRule(std::shared_ptr(new VariableModifyRuleCardinalityCheckerRule())); + scenarioChecker->AddVariableMultiplyByValueRuleCheckerRule(std::shared_ptr(new VariableMultiplyByValueRuleCardinalityCheckerRule())); + scenarioChecker->AddVariableSetActionCheckerRule(std::shared_ptr(new VariableSetActionCardinalityCheckerRule())); + scenarioChecker->AddVehicleCheckerRule(std::shared_ptr(new VehicleCardinalityCheckerRule())); + scenarioChecker->AddVehicleCatalogLocationCheckerRule(std::shared_ptr(new VehicleCatalogLocationCardinalityCheckerRule())); + scenarioChecker->AddVehicleCategoryDistributionCheckerRule(std::shared_ptr(new VehicleCategoryDistributionCardinalityCheckerRule())); + scenarioChecker->AddVehicleCategoryDistributionEntryCheckerRule(std::shared_ptr(new VehicleCategoryDistributionEntryCardinalityCheckerRule())); + scenarioChecker->AddVehicleComponentCheckerRule(std::shared_ptr(new VehicleComponentCardinalityCheckerRule())); + scenarioChecker->AddVehicleLightCheckerRule(std::shared_ptr(new VehicleLightCardinalityCheckerRule())); + scenarioChecker->AddVehicleRoleDistributionCheckerRule(std::shared_ptr(new VehicleRoleDistributionCardinalityCheckerRule())); + scenarioChecker->AddVehicleRoleDistributionEntryCheckerRule(std::shared_ptr(new VehicleRoleDistributionEntryCardinalityCheckerRule())); + scenarioChecker->AddVertexCheckerRule(std::shared_ptr(new VertexCardinalityCheckerRule())); + scenarioChecker->AddVisibilityActionCheckerRule(std::shared_ptr(new VisibilityActionCardinalityCheckerRule())); + scenarioChecker->AddWaypointCheckerRule(std::shared_ptr(new WaypointCardinalityCheckerRule())); + scenarioChecker->AddWindCheckerRule(std::shared_ptr(new WindCardinalityCheckerRule())); + scenarioChecker->AddWorldPositionCheckerRule(std::shared_ptr(new WorldPositionCardinalityCheckerRule())); + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.h new file mode 100644 index 00000000..43352b2c --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.h @@ -0,0 +1,46 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IScenarioCheckerV1_3.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { +/** + * This is a automatic generated file according to the OpenSCENARIO specification version + * A helper class for adding all cardinality checker rules to a loaded scenario + * all properties and children are checked if they are not optional + * + * @author RA Consulting OpenSCENARIO generation facility +*/ + class CardinalityCheckerHelper + { + public: + /** + * Connects all cardinality checker rules to a global scenarioChecker + * @param scenarioChecker the global scenarioChecker + */ + static void AddAllCardinalityCheckerRules(std::shared_ptr scenarioChecker); + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.cpp new file mode 100644 index 00000000..90962e85 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.cpp @@ -0,0 +1,19857 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "CardinalityCheckerRulesV1_3.h" +#include "OscConstantsV1_3.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + std::string AbsoluteSpeedCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AbsoluteSpeedCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AbsoluteSpeedCardinalityCheckerRule::AbsoluteSpeedCardinalityCheckerRule() = default; + + void AbsoluteSpeedCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AbsoluteSpeedCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AbsoluteTargetLaneCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AbsoluteTargetLaneCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AbsoluteTargetLaneCardinalityCheckerRule::AbsoluteTargetLaneCardinalityCheckerRule() = default; + + void AbsoluteTargetLaneCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AbsoluteTargetLaneCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AbsoluteTargetLaneOffsetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AbsoluteTargetLaneOffsetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AbsoluteTargetLaneOffsetCardinalityCheckerRule::AbsoluteTargetLaneOffsetCardinalityCheckerRule() = default; + + void AbsoluteTargetLaneOffsetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AbsoluteTargetLaneOffsetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AbsoluteTargetSpeedCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AbsoluteTargetSpeedCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AbsoluteTargetSpeedCardinalityCheckerRule::AbsoluteTargetSpeedCardinalityCheckerRule() = default; + + void AbsoluteTargetSpeedCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AbsoluteTargetSpeedCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AccelerationConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AccelerationConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AccelerationConditionCardinalityCheckerRule::AccelerationConditionCardinalityCheckerRule() = default; + + void AccelerationConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AccelerationConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AcquirePositionActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AcquirePositionActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AcquirePositionActionCardinalityCheckerRule::AcquirePositionActionCardinalityCheckerRule() = default; + + void AcquirePositionActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AcquirePositionActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ActCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ActCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kManeuverGroupsSize = object->GetManeuverGroupsSize(); + // Check too few elements + if (kManeuverGroupsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__MANEUVER_GROUP, 1, kManeuverGroupsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ActCardinalityCheckerRule::ActCardinalityCheckerRule() = default; + + void ActCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ActCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetGlobalAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION ); + elementsDefined += object->IsSetUserDefinedAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION ); + elementsDefined += object->IsSetPrivateAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ActionCardinalityCheckerRule::ActionCardinalityCheckerRule() = default; + + void ActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ActorsCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ActorsCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetSelectTriggeringEntities()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ActorsCardinalityCheckerRule::ActorsCardinalityCheckerRule() = default; + + void ActorsCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ActorsCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AddEntityActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AddEntityActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AddEntityActionCardinalityCheckerRule::AddEntityActionCardinalityCheckerRule() = default; + + void AddEntityActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AddEntityActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AngleConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AngleConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAngle()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetAngleTolerance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetAngleType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AngleConditionCardinalityCheckerRule::AngleConditionCardinalityCheckerRule() = default; + + void AngleConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AngleConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AnimationActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AnimationActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAnimationType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ANIMATION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AnimationActionCardinalityCheckerRule::AnimationActionCardinalityCheckerRule() = default; + + void AnimationActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AnimationActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AnimationFileCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AnimationFileCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFile()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__FILE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AnimationFileCardinalityCheckerRule::AnimationFileCardinalityCheckerRule() = default; + + void AnimationFileCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AnimationFileCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AnimationStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AnimationStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AnimationStateCardinalityCheckerRule::AnimationStateCardinalityCheckerRule() = default; + + void AnimationStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AnimationStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AnimationTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AnimationTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetComponentAnimation()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION ); + elementsDefined += object->IsSetPedestrianAnimation()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION ); + elementsDefined += object->IsSetAnimationFile()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ANIMATION_FILE ); + elementsDefined += object->IsSetUserDefinedAnimation()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + AnimationTypeCardinalityCheckerRule::AnimationTypeCardinalityCheckerRule() = default; + + void AnimationTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AnimationTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AppearanceActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AppearanceActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetLightStateAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION ); + elementsDefined += object->IsSetAnimationAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + AppearanceActionCardinalityCheckerRule::AppearanceActionCardinalityCheckerRule() = default; + + void AppearanceActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AppearanceActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AssignRouteActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AssignRouteActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetRoute()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROUTE ); + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + AssignRouteActionCardinalityCheckerRule::AssignRouteActionCardinalityCheckerRule() = default; + + void AssignRouteActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AssignRouteActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AutomaticGearCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AutomaticGearCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetGear()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__GEAR, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AutomaticGearCardinalityCheckerRule::AutomaticGearCardinalityCheckerRule() = default; + + void AutomaticGearCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AutomaticGearCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AxleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AxleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMaxSteering()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPositionX()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPositionZ()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrackWidth()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetWheelDiameter()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AxleCardinalityCheckerRule::AxleCardinalityCheckerRule() = default; + + void AxleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AxleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string AxlesCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector AxlesCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRearAxle()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__REAR_AXLE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + AxlesCardinalityCheckerRule::AxlesCardinalityCheckerRule() = default; + + void AxlesCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void AxlesCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string BoundingBoxCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector BoundingBoxCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCenter()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CENTER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDimensions()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIMENSIONS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + BoundingBoxCardinalityCheckerRule::BoundingBoxCardinalityCheckerRule() = default; + + void BoundingBoxCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void BoundingBoxCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string BrakeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector BrakeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + BrakeCardinalityCheckerRule::BrakeCardinalityCheckerRule() = default; + + void BrakeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void BrakeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string BrakeInputCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector BrakeInputCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetBrakePercent()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT ); + elementsDefined += object->IsSetBrakeForce()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BRAKE_FORCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + BrakeInputCardinalityCheckerRule::BrakeInputCardinalityCheckerRule() = default; + + void BrakeInputCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void BrakeInputCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ByEntityConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ByEntityConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTriggeringEntities()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRIGGERING_ENTITIES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityCondition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITY_CONDITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ByEntityConditionCardinalityCheckerRule::ByEntityConditionCardinalityCheckerRule() = default; + + void ByEntityConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ByEntityConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ByObjectTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ByObjectTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ByObjectTypeCardinalityCheckerRule::ByObjectTypeCardinalityCheckerRule() = default; + + void ByObjectTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ByObjectTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ByTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ByTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetObjectType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ByTypeCardinalityCheckerRule::ByTypeCardinalityCheckerRule() = default; + + void ByTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ByTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ByValueConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ByValueConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetParameterCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION ); + elementsDefined += object->IsSetTimeOfDayCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION ); + elementsDefined += object->IsSetSimulationTimeCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION ); + elementsDefined += object->IsSetStoryboardElementStateCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION ); + elementsDefined += object->IsSetUserDefinedValueCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION ); + elementsDefined += object->IsSetTrafficSignalCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION ); + elementsDefined += object->IsSetTrafficSignalControllerCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION ); + elementsDefined += object->IsSetVariableCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ByValueConditionCardinalityCheckerRule::ByValueConditionCardinalityCheckerRule() = default; + + void ByValueConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ByValueConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CatalogCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CatalogCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CatalogCardinalityCheckerRule::CatalogCardinalityCheckerRule() = default; + + void CatalogCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CatalogCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CatalogDefinitionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CatalogDefinitionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCatalog()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CATALOG, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CatalogDefinitionCardinalityCheckerRule::CatalogDefinitionCardinalityCheckerRule() = default; + + void CatalogDefinitionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CatalogDefinitionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CatalogReferenceCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CatalogReferenceCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCatalogName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntryName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CatalogReferenceCardinalityCheckerRule::CatalogReferenceCardinalityCheckerRule() = default; + + void CatalogReferenceCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CatalogReferenceCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CenterCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CenterCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetX()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__X, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetY()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__Y, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetZ()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__Z, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CenterCardinalityCheckerRule::CenterCardinalityCheckerRule() = default; + + void CenterCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CenterCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CentralSwarmObjectCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CentralSwarmObjectCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CentralSwarmObjectCardinalityCheckerRule::CentralSwarmObjectCardinalityCheckerRule() = default; + + void CentralSwarmObjectCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CentralSwarmObjectCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ClothoidCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ClothoidCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCurvature()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLength()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LENGTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ClothoidCardinalityCheckerRule::ClothoidCardinalityCheckerRule() = default; + + void ClothoidCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ClothoidCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ClothoidSplineCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ClothoidSplineCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kSegmentsSize = object->GetSegmentsSize(); + // Check too few elements + if (kSegmentsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE_SEGMENT, 1, kSegmentsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ClothoidSplineCardinalityCheckerRule::ClothoidSplineCardinalityCheckerRule() = default; + + void ClothoidSplineCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ClothoidSplineCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ClothoidSplineSegmentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ClothoidSplineSegmentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCurvatureEnd()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetCurvatureStart()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLength()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LENGTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ClothoidSplineSegmentCardinalityCheckerRule::ClothoidSplineSegmentCardinalityCheckerRule() = default; + + void ClothoidSplineSegmentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ClothoidSplineSegmentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CollisionConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CollisionConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetEntityRef()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENTITY_REF ); + elementsDefined += object->IsSetByType()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BY_TYPE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + CollisionConditionCardinalityCheckerRule::CollisionConditionCardinalityCheckerRule() = default; + + void CollisionConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CollisionConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ColorCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ColorCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetColorType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetColorRgb()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__COLOR_RGB ); + elementsDefined += object->IsSetColorCmyk()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__COLOR_CMYK ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ColorCardinalityCheckerRule::ColorCardinalityCheckerRule() = default; + + void ColorCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ColorCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ColorCmykCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ColorCmykCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCyan()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CYAN, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetKey()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__KEY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetMagenta()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetYellow()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__YELLOW, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ColorCmykCardinalityCheckerRule::ColorCmykCardinalityCheckerRule() = default; + + void ColorCmykCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ColorCmykCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ColorRgbCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ColorRgbCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetBlue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__BLUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetGreen()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__GREEN, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ColorRgbCardinalityCheckerRule::ColorRgbCardinalityCheckerRule() = default; + + void ColorRgbCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ColorRgbCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ComponentAnimationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ComponentAnimationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetVehicleComponent()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT ); + elementsDefined += object->IsSetUserDefinedComponent()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ComponentAnimationCardinalityCheckerRule::ComponentAnimationCardinalityCheckerRule() = default; + + void ComponentAnimationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ComponentAnimationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetConditionEdge()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDelay()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DELAY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetByEntityCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION ); + elementsDefined += object->IsSetByValueCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ConditionCardinalityCheckerRule::ConditionCardinalityCheckerRule() = default; + + void ConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ConditionGroupCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ConditionGroupCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kConditionsSize = object->GetConditionsSize(); + // Check too few elements + if (kConditionsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CONDITION, 1, kConditionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ConditionGroupCardinalityCheckerRule::ConditionGroupCardinalityCheckerRule() = default; + + void ConditionGroupCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ConditionGroupCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ConnectTrailerActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ConnectTrailerActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTrailerRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ConnectTrailerActionCardinalityCheckerRule::ConnectTrailerActionCardinalityCheckerRule() = default; + + void ConnectTrailerActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ConnectTrailerActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControlPointCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControlPointCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ControlPointCardinalityCheckerRule::ControlPointCardinalityCheckerRule() = default; + + void ControlPointCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControlPointCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControllerCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControllerCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ControllerCardinalityCheckerRule::ControllerCardinalityCheckerRule() = default; + + void ControllerCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControllerCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControllerActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControllerActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAssignControllerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ASSIGN_CONTROLLER_ACTION ); + elementsDefined += object->IsSetOverrideControllerValueAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION ); + elementsDefined += object->IsSetActivateControllerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ControllerActionCardinalityCheckerRule::ControllerActionCardinalityCheckerRule() = default; + + void ControllerActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControllerActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControllerCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControllerCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ControllerCatalogLocationCardinalityCheckerRule::ControllerCatalogLocationCardinalityCheckerRule() = default; + + void ControllerCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControllerCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControllerDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControllerDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kControllerDistributionEntriesSize = object->GetControllerDistributionEntriesSize(); + // Check too few elements + if (kControllerDistributionEntriesSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY, 1, kControllerDistributionEntriesSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ControllerDistributionCardinalityCheckerRule::ControllerDistributionCardinalityCheckerRule() = default; + + void ControllerDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControllerDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ControllerDistributionEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ControllerDistributionEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetController()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CONTROLLER ); + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ControllerDistributionEntryCardinalityCheckerRule::ControllerDistributionEntryCardinalityCheckerRule() = default; + + void ControllerDistributionEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ControllerDistributionEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CustomCommandActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CustomCommandActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContent()) + { + violations.push_back( CardinalityViolation("", 0, 1, VIOLATION_TYPE::REQUIRED_SIMPLE_CONTENT) ); + } + // Check violation + // Check required + if (!object->IsSetType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + CustomCommandActionCardinalityCheckerRule::CustomCommandActionCardinalityCheckerRule() = default; + + void CustomCommandActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CustomCommandActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string CustomContentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector CustomContentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContent()) + { + violations.push_back( CardinalityViolation("", 0, 1, VIOLATION_TYPE::REQUIRED_SIMPLE_CONTENT) ); + } + + //Xor elements check + + return violations; + } + + + CustomContentCardinalityCheckerRule::CustomContentCardinalityCheckerRule() = default; + + void CustomContentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void CustomContentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DeterministicMultiParameterDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DeterministicMultiParameterDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDeterministicMultiParameterDistributionType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DeterministicMultiParameterDistributionCardinalityCheckerRule::DeterministicMultiParameterDistributionCardinalityCheckerRule() = default; + + void DeterministicMultiParameterDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicMultiParameterDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DeterministicMultiParameterDistributionTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DeterministicMultiParameterDistributionTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValueSetDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DeterministicMultiParameterDistributionTypeCardinalityCheckerRule::DeterministicMultiParameterDistributionTypeCardinalityCheckerRule() = default; + + void DeterministicMultiParameterDistributionTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicMultiParameterDistributionTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DeterministicParameterDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DeterministicParameterDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetDeterministicMultiParameterDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION ); + elementsDefined += object->IsSetDeterministicSingleParameterDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + DeterministicParameterDistributionCardinalityCheckerRule::DeterministicParameterDistributionCardinalityCheckerRule() = default; + + void DeterministicParameterDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicParameterDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DeterministicSingleParameterDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DeterministicSingleParameterDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDeterministicSingleParameterDistributionType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DeterministicSingleParameterDistributionCardinalityCheckerRule::DeterministicSingleParameterDistributionCardinalityCheckerRule() = default; + + void DeterministicSingleParameterDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicSingleParameterDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DeterministicSingleParameterDistributionTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DeterministicSingleParameterDistributionTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetDistributionSet()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET ); + elementsDefined += object->IsSetDistributionRange()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE ); + elementsDefined += object->IsSetUserDefinedDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + DeterministicSingleParameterDistributionTypeCardinalityCheckerRule::DeterministicSingleParameterDistributionTypeCardinalityCheckerRule() = default; + + void DeterministicSingleParameterDistributionTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicSingleParameterDistributionTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DimensionsCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DimensionsCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetHeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLength()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LENGTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetWidth()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WIDTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DimensionsCardinalityCheckerRule::DimensionsCardinalityCheckerRule() = default; + + void DimensionsCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DimensionsCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DirectionOfTravelDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DirectionOfTravelDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetOpposite()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSame()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DirectionOfTravelDistributionCardinalityCheckerRule::DirectionOfTravelDistributionCardinalityCheckerRule() = default; + + void DirectionOfTravelDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DirectionOfTravelDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DirectoryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DirectoryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPath()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PATH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DirectoryCardinalityCheckerRule::DirectoryCardinalityCheckerRule() = default; + + void DirectoryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DirectoryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DistanceConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DistanceConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DistanceConditionCardinalityCheckerRule::DistanceConditionCardinalityCheckerRule() = default; + + void DistanceConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DistanceConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DistributionDefinitionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DistributionDefinitionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetDeterministic()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DETERMINISTIC ); + elementsDefined += object->IsSetStochastic()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__STOCHASTIC ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + DistributionDefinitionCardinalityCheckerRule::DistributionDefinitionCardinalityCheckerRule() = default; + + void DistributionDefinitionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DistributionDefinitionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DistributionRangeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DistributionRangeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetStepWidth()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRange()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__RANGE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DistributionRangeCardinalityCheckerRule::DistributionRangeCardinalityCheckerRule() = default; + + void DistributionRangeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DistributionRangeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DistributionSetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DistributionSetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kElementsSize = object->GetElementsSize(); + // Check too few elements + if (kElementsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ELEMENT, 1, kElementsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + DistributionSetCardinalityCheckerRule::DistributionSetCardinalityCheckerRule() = default; + + void DistributionSetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DistributionSetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DistributionSetElementCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DistributionSetElementCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DistributionSetElementCardinalityCheckerRule::DistributionSetElementCardinalityCheckerRule() = default; + + void DistributionSetElementCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DistributionSetElementCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string DomeImageCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector DomeImageCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDomeFile()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DOME_FILE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + DomeImageCardinalityCheckerRule::DomeImageCardinalityCheckerRule() = default; + + void DomeImageCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void DomeImageCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EndOfRoadConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EndOfRoadConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDuration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DURATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EndOfRoadConditionCardinalityCheckerRule::EndOfRoadConditionCardinalityCheckerRule() = default; + + void EndOfRoadConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EndOfRoadConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAddEntityAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION ); + elementsDefined += object->IsSetDeleteEntityAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + EntityActionCardinalityCheckerRule::EntityActionCardinalityCheckerRule() = default; + + void EntityActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetEndOfRoadCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION ); + elementsDefined += object->IsSetCollisionCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION ); + elementsDefined += object->IsSetOffroadCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION ); + elementsDefined += object->IsSetTimeHeadwayCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION ); + elementsDefined += object->IsSetTimeToCollisionCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION ); + elementsDefined += object->IsSetAccelerationCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION ); + elementsDefined += object->IsSetStandStillCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION ); + elementsDefined += object->IsSetSpeedCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SPEED_CONDITION ); + elementsDefined += object->IsSetRelativeSpeedCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION ); + elementsDefined += object->IsSetTraveledDistanceCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION ); + elementsDefined += object->IsSetReachPositionCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION ); + elementsDefined += object->IsSetDistanceCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION ); + elementsDefined += object->IsSetRelativeDistanceCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION ); + elementsDefined += object->IsSetRelativeClearanceCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION ); + elementsDefined += object->IsSetAngleCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION ); + elementsDefined += object->IsSetRelativeAngleCondition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + EntityConditionCardinalityCheckerRule::EntityConditionCardinalityCheckerRule() = default; + + void EntityConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kEntityDistributionEntrySize = object->GetEntityDistributionEntrySize(); + // Check too few elements + if (kEntityDistributionEntrySize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION_ENTRY, 1, kEntityDistributionEntrySize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + EntityDistributionCardinalityCheckerRule::EntityDistributionCardinalityCheckerRule() = default; + + void EntityDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityDistributionEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityDistributionEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetScenarioObjectTemplate()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT_TEMPLATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EntityDistributionEntryCardinalityCheckerRule::EntityDistributionEntryCardinalityCheckerRule() = default; + + void EntityDistributionEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityDistributionEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityObjectCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityObjectCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + elementsDefined += object->IsSetVehicle()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VEHICLE ); + elementsDefined += object->IsSetPedestrian()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PEDESTRIAN ); + elementsDefined += object->IsSetMiscObject()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MISC_OBJECT ); + elementsDefined += object->IsSetExternalObjectReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + EntityObjectCardinalityCheckerRule::EntityObjectCardinalityCheckerRule() = default; + + void EntityObjectCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityObjectCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntityRefCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntityRefCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EntityRefCardinalityCheckerRule::EntityRefCardinalityCheckerRule() = default; + + void EntityRefCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntityRefCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EntitySelectionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EntitySelectionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetMembers()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__MEMBERS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EntitySelectionCardinalityCheckerRule::EntitySelectionCardinalityCheckerRule() = default; + + void EntitySelectionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EntitySelectionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EnvironmentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EnvironmentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EnvironmentCardinalityCheckerRule::EnvironmentCardinalityCheckerRule() = default; + + void EnvironmentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EnvironmentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EnvironmentActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EnvironmentActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetEnvironment()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENVIRONMENT ); + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + EnvironmentActionCardinalityCheckerRule::EnvironmentActionCardinalityCheckerRule() = default; + + void EnvironmentActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EnvironmentActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EnvironmentCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EnvironmentCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + EnvironmentCatalogLocationCardinalityCheckerRule::EnvironmentCatalogLocationCardinalityCheckerRule() = default; + + void EnvironmentCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EnvironmentCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string EventCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector EventCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPriority()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kActionsSize = object->GetActionsSize(); + // Check too few elements + if (kActionsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ACTION, 1, kActionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + EventCardinalityCheckerRule::EventCardinalityCheckerRule() = default; + + void EventCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void EventCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ExternalObjectReferenceCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ExternalObjectReferenceCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ExternalObjectReferenceCardinalityCheckerRule::ExternalObjectReferenceCardinalityCheckerRule() = default; + + void ExternalObjectReferenceCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ExternalObjectReferenceCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string FileCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector FileCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFilepath()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + FileCardinalityCheckerRule::FileCardinalityCheckerRule() = default; + + void FileCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void FileCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string FileHeaderCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector FileHeaderCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAuthor()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDate()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDescription()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRevMajor()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRevMinor()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + FileHeaderCardinalityCheckerRule::FileHeaderCardinalityCheckerRule() = default; + + void FileHeaderCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void FileHeaderCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string FinalSpeedCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector FinalSpeedCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAbsoluteSpeed()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED ); + elementsDefined += object->IsSetRelativeSpeedToMaster()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + FinalSpeedCardinalityCheckerRule::FinalSpeedCardinalityCheckerRule() = default; + + void FinalSpeedCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void FinalSpeedCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string FogCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector FogCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetVisualRange()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + FogCardinalityCheckerRule::FogCardinalityCheckerRule() = default; + + void FogCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void FogCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string FollowTrajectoryActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector FollowTrajectoryActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTimeReference()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TIME_REFERENCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrajectoryFollowingMode()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAJECTORY_FOLLOWING_MODE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + FollowTrajectoryActionCardinalityCheckerRule::FollowTrajectoryActionCardinalityCheckerRule() = default; + + void FollowTrajectoryActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void FollowTrajectoryActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string GearCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector GearCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetManualGear()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MANUAL_GEAR ); + elementsDefined += object->IsSetAutomaticGear()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + GearCardinalityCheckerRule::GearCardinalityCheckerRule() = default; + + void GearCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void GearCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string GlobalActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector GlobalActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetEnvironmentAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION ); + elementsDefined += object->IsSetEntityAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENTITY_ACTION ); + elementsDefined += object->IsSetInfrastructureAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION ); + elementsDefined += object->IsSetSetMonitorAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION ); + elementsDefined += object->IsSetParameterAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION ); + elementsDefined += object->IsSetTrafficAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION ); + elementsDefined += object->IsSetVariableAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + GlobalActionCardinalityCheckerRule::GlobalActionCardinalityCheckerRule() = default; + + void GlobalActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void GlobalActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string HistogramCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector HistogramCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kBinsSize = object->GetBinsSize(); + // Check too few elements + if (kBinsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__BIN, 1, kBinsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + HistogramCardinalityCheckerRule::HistogramCardinalityCheckerRule() = default; + + void HistogramCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void HistogramCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string HistogramBinCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector HistogramBinCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRange()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__RANGE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + HistogramBinCardinalityCheckerRule::HistogramBinCardinalityCheckerRule() = default; + + void HistogramBinCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void HistogramBinCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string InRoutePositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector InRoutePositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetFromCurrentEntity()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY ); + elementsDefined += object->IsSetFromRoadCoordinates()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES ); + elementsDefined += object->IsSetFromLaneCoordinates()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + InRoutePositionCardinalityCheckerRule::InRoutePositionCardinalityCheckerRule() = default; + + void InRoutePositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void InRoutePositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string InfrastructureActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector InfrastructureActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTrafficSignalAction()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_ACTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + InfrastructureActionCardinalityCheckerRule::InfrastructureActionCardinalityCheckerRule() = default; + + void InfrastructureActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void InfrastructureActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string InitCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector InitCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActions()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ACTIONS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + InitCardinalityCheckerRule::InitCardinalityCheckerRule() = default; + + void InitCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void InitCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string KnotCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector KnotCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + KnotCardinalityCheckerRule::KnotCardinalityCheckerRule() = default; + + void KnotCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void KnotCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LaneCardinalityCheckerRule::LaneCardinalityCheckerRule() = default; + + void LaneCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneChangeActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneChangeActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetLaneChangeActionDynamics()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION_DYNAMICS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLaneChangeTarget()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_TARGET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LaneChangeActionCardinalityCheckerRule::LaneChangeActionCardinalityCheckerRule() = default; + + void LaneChangeActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneChangeActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneChangeTargetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneChangeTargetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetRelativeTargetLane()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE ); + elementsDefined += object->IsSetAbsoluteTargetLane()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + LaneChangeTargetCardinalityCheckerRule::LaneChangeTargetCardinalityCheckerRule() = default; + + void LaneChangeTargetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneChangeTargetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneOffsetActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneOffsetActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContinuous()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLaneOffsetActionDynamics()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION_DYNAMICS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLaneOffsetTarget()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_TARGET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LaneOffsetActionCardinalityCheckerRule::LaneOffsetActionCardinalityCheckerRule() = default; + + void LaneOffsetActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneOffsetActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneOffsetActionDynamicsCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneOffsetActionDynamicsCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDynamicsShape()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LaneOffsetActionDynamicsCardinalityCheckerRule::LaneOffsetActionDynamicsCardinalityCheckerRule() = default; + + void LaneOffsetActionDynamicsCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneOffsetActionDynamicsCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LaneOffsetTargetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LaneOffsetTargetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetRelativeTargetLaneOffset()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET ); + elementsDefined += object->IsSetAbsoluteTargetLaneOffset()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + LaneOffsetTargetCardinalityCheckerRule::LaneOffsetTargetCardinalityCheckerRule() = default; + + void LaneOffsetTargetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LaneOffsetTargetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LanePositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LanePositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetLaneId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRoadId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetS()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__S, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LanePositionCardinalityCheckerRule::LanePositionCardinalityCheckerRule() = default; + + void LanePositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LanePositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LateralActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LateralActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetLaneChangeAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION ); + elementsDefined += object->IsSetLaneOffsetAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION ); + elementsDefined += object->IsSetLateralDistanceAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + LateralActionCardinalityCheckerRule::LateralActionCardinalityCheckerRule() = default; + + void LateralActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LateralActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LateralDistanceActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LateralDistanceActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContinuous()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LateralDistanceActionCardinalityCheckerRule::LateralDistanceActionCardinalityCheckerRule() = default; + + void LateralDistanceActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LateralDistanceActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LicenseCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LicenseCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LicenseCardinalityCheckerRule::LicenseCardinalityCheckerRule() = default; + + void LicenseCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LicenseCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LightStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LightStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMode()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MODE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LightStateCardinalityCheckerRule::LightStateCardinalityCheckerRule() = default; + + void LightStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LightStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LightStateActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LightStateActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetLightType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LIGHT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetLightState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__LIGHT_STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LightStateActionCardinalityCheckerRule::LightStateActionCardinalityCheckerRule() = default; + + void LightStateActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LightStateActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LightTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LightTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetVehicleLight()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT ); + elementsDefined += object->IsSetUserDefinedLight()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + LightTypeCardinalityCheckerRule::LightTypeCardinalityCheckerRule() = default; + + void LightTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LightTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LogNormalDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LogNormalDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetExpectedValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVariance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LogNormalDistributionCardinalityCheckerRule::LogNormalDistributionCardinalityCheckerRule() = default; + + void LogNormalDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LogNormalDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LongitudinalActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LongitudinalActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetSpeedAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SPEED_ACTION ); + elementsDefined += object->IsSetLongitudinalDistanceAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION ); + elementsDefined += object->IsSetSpeedProfileAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + LongitudinalActionCardinalityCheckerRule::LongitudinalActionCardinalityCheckerRule() = default; + + void LongitudinalActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LongitudinalActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string LongitudinalDistanceActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector LongitudinalDistanceActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContinuous()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + LongitudinalDistanceActionCardinalityCheckerRule::LongitudinalDistanceActionCardinalityCheckerRule() = default; + + void LongitudinalDistanceActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void LongitudinalDistanceActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ManeuverCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ManeuverCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kEventsSize = object->GetEventsSize(); + // Check too few elements + if (kEventsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__EVENT, 1, kEventsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ManeuverCardinalityCheckerRule::ManeuverCardinalityCheckerRule() = default; + + void ManeuverCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ManeuverCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ManeuverCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ManeuverCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ManeuverCatalogLocationCardinalityCheckerRule::ManeuverCatalogLocationCardinalityCheckerRule() = default; + + void ManeuverCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ManeuverCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ManeuverGroupCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ManeuverGroupCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMaximumExecutionCount()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetActors()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ACTORS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ManeuverGroupCardinalityCheckerRule::ManeuverGroupCardinalityCheckerRule() = default; + + void ManeuverGroupCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ManeuverGroupCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ManualGearCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ManualGearCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetNumber()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NUMBER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ManualGearCardinalityCheckerRule::ManualGearCardinalityCheckerRule() = default; + + void ManualGearCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ManualGearCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string MiscObjectCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector MiscObjectCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMass()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MASS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetMiscObjectCategory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetBoundingBox()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + MiscObjectCardinalityCheckerRule::MiscObjectCardinalityCheckerRule() = default; + + void MiscObjectCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void MiscObjectCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string MiscObjectCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector MiscObjectCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + MiscObjectCatalogLocationCardinalityCheckerRule::MiscObjectCatalogLocationCardinalityCheckerRule() = default; + + void MiscObjectCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void MiscObjectCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ModifyRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ModifyRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAddValue()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ADD_VALUE ); + elementsDefined += object->IsSetMultiplyByValue()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ModifyRuleCardinalityCheckerRule::ModifyRuleCardinalityCheckerRule() = default; + + void ModifyRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ModifyRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string MonitorDeclarationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector MonitorDeclarationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + MonitorDeclarationCardinalityCheckerRule::MonitorDeclarationCardinalityCheckerRule() = default; + + void MonitorDeclarationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void MonitorDeclarationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string NormalDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector NormalDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetExpectedValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVariance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + NormalDistributionCardinalityCheckerRule::NormalDistributionCardinalityCheckerRule() = default; + + void NormalDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void NormalDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string NurbsCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector NurbsCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetOrder()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ORDER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kControlPointsSize = object->GetControlPointsSize(); + // Check too few elements + if (kControlPointsSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CONTROL_POINT, 2, kControlPointsSize, VIOLATION_TYPE::TOO_FEW) ); + } + // Check violation + const auto kKnotsSize = object->GetKnotsSize(); + // Check too few elements + if (kKnotsSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__KNOT, 2, kKnotsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + NurbsCardinalityCheckerRule::NurbsCardinalityCheckerRule() = default; + + void NurbsCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void NurbsCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ObjectControllerCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ObjectControllerCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + elementsDefined += object->IsSetController()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CONTROLLER ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ObjectControllerCardinalityCheckerRule::ObjectControllerCardinalityCheckerRule() = default; + + void ObjectControllerCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ObjectControllerCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OffroadConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OffroadConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDuration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DURATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OffroadConditionCardinalityCheckerRule::OffroadConditionCardinalityCheckerRule() = default; + + void OffroadConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OffroadConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OpenScenarioCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OpenScenarioCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFileHeader()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__FILE_HEADER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetOpenScenarioCategory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__OPEN_SCENARIO_CATEGORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OpenScenarioCardinalityCheckerRule::OpenScenarioCardinalityCheckerRule() = default; + + void OpenScenarioCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OpenScenarioCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OpenScenarioCategoryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OpenScenarioCategoryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetScenarioDefinition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SCENARIO_DEFINITION ); + elementsDefined += object->IsSetCatalogDefinition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_DEFINITION ); + elementsDefined += object->IsSetParameterValueDistributionDefinition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION_DEFINITION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + OpenScenarioCategoryCardinalityCheckerRule::OpenScenarioCategoryCardinalityCheckerRule() = default; + + void OpenScenarioCategoryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OpenScenarioCategoryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideBrakeActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideBrakeActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideBrakeActionCardinalityCheckerRule::OverrideBrakeActionCardinalityCheckerRule() = default; + + void OverrideBrakeActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideBrakeActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideClutchActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideClutchActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideClutchActionCardinalityCheckerRule::OverrideClutchActionCardinalityCheckerRule() = default; + + void OverrideClutchActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideClutchActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideGearActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideGearActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideGearActionCardinalityCheckerRule::OverrideGearActionCardinalityCheckerRule() = default; + + void OverrideGearActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideGearActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideParkingBrakeActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideParkingBrakeActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideParkingBrakeActionCardinalityCheckerRule::OverrideParkingBrakeActionCardinalityCheckerRule() = default; + + void OverrideParkingBrakeActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideParkingBrakeActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideSteeringWheelActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideSteeringWheelActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideSteeringWheelActionCardinalityCheckerRule::OverrideSteeringWheelActionCardinalityCheckerRule() = default; + + void OverrideSteeringWheelActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideSteeringWheelActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string OverrideThrottleActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector OverrideThrottleActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetActive()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + OverrideThrottleActionCardinalityCheckerRule::OverrideThrottleActionCardinalityCheckerRule() = default; + + void OverrideThrottleActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void OverrideThrottleActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetSetAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SET_ACTION ); + elementsDefined += object->IsSetModifyAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MODIFY_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ParameterActionCardinalityCheckerRule::ParameterActionCardinalityCheckerRule() = default; + + void ParameterActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterAddValueRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterAddValueRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterAddValueRuleCardinalityCheckerRule::ParameterAddValueRuleCardinalityCheckerRule() = default; + + void ParameterAddValueRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterAddValueRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterAssignmentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterAssignmentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterAssignmentCardinalityCheckerRule::ParameterAssignmentCardinalityCheckerRule() = default; + + void ParameterAssignmentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterAssignmentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterConditionCardinalityCheckerRule::ParameterConditionCardinalityCheckerRule() = default; + + void ParameterConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterDeclarationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterDeclarationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetParameterType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterDeclarationCardinalityCheckerRule::ParameterDeclarationCardinalityCheckerRule() = default; + + void ParameterDeclarationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterDeclarationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterModifyActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterModifyActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterModifyActionCardinalityCheckerRule::ParameterModifyActionCardinalityCheckerRule() = default; + + void ParameterModifyActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterModifyActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterMultiplyByValueRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterMultiplyByValueRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterMultiplyByValueRuleCardinalityCheckerRule::ParameterMultiplyByValueRuleCardinalityCheckerRule() = default; + + void ParameterMultiplyByValueRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterMultiplyByValueRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterSetActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterSetActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterSetActionCardinalityCheckerRule::ParameterSetActionCardinalityCheckerRule() = default; + + void ParameterSetActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterSetActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterValueDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterValueDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetScenarioFile()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SCENARIO_FILE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDistributionDefinition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_DEFINITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterValueDistributionCardinalityCheckerRule::ParameterValueDistributionCardinalityCheckerRule() = default; + + void ParameterValueDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterValueDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterValueDistributionDefinitionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterValueDistributionDefinitionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterValueDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ParameterValueDistributionDefinitionCardinalityCheckerRule::ParameterValueDistributionDefinitionCardinalityCheckerRule() = default; + + void ParameterValueDistributionDefinitionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterValueDistributionDefinitionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ParameterValueSetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ParameterValueSetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kParameterAssignmentsSize = object->GetParameterAssignmentsSize(); + // Check too few elements + if (kParameterAssignmentsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT, 1, kParameterAssignmentsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ParameterValueSetCardinalityCheckerRule::ParameterValueSetCardinalityCheckerRule() = default; + + void ParameterValueSetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ParameterValueSetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PedestrianCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PedestrianCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMass()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MASS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPedestrianCategory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetBoundingBox()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PedestrianCardinalityCheckerRule::PedestrianCardinalityCheckerRule() = default; + + void PedestrianCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PedestrianCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PedestrianCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PedestrianCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PedestrianCatalogLocationCardinalityCheckerRule::PedestrianCatalogLocationCardinalityCheckerRule() = default; + + void PedestrianCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PedestrianCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PedestrianGestureCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PedestrianGestureCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetGesture()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__GESTURE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PedestrianGestureCardinalityCheckerRule::PedestrianGestureCardinalityCheckerRule() = default; + + void PedestrianGestureCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PedestrianGestureCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PerformanceCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PerformanceCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMaxAcceleration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetMaxDeceleration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetMaxSpeed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PerformanceCardinalityCheckerRule::PerformanceCardinalityCheckerRule() = default; + + void PerformanceCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PerformanceCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PhaseCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PhaseCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDuration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DURATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PhaseCardinalityCheckerRule::PhaseCardinalityCheckerRule() = default; + + void PhaseCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PhaseCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PoissonDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PoissonDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetExpectedValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PoissonDistributionCardinalityCheckerRule::PoissonDistributionCardinalityCheckerRule() = default; + + void PoissonDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PoissonDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PolygonCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PolygonCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kPositionsSize = object->GetPositionsSize(); + // Check too few elements + if (kPositionsSize < 3) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 3, kPositionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + PolygonCardinalityCheckerRule::PolygonCardinalityCheckerRule() = default; + + void PolygonCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PolygonCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PolylineCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PolylineCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kVerticesSize = object->GetVerticesSize(); + // Check too few elements + if (kVerticesSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VERTEX, 2, kVerticesSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + PolylineCardinalityCheckerRule::PolylineCardinalityCheckerRule() = default; + + void PolylineCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PolylineCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetWorldPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__WORLD_POSITION ); + elementsDefined += object->IsSetRelativeWorldPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION ); + elementsDefined += object->IsSetRelativeObjectPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION ); + elementsDefined += object->IsSetRoadPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROAD_POSITION ); + elementsDefined += object->IsSetRelativeRoadPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION ); + elementsDefined += object->IsSetLanePosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LANE_POSITION ); + elementsDefined += object->IsSetRelativeLanePosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION ); + elementsDefined += object->IsSetRoutePosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROUTE_POSITION ); + elementsDefined += object->IsSetGeoPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__GEO_POSITION ); + elementsDefined += object->IsSetTrajectoryPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + PositionCardinalityCheckerRule::PositionCardinalityCheckerRule() = default; + + void PositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PositionInLaneCoordinatesCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PositionInLaneCoordinatesCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetLaneId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPathS()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PATH_S, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PositionInLaneCoordinatesCardinalityCheckerRule::PositionInLaneCoordinatesCardinalityCheckerRule() = default; + + void PositionInLaneCoordinatesCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PositionInLaneCoordinatesCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PositionInRoadCoordinatesCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PositionInRoadCoordinatesCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPathS()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PATH_S, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetT()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__T, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PositionInRoadCoordinatesCardinalityCheckerRule::PositionInRoadCoordinatesCardinalityCheckerRule() = default; + + void PositionInRoadCoordinatesCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PositionInRoadCoordinatesCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PositionOfCurrentEntityCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PositionOfCurrentEntityCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PositionOfCurrentEntityCardinalityCheckerRule::PositionOfCurrentEntityCardinalityCheckerRule() = default; + + void PositionOfCurrentEntityCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PositionOfCurrentEntityCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PrecipitationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PrecipitationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPrecipitationType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PrecipitationCardinalityCheckerRule::PrecipitationCardinalityCheckerRule() = default; + + void PrecipitationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PrecipitationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PrivateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PrivateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kPrivateActionsSize = object->GetPrivateActionsSize(); + // Check too few elements + if (kPrivateActionsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION, 1, kPrivateActionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + PrivateCardinalityCheckerRule::PrivateCardinalityCheckerRule() = default; + + void PrivateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PrivateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PrivateActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PrivateActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetLongitudinalAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION ); + elementsDefined += object->IsSetLateralAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LATERAL_ACTION ); + elementsDefined += object->IsSetVisibilityAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION ); + elementsDefined += object->IsSetSynchronizeAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION ); + elementsDefined += object->IsSetActivateControllerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION ); + elementsDefined += object->IsSetControllerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION ); + elementsDefined += object->IsSetTeleportAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION ); + elementsDefined += object->IsSetRoutingAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROUTING_ACTION ); + elementsDefined += object->IsSetAppearanceAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION ); + elementsDefined += object->IsSetTrailerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAILER_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + PrivateActionCardinalityCheckerRule::PrivateActionCardinalityCheckerRule() = default; + + void PrivateActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PrivateActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ProbabilityDistributionSetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ProbabilityDistributionSetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kElementsSize = object->GetElementsSize(); + // Check too few elements + if (kElementsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ELEMENT, 1, kElementsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ProbabilityDistributionSetCardinalityCheckerRule::ProbabilityDistributionSetCardinalityCheckerRule() = default; + + void ProbabilityDistributionSetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ProbabilityDistributionSetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ProbabilityDistributionSetElementCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ProbabilityDistributionSetElementCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ProbabilityDistributionSetElementCardinalityCheckerRule::ProbabilityDistributionSetElementCardinalityCheckerRule() = default; + + void ProbabilityDistributionSetElementCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ProbabilityDistributionSetElementCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string PropertyCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector PropertyCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + PropertyCardinalityCheckerRule::PropertyCardinalityCheckerRule() = default; + + void PropertyCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void PropertyCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RangeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RangeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetLowerLimit()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetUpperLimit()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RangeCardinalityCheckerRule::RangeCardinalityCheckerRule() = default; + + void RangeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RangeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ReachPositionConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ReachPositionConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTolerance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ReachPositionConditionCardinalityCheckerRule::ReachPositionConditionCardinalityCheckerRule() = default; + + void ReachPositionConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ReachPositionConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeAngleConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeAngleConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAngle()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetAngleTolerance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetAngleType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeAngleConditionCardinalityCheckerRule::RelativeAngleConditionCardinalityCheckerRule() = default; + + void RelativeAngleConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeAngleConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeClearanceConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeClearanceConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFreeSpace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetOppositeLanes()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeClearanceConditionCardinalityCheckerRule::RelativeClearanceConditionCardinalityCheckerRule() = default; + + void RelativeClearanceConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeClearanceConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeDistanceConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeDistanceConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRelativeDistanceType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeDistanceConditionCardinalityCheckerRule::RelativeDistanceConditionCardinalityCheckerRule() = default; + + void RelativeDistanceConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeDistanceConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeLanePositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeLanePositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDLane()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__D_LANE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeLanePositionCardinalityCheckerRule::RelativeLanePositionCardinalityCheckerRule() = default; + + void RelativeLanePositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeLanePositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeObjectPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeObjectPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDx()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDy()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeObjectPositionCardinalityCheckerRule::RelativeObjectPositionCardinalityCheckerRule() = default; + + void RelativeObjectPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeObjectPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeRoadPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeRoadPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDs()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDt()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeRoadPositionCardinalityCheckerRule::RelativeRoadPositionCardinalityCheckerRule() = default; + + void RelativeRoadPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeRoadPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeSpeedConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeSpeedConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeSpeedConditionCardinalityCheckerRule::RelativeSpeedConditionCardinalityCheckerRule() = default; + + void RelativeSpeedConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeSpeedConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeSpeedToMasterCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeSpeedToMasterCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetSpeedTargetValueType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeSpeedToMasterCardinalityCheckerRule::RelativeSpeedToMasterCardinalityCheckerRule() = default; + + void RelativeSpeedToMasterCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeSpeedToMasterCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeTargetLaneCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeTargetLaneCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeTargetLaneCardinalityCheckerRule::RelativeTargetLaneCardinalityCheckerRule() = default; + + void RelativeTargetLaneCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeTargetLaneCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeTargetLaneOffsetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeTargetLaneOffsetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeTargetLaneOffsetCardinalityCheckerRule::RelativeTargetLaneOffsetCardinalityCheckerRule() = default; + + void RelativeTargetLaneOffsetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeTargetLaneOffsetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeTargetSpeedCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeTargetSpeedCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContinuous()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSpeedTargetValueType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeTargetSpeedCardinalityCheckerRule::RelativeTargetSpeedCardinalityCheckerRule() = default; + + void RelativeTargetSpeedCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeTargetSpeedCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RelativeWorldPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RelativeWorldPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDx()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDy()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RelativeWorldPositionCardinalityCheckerRule::RelativeWorldPositionCardinalityCheckerRule() = default; + + void RelativeWorldPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RelativeWorldPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoadConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoadConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFrictionScaleFactor()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RoadConditionCardinalityCheckerRule::RoadConditionCardinalityCheckerRule() = default; + + void RoadConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoadConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoadCursorCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoadCursorCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRoadId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RoadCursorCardinalityCheckerRule::RoadCursorCardinalityCheckerRule() = default; + + void RoadCursorCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoadCursorCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoadPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoadPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRoadId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetS()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__S, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetT()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__T, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RoadPositionCardinalityCheckerRule::RoadPositionCardinalityCheckerRule() = default; + + void RoadPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoadPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoadRangeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoadRangeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kRoadCursorSize = object->GetRoadCursorSize(); + // Check too few elements + if (kRoadCursorSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ROAD_CURSOR, 2, kRoadCursorSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + RoadRangeCardinalityCheckerRule::RoadRangeCardinalityCheckerRule() = default; + + void RoadRangeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoadRangeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RouteCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RouteCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetClosed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CLOSED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kWaypointsSize = object->GetWaypointsSize(); + // Check too few elements + if (kWaypointsSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__WAYPOINT, 2, kWaypointsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + RouteCardinalityCheckerRule::RouteCardinalityCheckerRule() = default; + + void RouteCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RouteCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RouteCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RouteCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RouteCatalogLocationCardinalityCheckerRule::RouteCatalogLocationCardinalityCheckerRule() = default; + + void RouteCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RouteCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoutePositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoutePositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRouteRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ROUTE_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetInRoutePosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__IN_ROUTE_POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + RoutePositionCardinalityCheckerRule::RoutePositionCardinalityCheckerRule() = default; + + void RoutePositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoutePositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RouteRefCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RouteRefCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetRoute()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROUTE ); + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + RouteRefCardinalityCheckerRule::RouteRefCardinalityCheckerRule() = default; + + void RouteRefCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RouteRefCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string RoutingActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector RoutingActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAssignRouteAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION ); + elementsDefined += object->IsSetFollowTrajectoryAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION ); + elementsDefined += object->IsSetAcquirePositionAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION ); + elementsDefined += object->IsSetRandomRouteAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + RoutingActionCardinalityCheckerRule::RoutingActionCardinalityCheckerRule() = default; + + void RoutingActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void RoutingActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ScenarioDefinitionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ScenarioDefinitionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCatalogLocations()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRoadNetwork()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ROAD_NETWORK, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntities()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITIES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetStoryboard()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__STORYBOARD, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ScenarioDefinitionCardinalityCheckerRule::ScenarioDefinitionCardinalityCheckerRule() = default; + + void ScenarioDefinitionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ScenarioDefinitionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ScenarioObjectCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ScenarioObjectCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityObject()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITY_OBJECT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ScenarioObjectCardinalityCheckerRule::ScenarioObjectCardinalityCheckerRule() = default; + + void ScenarioObjectCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ScenarioObjectCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ScenarioObjectTemplateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ScenarioObjectTemplateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntitiyObject()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITIY_OBJECT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ScenarioObjectTemplateCardinalityCheckerRule::ScenarioObjectTemplateCardinalityCheckerRule() = default; + + void ScenarioObjectTemplateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ScenarioObjectTemplateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SelectedEntitiesCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SelectedEntitiesCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetEntityRef()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENTITY_REF ); + elementsDefined += object->IsSetByType()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__BY_TYPE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + SelectedEntitiesCardinalityCheckerRule::SelectedEntitiesCardinalityCheckerRule() = default; + + void SelectedEntitiesCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SelectedEntitiesCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SensorReferenceCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SensorReferenceCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SensorReferenceCardinalityCheckerRule::SensorReferenceCardinalityCheckerRule() = default; + + void SensorReferenceCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SensorReferenceCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SensorReferenceSetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SensorReferenceSetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kSensorReferencesSize = object->GetSensorReferencesSize(); + // Check too few elements + if (kSensorReferencesSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE, 1, kSensorReferencesSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + SensorReferenceSetCardinalityCheckerRule::SensorReferenceSetCardinalityCheckerRule() = default; + + void SensorReferenceSetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SensorReferenceSetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SetMonitorActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SetMonitorActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMonitorRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SetMonitorActionCardinalityCheckerRule::SetMonitorActionCardinalityCheckerRule() = default; + + void SetMonitorActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SetMonitorActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ShapeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ShapeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetPolyline()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__POLYLINE ); + elementsDefined += object->IsSetClothoid()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CLOTHOID ); + elementsDefined += object->IsSetClothoidSpline()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE ); + elementsDefined += object->IsSetNurbs()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__NURBS ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + ShapeCardinalityCheckerRule::ShapeCardinalityCheckerRule() = default; + + void ShapeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ShapeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SimulationTimeConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SimulationTimeConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SimulationTimeConditionCardinalityCheckerRule::SimulationTimeConditionCardinalityCheckerRule() = default; + + void SimulationTimeConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SimulationTimeConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SpeedActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SpeedActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetSpeedActionDynamics()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SPEED_ACTION_DYNAMICS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSpeedActionTarget()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SPEED_ACTION_TARGET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SpeedActionCardinalityCheckerRule::SpeedActionCardinalityCheckerRule() = default; + + void SpeedActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SpeedActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SpeedActionTargetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SpeedActionTargetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetRelativeTargetSpeed()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED ); + elementsDefined += object->IsSetAbsoluteTargetSpeed()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + SpeedActionTargetCardinalityCheckerRule::SpeedActionTargetCardinalityCheckerRule() = default; + + void SpeedActionTargetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SpeedActionTargetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SpeedConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SpeedConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SpeedConditionCardinalityCheckerRule::SpeedConditionCardinalityCheckerRule() = default; + + void SpeedConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SpeedConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SpeedProfileActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SpeedProfileActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFollowingMode()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kSpeedProfileEntrySize = object->GetSpeedProfileEntrySize(); + // Check too few elements + if (kSpeedProfileEntrySize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ENTRY, 1, kSpeedProfileEntrySize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + SpeedProfileActionCardinalityCheckerRule::SpeedProfileActionCardinalityCheckerRule() = default; + + void SpeedProfileActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SpeedProfileActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SpeedProfileEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SpeedProfileEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetSpeed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SPEED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SpeedProfileEntryCardinalityCheckerRule::SpeedProfileEntryCardinalityCheckerRule() = default; + + void SpeedProfileEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SpeedProfileEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StandStillConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StandStillConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDuration()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DURATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + StandStillConditionCardinalityCheckerRule::StandStillConditionCardinalityCheckerRule() = default; + + void StandStillConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StandStillConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SteadyStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SteadyStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetTargetDistanceSteadyState()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE ); + elementsDefined += object->IsSetTargetTimeSteadyState()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + SteadyStateCardinalityCheckerRule::SteadyStateCardinalityCheckerRule() = default; + + void SteadyStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SteadyStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StochasticCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StochasticCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetNumberOfTestRuns()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kStochasticDistributionsSize = object->GetStochasticDistributionsSize(); + // Check too few elements + if (kStochasticDistributionsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION, 1, kStochasticDistributionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + StochasticCardinalityCheckerRule::StochasticCardinalityCheckerRule() = default; + + void StochasticCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StochasticCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StochasticDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StochasticDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetParameterName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetStochasticDistributionType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + StochasticDistributionCardinalityCheckerRule::StochasticDistributionCardinalityCheckerRule() = default; + + void StochasticDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StochasticDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StochasticDistributionTypeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StochasticDistributionTypeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetProbabilityDistributionSet()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET ); + elementsDefined += object->IsSetNormalDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION ); + elementsDefined += object->IsSetLogNormalDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION ); + elementsDefined += object->IsSetUniformDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION ); + elementsDefined += object->IsSetPoissonDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION ); + elementsDefined += object->IsSetHistogram()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__HISTOGRAM ); + elementsDefined += object->IsSetUserDefinedDistribution()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + StochasticDistributionTypeCardinalityCheckerRule::StochasticDistributionTypeCardinalityCheckerRule() = default; + + void StochasticDistributionTypeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StochasticDistributionTypeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StoryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StoryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kActsSize = object->GetActsSize(); + // Check too few elements + if (kActsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ACT, 1, kActsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + StoryCardinalityCheckerRule::StoryCardinalityCheckerRule() = default; + + void StoryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StoryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StoryboardCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StoryboardCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetInit()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__INIT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + StoryboardCardinalityCheckerRule::StoryboardCardinalityCheckerRule() = default; + + void StoryboardCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StoryboardCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string StoryboardElementStateConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector StoryboardElementStateConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetStoryboardElementRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetStoryboardElementType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + StoryboardElementStateConditionCardinalityCheckerRule::StoryboardElementStateConditionCardinalityCheckerRule() = default; + + void StoryboardElementStateConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void StoryboardElementStateConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SunCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SunCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAzimuth()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetElevation()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SunCardinalityCheckerRule::SunCardinalityCheckerRule() = default; + + void SunCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SunCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string SynchronizeActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector SynchronizeActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetMasterEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTargetPositionMaster()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TARGET_POSITION_MASTER, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTargetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TARGET_POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + SynchronizeActionCardinalityCheckerRule::SynchronizeActionCardinalityCheckerRule() = default; + + void SynchronizeActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void SynchronizeActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TargetDistanceSteadyStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TargetDistanceSteadyStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDistance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TargetDistanceSteadyStateCardinalityCheckerRule::TargetDistanceSteadyStateCardinalityCheckerRule() = default; + + void TargetDistanceSteadyStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TargetDistanceSteadyStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TargetTimeSteadyStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TargetTimeSteadyStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTime()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TIME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TargetTimeSteadyStateCardinalityCheckerRule::TargetTimeSteadyStateCardinalityCheckerRule() = default; + + void TargetTimeSteadyStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TargetTimeSteadyStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TeleportActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TeleportActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TeleportActionCardinalityCheckerRule::TeleportActionCardinalityCheckerRule() = default; + + void TeleportActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TeleportActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeHeadwayConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeHeadwayConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetEntityRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TimeHeadwayConditionCardinalityCheckerRule::TimeHeadwayConditionCardinalityCheckerRule() = default; + + void TimeHeadwayConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeHeadwayConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeOfDayCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeOfDayCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetAnimation()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDateTime()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TimeOfDayCardinalityCheckerRule::TimeOfDayCardinalityCheckerRule() = default; + + void TimeOfDayCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeOfDayCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeOfDayConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeOfDayConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDateTime()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TimeOfDayConditionCardinalityCheckerRule::TimeOfDayConditionCardinalityCheckerRule() = default; + + void TimeOfDayConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeOfDayConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeReferenceCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeReferenceCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetNone()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__NONE ); + elementsDefined += object->IsSetTiming()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TIMING ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TimeReferenceCardinalityCheckerRule::TimeReferenceCardinalityCheckerRule() = default; + + void TimeReferenceCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeReferenceCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeToCollisionConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeToCollisionConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFreespace()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTimeToCollisionConditionTarget()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TimeToCollisionConditionCardinalityCheckerRule::TimeToCollisionConditionCardinalityCheckerRule() = default; + + void TimeToCollisionConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeToCollisionConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimeToCollisionConditionTargetCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimeToCollisionConditionTargetCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetPosition()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__POSITION ); + elementsDefined += object->IsSetEntityRef()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ENTITY_REF ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TimeToCollisionConditionTargetCardinalityCheckerRule::TimeToCollisionConditionTargetCardinalityCheckerRule() = default; + + void TimeToCollisionConditionTargetCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimeToCollisionConditionTargetCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TimingCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TimingCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDomainAbsoluteRelative()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetOffset()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__OFFSET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetScale()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SCALE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TimingCardinalityCheckerRule::TimingCardinalityCheckerRule() = default; + + void TimingCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TimingCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetTrafficSourceAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION ); + elementsDefined += object->IsSetTrafficSinkAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION ); + elementsDefined += object->IsSetTrafficSwarmAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION ); + elementsDefined += object->IsSetTrafficAreaAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION ); + elementsDefined += object->IsSetTrafficStopAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrafficActionCardinalityCheckerRule::TrafficActionCardinalityCheckerRule() = default; + + void TrafficActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficAreaCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficAreaCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetPolygon()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__POLYGON ); + elementsDefined += object->IsSetRoadRange()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ROAD_RANGE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrafficAreaCardinalityCheckerRule::TrafficAreaCardinalityCheckerRule() = default; + + void TrafficAreaCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficAreaCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficAreaActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficAreaActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContinuous()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetNumberOfEntities()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrafficDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrafficArea()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficAreaActionCardinalityCheckerRule::TrafficAreaActionCardinalityCheckerRule() = default; + + void TrafficAreaActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficAreaActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficDefinitionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficDefinitionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVehicleCategoryDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetControllerDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficDefinitionCardinalityCheckerRule::TrafficDefinitionCardinalityCheckerRule() = default; + + void TrafficDefinitionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficDefinitionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kTrafficDistributionEntrySize = object->GetTrafficDistributionEntrySize(); + // Check too few elements + if (kTrafficDistributionEntrySize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY, 1, kTrafficDistributionEntrySize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + TrafficDistributionCardinalityCheckerRule::TrafficDistributionCardinalityCheckerRule() = default; + + void TrafficDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficDistributionEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficDistributionEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetEntityDistribution()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficDistributionEntryCardinalityCheckerRule::TrafficDistributionEntryCardinalityCheckerRule() = default; + + void TrafficDistributionEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficDistributionEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetTrafficSignalControllerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION ); + elementsDefined += object->IsSetTrafficSignalStateAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrafficSignalActionCardinalityCheckerRule::TrafficSignalActionCardinalityCheckerRule() = default; + + void TrafficSignalActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalConditionCardinalityCheckerRule::TrafficSignalConditionCardinalityCheckerRule() = default; + + void TrafficSignalConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalControllerCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalControllerCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalControllerCardinalityCheckerRule::TrafficSignalControllerCardinalityCheckerRule() = default; + + void TrafficSignalControllerCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalControllerCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalControllerActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalControllerActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPhase()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PHASE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrafficSignalControllerRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalControllerActionCardinalityCheckerRule::TrafficSignalControllerActionCardinalityCheckerRule() = default; + + void TrafficSignalControllerActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalControllerActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalControllerConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalControllerConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPhase()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__PHASE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrafficSignalControllerRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalControllerConditionCardinalityCheckerRule::TrafficSignalControllerConditionCardinalityCheckerRule() = default; + + void TrafficSignalControllerConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalControllerConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalGroupStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalGroupStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalGroupStateCardinalityCheckerRule::TrafficSignalGroupStateCardinalityCheckerRule() = default; + + void TrafficSignalGroupStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalGroupStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalStateCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalStateCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrafficSignalId()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalStateCardinalityCheckerRule::TrafficSignalStateCardinalityCheckerRule() = default; + + void TrafficSignalStateCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalStateCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSignalStateActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSignalStateActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetState()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__STATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSignalStateActionCardinalityCheckerRule::TrafficSignalStateActionCardinalityCheckerRule() = default; + + void TrafficSignalStateActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalStateActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSinkActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSinkActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRadius()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RADIUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSinkActionCardinalityCheckerRule::TrafficSinkActionCardinalityCheckerRule() = default; + + void TrafficSinkActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSinkActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSourceActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSourceActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRadius()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RADIUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRate()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RATE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSourceActionCardinalityCheckerRule::TrafficSourceActionCardinalityCheckerRule() = default; + + void TrafficSourceActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSourceActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrafficSwarmActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrafficSwarmActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetInnerRadius()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetNumberOfVehicles()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetOffset()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__OFFSET, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSemiMajorAxis()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSemiMinorAxis()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetCentralObject()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CENTRAL_OBJECT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrafficSwarmActionCardinalityCheckerRule::TrafficSwarmActionCardinalityCheckerRule() = default; + + void TrafficSwarmActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSwarmActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrailerCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrailerCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetTrailer()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAILER ); + elementsDefined += object->IsSetTrailerRef()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAILER_REF ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrailerCardinalityCheckerRule::TrailerCardinalityCheckerRule() = default; + + void TrailerCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrailerCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrailerActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrailerActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetConnectTrailerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CONNECT_TRAILER_ACTION ); + elementsDefined += object->IsSetDisconnectTrailerAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__DISCONNECT_TRAILER_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrailerActionCardinalityCheckerRule::TrailerActionCardinalityCheckerRule() = default; + + void TrailerActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrailerActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrailerCouplerCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrailerCouplerCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDx()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrailerCouplerCardinalityCheckerRule::TrailerCouplerCardinalityCheckerRule() = default; + + void TrailerCouplerCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrailerCouplerCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrailerHitchCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrailerHitchCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDx()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrailerHitchCardinalityCheckerRule::TrailerHitchCardinalityCheckerRule() = default; + + void TrailerHitchCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrailerHitchCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrajectoryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrajectoryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetClosed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CLOSED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetShape()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__SHAPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrajectoryCardinalityCheckerRule::TrajectoryCardinalityCheckerRule() = default; + + void TrajectoryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrajectoryCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrajectoryCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrajectoryCatalogLocationCardinalityCheckerRule::TrajectoryCatalogLocationCardinalityCheckerRule() = default; + + void TrajectoryCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrajectoryFollowingModeCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrajectoryFollowingModeCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetFollowingMode()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrajectoryFollowingModeCardinalityCheckerRule::TrajectoryFollowingModeCardinalityCheckerRule() = default; + + void TrajectoryFollowingModeCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryFollowingModeCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrajectoryPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrajectoryPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetS()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__S, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTrajectoryRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TrajectoryPositionCardinalityCheckerRule::TrajectoryPositionCardinalityCheckerRule() = default; + + void TrajectoryPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TrajectoryRefCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TrajectoryRefCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetTrajectory()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__TRAJECTORY ); + elementsDefined += object->IsSetCatalogReference()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + TrajectoryRefCardinalityCheckerRule::TrajectoryRefCardinalityCheckerRule() = default; + + void TrajectoryRefCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryRefCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TransitionDynamicsCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TransitionDynamicsCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDynamicsDimension()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetDynamicsShape()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TransitionDynamicsCardinalityCheckerRule::TransitionDynamicsCardinalityCheckerRule() = default; + + void TransitionDynamicsCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TransitionDynamicsCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TraveledDistanceConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TraveledDistanceConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + TraveledDistanceConditionCardinalityCheckerRule::TraveledDistanceConditionCardinalityCheckerRule() = default; + + void TraveledDistanceConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TraveledDistanceConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string TriggeringEntitiesCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector TriggeringEntitiesCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetTriggeringEntitiesRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + const auto kEntityRefsSize = object->GetEntityRefsSize(); + // Check too few elements + if (kEntityRefsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__ENTITY_REF, 1, kEntityRefsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + TriggeringEntitiesCardinalityCheckerRule::TriggeringEntitiesCardinalityCheckerRule() = default; + + void TriggeringEntitiesCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void TriggeringEntitiesCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UniformDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UniformDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRange()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__RANGE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UniformDistributionCardinalityCheckerRule::UniformDistributionCardinalityCheckerRule() = default; + + void UniformDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UniformDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UsedAreaCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UsedAreaCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kPositionsSize = object->GetPositionsSize(); + // Check too few elements + if (kPositionsSize < 2) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 2, kPositionsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + UsedAreaCardinalityCheckerRule::UsedAreaCardinalityCheckerRule() = default; + + void UsedAreaCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UsedAreaCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCustomCommandAction()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__CUSTOM_COMMAND_ACTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedActionCardinalityCheckerRule::UserDefinedActionCardinalityCheckerRule() = default; + + void UserDefinedActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedAnimationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedAnimationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetUserDefinedAnimationType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedAnimationCardinalityCheckerRule::UserDefinedAnimationCardinalityCheckerRule() = default; + + void UserDefinedAnimationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedAnimationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedComponentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedComponentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetUserDefinedComponentType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedComponentCardinalityCheckerRule::UserDefinedComponentCardinalityCheckerRule() = default; + + void UserDefinedComponentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedComponentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetContent()) + { + violations.push_back( CardinalityViolation("", 0, 1, VIOLATION_TYPE::REQUIRED_SIMPLE_CONTENT) ); + } + // Check violation + // Check required + if (!object->IsSetType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedDistributionCardinalityCheckerRule::UserDefinedDistributionCardinalityCheckerRule() = default; + + void UserDefinedDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedLightCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedLightCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetUserDefinedLightType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedLightCardinalityCheckerRule::UserDefinedLightCardinalityCheckerRule() = default; + + void UserDefinedLightCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedLightCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string UserDefinedValueConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector UserDefinedValueConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + UserDefinedValueConditionCardinalityCheckerRule::UserDefinedValueConditionCardinalityCheckerRule() = default; + + void UserDefinedValueConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void UserDefinedValueConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ValueConstraintCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ValueConstraintCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + ValueConstraintCardinalityCheckerRule::ValueConstraintCardinalityCheckerRule() = default; + + void ValueConstraintCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ValueConstraintCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ValueConstraintGroupCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ValueConstraintGroupCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kConstraintsSize = object->GetConstraintsSize(); + // Check too few elements + if (kConstraintsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VALUE_CONSTRAINT, 1, kConstraintsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ValueConstraintGroupCardinalityCheckerRule::ValueConstraintGroupCardinalityCheckerRule() = default; + + void ValueConstraintGroupCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ValueConstraintGroupCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string ValueSetDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector ValueSetDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kParameterValueSetsSize = object->GetParameterValueSetsSize(); + // Check too few elements + if (kParameterValueSetsSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_SET, 1, kParameterValueSetsSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + ValueSetDistributionCardinalityCheckerRule::ValueSetDistributionCardinalityCheckerRule() = default; + + void ValueSetDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void ValueSetDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetVariableRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetSetAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__SET_ACTION ); + elementsDefined += object->IsSetModifyAction()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MODIFY_ACTION ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + VariableActionCardinalityCheckerRule::VariableActionCardinalityCheckerRule() = default; + + void VariableActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableAddValueRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableAddValueRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableAddValueRuleCardinalityCheckerRule::VariableAddValueRuleCardinalityCheckerRule() = default; + + void VariableAddValueRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableAddValueRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableConditionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableConditionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVariableRef()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableConditionCardinalityCheckerRule::VariableConditionCardinalityCheckerRule() = default; + + void VariableConditionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableConditionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableDeclarationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableDeclarationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVariableType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableDeclarationCardinalityCheckerRule::VariableDeclarationCardinalityCheckerRule() = default; + + void VariableDeclarationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableDeclarationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableModifyActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableModifyActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRule()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__RULE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableModifyActionCardinalityCheckerRule::VariableModifyActionCardinalityCheckerRule() = default; + + void VariableModifyActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableModifyActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableModifyRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableModifyRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + + //Xor elements check + uint16_t elementsDefined = 0; + std::vector propertiesName; + elementsDefined += object->IsSetAddValue()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__ADD_VALUE ); + elementsDefined += object->IsSetMultiplyByValue()?1:0; + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE ); + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + + return violations; + } + + + VariableModifyRuleCardinalityCheckerRule::VariableModifyRuleCardinalityCheckerRule() = default; + + void VariableModifyRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableModifyRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableMultiplyByValueRuleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableMultiplyByValueRuleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableMultiplyByValueRuleCardinalityCheckerRule::VariableMultiplyByValueRuleCardinalityCheckerRule() = default; + + void VariableMultiplyByValueRuleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableMultiplyByValueRuleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VariableSetActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VariableSetActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetValue()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VALUE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VariableSetActionCardinalityCheckerRule::VariableSetActionCardinalityCheckerRule() = default; + + void VariableSetActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VariableSetActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetName()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__NAME, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetVehicleCategory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetBoundingBox()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPerformance()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__PERFORMANCE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetAxles()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__AXLES, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleCardinalityCheckerRule::VehicleCardinalityCheckerRule() = default; + + void VehicleCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleCatalogLocationCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleCatalogLocationCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirectory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__DIRECTORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleCatalogLocationCardinalityCheckerRule::VehicleCatalogLocationCardinalityCheckerRule() = default; + + void VehicleCatalogLocationCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleCatalogLocationCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleCategoryDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleCategoryDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kVehicleCategoryDistributionEntriesSize = object->GetVehicleCategoryDistributionEntriesSize(); + // Check too few elements + if (kVehicleCategoryDistributionEntriesSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY, 1, kVehicleCategoryDistributionEntriesSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + VehicleCategoryDistributionCardinalityCheckerRule::VehicleCategoryDistributionCardinalityCheckerRule() = default; + + void VehicleCategoryDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleCategoryDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleCategoryDistributionEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleCategoryDistributionEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetCategory()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleCategoryDistributionEntryCardinalityCheckerRule::VehicleCategoryDistributionEntryCardinalityCheckerRule() = default; + + void VehicleCategoryDistributionEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleCategoryDistributionEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleComponentCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleComponentCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetVehicleComponentType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleComponentCardinalityCheckerRule::VehicleComponentCardinalityCheckerRule() = default; + + void VehicleComponentCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleComponentCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleLightCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleLightCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetVehicleLightType()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleLightCardinalityCheckerRule::VehicleLightCardinalityCheckerRule() = default; + + void VehicleLightCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleLightCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleRoleDistributionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleRoleDistributionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + const auto kVehicleRoleDistributionEntriesSize = object->GetVehicleRoleDistributionEntriesSize(); + // Check too few elements + if (kVehicleRoleDistributionEntriesSize < 1) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY, 1, kVehicleRoleDistributionEntriesSize, VIOLATION_TYPE::TOO_FEW) ); + } + + //Xor elements check + + return violations; + } + + + VehicleRoleDistributionCardinalityCheckerRule::VehicleRoleDistributionCardinalityCheckerRule() = default; + + void VehicleRoleDistributionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleRoleDistributionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VehicleRoleDistributionEntryCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VehicleRoleDistributionEntryCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRole()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ROLE, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetWeight()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VehicleRoleDistributionEntryCardinalityCheckerRule::VehicleRoleDistributionEntryCardinalityCheckerRule() = default; + + void VehicleRoleDistributionEntryCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VehicleRoleDistributionEntryCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VertexCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VertexCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VertexCardinalityCheckerRule::VertexCardinalityCheckerRule() = default; + + void VertexCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VertexCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string VisibilityActionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector VisibilityActionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetGraphics()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSensors()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SENSORS, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetTraffic()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + VisibilityActionCardinalityCheckerRule::VisibilityActionCardinalityCheckerRule() = default; + + void VisibilityActionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void VisibilityActionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string WaypointCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector WaypointCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetRouteStrategy()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetPosition()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__POSITION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + WaypointCardinalityCheckerRule::WaypointCardinalityCheckerRule() = default; + + void WaypointCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void WaypointCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string WindCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector WindCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetDirection()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetSpeed()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__SPEED, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + WindCardinalityCheckerRule::WindCardinalityCheckerRule() = default; + + void WindCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void WindCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + std::string WorldPositionCardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector WorldPositionCardinalityCheckerRule::GetAllViolations(std::shared_ptr object) + { + std::vector violations; + // Check violation + // Check required + if (!object->IsSetX()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__X, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + // Check violation + // Check required + if (!object->IsSetY()) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__Y, 0, 1, VIOLATION_TYPE::REQUIRED) ); + } + + //Xor elements check + + return violations; + } + + + WorldPositionCardinalityCheckerRule::WorldPositionCardinalityCheckerRule() = default; + + void WorldPositionCardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void WorldPositionCardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.h new file mode 100644 index 00000000..1d183430 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.h @@ -0,0 +1,5792 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include "CardinalityCheckerRule.h" +#include "IParserMessageLogger.h" +#include "ITreeMessageLogger.h" +#include "ApiClassInterfacesV1_3.h" +#include "PropertyTreeContext.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAbsoluteSpeed according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteSpeedCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AbsoluteSpeedCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAbsoluteTargetLane according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AbsoluteTargetLaneCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAbsoluteTargetLaneOffset according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneOffsetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AbsoluteTargetLaneOffsetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAbsoluteTargetSpeed according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetSpeedCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AbsoluteTargetSpeedCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAccelerationCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AccelerationConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AccelerationConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAcquirePositionAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AcquirePositionActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AcquirePositionActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAct according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ActCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IActors according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActorsCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ActorsCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAddEntityAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AddEntityActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AddEntityActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAngleCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AngleConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AngleConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAnimationAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AnimationActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAnimationFile according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationFileCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AnimationFileCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAnimationState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AnimationStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAnimationType according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AnimationTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAppearanceAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AppearanceActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AppearanceActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAssignRouteAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignRouteActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AssignRouteActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAutomaticGear according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AutomaticGearCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AutomaticGearCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAxle according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AxleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IAxles according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxlesCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + AxlesCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IBoundingBox according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BoundingBoxCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + BoundingBoxCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IBrake according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + BrakeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IBrakeInput according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeInputCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + BrakeInputCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IByEntityCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByEntityConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ByEntityConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IByObjectType according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByObjectTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ByObjectTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IByType according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ByTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IByValueCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByValueConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ByValueConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICatalog according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CatalogCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICatalogDefinition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogDefinitionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CatalogDefinitionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICatalogReference according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogReferenceCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CatalogReferenceCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICenter according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CenterCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CenterCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICentralSwarmObject according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CentralSwarmObjectCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CentralSwarmObjectCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IClothoid according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ClothoidCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IClothoidSpline according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ClothoidSplineCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IClothoidSplineSegment according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineSegmentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ClothoidSplineSegmentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICollisionCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CollisionConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CollisionConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IColor according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ColorCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IColorCmyk according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorCmykCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ColorCmykCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IColorRgb according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorRgbCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ColorRgbCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IComponentAnimation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ComponentAnimationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ComponentAnimationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IConditionGroup according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionGroupCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ConditionGroupCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IConnectTrailerAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConnectTrailerActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ConnectTrailerActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IControlPoint according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControlPointCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControlPointCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IController according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControllerCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IControllerAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControllerActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IControllerCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControllerCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IControllerDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControllerDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IControllerDistributionEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ControllerDistributionEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICustomCommandAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomCommandActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CustomCommandActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ICustomContent according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomContentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + CustomContentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDeterministicMultiParameterDistribution according to OpenSCENARIO + * standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DeterministicMultiParameterDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDeterministicMultiParameterDistributionType according to OpenSCENARIO + * standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DeterministicMultiParameterDistributionTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDeterministicParameterDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicParameterDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DeterministicParameterDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDeterministicSingleParameterDistribution according to OpenSCENARIO + * standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DeterministicSingleParameterDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDeterministicSingleParameterDistributionType according to OpenSCENARIO + * standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DeterministicSingleParameterDistributionTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDimensions according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DimensionsCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DimensionsCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDirectionOfTravelDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectionOfTravelDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DirectionOfTravelDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDirectory according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectoryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DirectoryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDistanceCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistanceConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DistanceConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDistributionDefinition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionDefinitionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DistributionDefinitionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDistributionRange according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionRangeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DistributionRangeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDistributionSet according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DistributionSetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDistributionSetElement according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetElementCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DistributionSetElementCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IDomeImage according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DomeImageCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + DomeImageCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEndOfRoadCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EndOfRoadConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EndOfRoadConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityDistributionEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityDistributionEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityObject according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityObjectCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityObjectCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntityRef according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityRefCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntityRefCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEntitySelection according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntitySelectionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EntitySelectionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEnvironment according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EnvironmentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEnvironmentAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EnvironmentActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEnvironmentCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EnvironmentCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IEvent according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EventCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + EventCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IExternalObjectReference according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ExternalObjectReferenceCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ExternalObjectReferenceCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IFile according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + FileCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IFileHeader according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileHeaderCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + FileHeaderCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IFinalSpeed according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FinalSpeedCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + FinalSpeedCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IFog according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FogCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + FogCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IFollowTrajectoryAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FollowTrajectoryActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + FollowTrajectoryActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IGear according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GearCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + GearCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IGlobalAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GlobalActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + GlobalActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IHistogram according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + HistogramCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IHistogramBin according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramBinCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + HistogramBinCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IInRoutePosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InRoutePositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + InRoutePositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IInfrastructureAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InfrastructureActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + InfrastructureActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IInit according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InitCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + InitCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IKnot according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class KnotCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + KnotCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILane according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILaneChangeAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneChangeActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILaneChangeTarget according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeTargetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneChangeTargetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILaneOffsetAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneOffsetActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILaneOffsetActionDynamics according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionDynamicsCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneOffsetActionDynamicsCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILaneOffsetTarget according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetTargetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LaneOffsetTargetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILanePosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LanePositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LanePositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILateralAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LateralActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILateralDistanceAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralDistanceActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LateralDistanceActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILicense according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LicenseCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LicenseCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILightState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LightStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILightStateAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LightStateActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILightType according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LightTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILogNormalDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LogNormalDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LogNormalDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILongitudinalAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LongitudinalActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ILongitudinalDistanceAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalDistanceActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + LongitudinalDistanceActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IManeuver according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ManeuverCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IManeuverCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ManeuverCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IManeuverGroup according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverGroupCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ManeuverGroupCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IManualGear according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManualGearCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ManualGearCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IMiscObject according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + MiscObjectCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IMiscObjectCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + MiscObjectCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IModifyRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ModifyRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ModifyRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IMonitorDeclaration according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MonitorDeclarationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + MonitorDeclarationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type INormalDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NormalDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + NormalDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type INurbs according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NurbsCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + NurbsCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IObjectController according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ObjectControllerCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ObjectControllerCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOffroadCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OffroadConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OffroadConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOpenScenario according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OpenScenarioCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOpenScenarioCategory according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioCategoryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OpenScenarioCategoryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideBrakeAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideBrakeActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideBrakeActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideClutchAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideClutchActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideClutchActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideGearAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideGearActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideGearActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideParkingBrakeAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideParkingBrakeActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideParkingBrakeActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideSteeringWheelAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideSteeringWheelActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideSteeringWheelActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IOverrideThrottleAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideThrottleActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + OverrideThrottleActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterAddValueRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAddValueRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterAddValueRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterAssignment according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAssignmentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterAssignmentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterDeclaration according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterDeclarationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterDeclarationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterModifyAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterModifyActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterModifyActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterMultiplyByValueRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterMultiplyByValueRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterMultiplyByValueRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterSetAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterSetActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterSetActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterValueDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterValueDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterValueDistributionDefinition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionDefinitionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterValueDistributionDefinitionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IParameterValueSet according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueSetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ParameterValueSetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPedestrian according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PedestrianCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPedestrianCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PedestrianCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPedestrianGesture according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianGestureCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PedestrianGestureCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPerformance according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PerformanceCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PerformanceCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPhase according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PhaseCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PhaseCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPoissonDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PoissonDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PoissonDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPolygon according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolygonCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PolygonCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPolyline according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolylineCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PolylineCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPositionInLaneCoordinates according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInLaneCoordinatesCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PositionInLaneCoordinatesCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPositionInRoadCoordinates according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInRoadCoordinatesCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PositionInRoadCoordinatesCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPositionOfCurrentEntity according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionOfCurrentEntityCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PositionOfCurrentEntityCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPrecipitation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrecipitationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PrecipitationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPrivate according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PrivateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IPrivateAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PrivateActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IProbabilityDistributionSet according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ProbabilityDistributionSetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IProbabilityDistributionSetElement according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetElementCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ProbabilityDistributionSetElementCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IProperty according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PropertyCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + PropertyCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRange according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RangeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RangeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IReachPositionCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ReachPositionConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ReachPositionConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeAngleCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeAngleConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeAngleConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeClearanceCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeClearanceConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeClearanceConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeDistanceCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeDistanceConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeDistanceConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeLanePosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeLanePositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeLanePositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeObjectPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeObjectPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeObjectPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeRoadPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeRoadPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeRoadPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeSpeedCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeSpeedConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeSpeedToMaster according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedToMasterCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeSpeedToMasterCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeTargetLane according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeTargetLaneCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeTargetLaneOffset according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneOffsetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeTargetLaneOffsetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeTargetSpeed according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetSpeedCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeTargetSpeedCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRelativeWorldPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeWorldPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RelativeWorldPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoadCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoadConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoadCursor according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadCursorCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoadCursorCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoadPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoadPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoadRange according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadRangeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoadRangeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoute according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RouteCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRouteCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RouteCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoutePosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutePositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoutePositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRouteRef according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteRefCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RouteRefCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IRoutingAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutingActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + RoutingActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IScenarioDefinition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioDefinitionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ScenarioDefinitionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IScenarioObject according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ScenarioObjectCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IScenarioObjectTemplate according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectTemplateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ScenarioObjectTemplateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISelectedEntities according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SelectedEntitiesCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SelectedEntitiesCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISensorReference according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SensorReferenceCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISensorReferenceSet according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceSetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SensorReferenceSetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISetMonitorAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SetMonitorActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SetMonitorActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IShape according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ShapeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ShapeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISimulationTimeCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SimulationTimeConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SimulationTimeConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISpeedAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SpeedActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISpeedActionTarget according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionTargetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SpeedActionTargetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISpeedCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SpeedConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISpeedProfileAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SpeedProfileActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISpeedProfileEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SpeedProfileEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStandStillCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StandStillConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StandStillConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISteadyState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SteadyStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SteadyStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStochastic according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StochasticCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStochasticDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StochasticDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStochasticDistributionType according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionTypeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StochasticDistributionTypeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStory according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StoryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStoryboard according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StoryboardCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IStoryboardElementStateCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardElementStateConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + StoryboardElementStateConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISun according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SunCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SunCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ISynchronizeAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SynchronizeActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + SynchronizeActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITargetDistanceSteadyState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetDistanceSteadyStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TargetDistanceSteadyStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITargetTimeSteadyState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetTimeSteadyStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TargetTimeSteadyStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITeleportAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TeleportActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TeleportActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeHeadwayCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeHeadwayConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeHeadwayConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeOfDay according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeOfDayCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeOfDayCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeOfDayConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeReference according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeReferenceCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeReferenceCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeToCollisionCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeToCollisionConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITimeToCollisionConditionTarget according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionTargetCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimeToCollisionConditionTargetCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITiming according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimingCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TimingCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficArea according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficAreaCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficAreaAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficAreaActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficDefinition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDefinitionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficDefinitionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficDistributionEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficDistributionEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalController according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalControllerCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalControllerAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalControllerActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalControllerCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalControllerConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalGroupState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalGroupStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalGroupStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalState according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalStateCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSignalStateAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSignalStateActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSinkAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSinkActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSinkActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSourceAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSourceActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSourceActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrafficSwarmAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSwarmActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrafficSwarmActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrailer according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrailerCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrailerAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrailerActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrailerCoupler according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerCouplerCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrailerCouplerCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrailerHitch according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerHitchCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrailerHitchCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrajectory according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrajectoryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrajectoryCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrajectoryCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrajectoryFollowingMode according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryFollowingModeCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrajectoryFollowingModeCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrajectoryPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrajectoryPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITrajectoryRef according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryRefCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TrajectoryRefCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITransitionDynamics according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TransitionDynamicsCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TransitionDynamicsCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITraveledDistanceCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TraveledDistanceConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TraveledDistanceConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type ITriggeringEntities according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggeringEntitiesCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + TriggeringEntitiesCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUniformDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UniformDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UniformDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUsedArea according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UsedAreaCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UsedAreaCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedAnimation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedAnimationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedAnimationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedComponent according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedComponentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedComponentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedLight according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedLightCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedLightCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IUserDefinedValueCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedValueConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + UserDefinedValueConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IValueConstraint according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ValueConstraintCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IValueConstraintGroup according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintGroupCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ValueConstraintGroupCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IValueSetDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueSetDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + ValueSetDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableAddValueRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableAddValueRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableAddValueRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableCondition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableConditionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableConditionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableDeclaration according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableDeclarationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableDeclarationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableModifyAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableModifyActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableModifyRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableModifyRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableMultiplyByValueRule according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableMultiplyByValueRuleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableMultiplyByValueRuleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVariableSetAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableSetActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VariableSetActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicle according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleCatalogLocation according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCatalogLocationCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleCatalogLocationCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleCategoryDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleCategoryDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleCategoryDistributionEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleCategoryDistributionEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleComponent according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleComponentCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleComponentCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleLight according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleLightCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleLightCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleRoleDistribution according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleRoleDistributionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVehicleRoleDistributionEntry according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionEntryCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VehicleRoleDistributionEntryCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVertex according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VertexCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VertexCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IVisibilityAction according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VisibilityActionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + VisibilityActionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IWaypoint according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WaypointCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + WaypointCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IWind according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WindCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + WindCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A cardinality checker rule class for the type IWorldPosition according to OpenSCENARIO standard + * all properties and children are checked if they are not optinal + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WorldPositionCardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr object); + + public: + WorldPositionCardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.cpp new file mode 100644 index 00000000..1bba1f13 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.cpp @@ -0,0 +1,3165 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "UnionCheckerRulesV1_3.h" +#include "OscConstantsV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + std::vector ActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetGlobalAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION); + } + if (object->GetUserDefinedAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION); + } + if (object->GetPrivateAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector ActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION); + return propertyNamesNotNull; + } + + ActionUnionCheckerRule::ActionUnionCheckerRule() = default; + + void ActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector AnimationTypeUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetComponentAnimation()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION); + } + if (object->GetPedestrianAnimation()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION); + } + if (object->GetAnimationFile()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANIMATION_FILE); + } + if (object->GetUserDefinedAnimation()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION); + } + return propertyNamesNotNull; + } + + std::vector AnimationTypeUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANIMATION_FILE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION); + return propertyNamesNotNull; + } + + AnimationTypeUnionCheckerRule::AnimationTypeUnionCheckerRule() = default; + + void AnimationTypeUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void AnimationTypeUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector AppearanceActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetLightStateAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION); + } + if (object->GetAnimationAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION); + } + return propertyNamesNotNull; + } + + std::vector AppearanceActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION); + return propertyNamesNotNull; + } + + AppearanceActionUnionCheckerRule::AppearanceActionUnionCheckerRule() = default; + + void AppearanceActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void AppearanceActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector AssignControllerActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetController()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + if (object->GetObjectController()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER); + } + return propertyNamesNotNull; + } + + + AssignControllerActionUnionCheckerRule::AssignControllerActionUnionCheckerRule() = default; + + void AssignControllerActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void AssignControllerActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + } + std::vector AssignRouteActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetRoute()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector AssignRouteActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + return propertyNamesNotNull; + } + + AssignRouteActionUnionCheckerRule::AssignRouteActionUnionCheckerRule() = default; + + void AssignRouteActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void AssignRouteActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector BrakeInputUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetBrakePercent()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT); + } + if (object->GetBrakeForce()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BRAKE_FORCE); + } + return propertyNamesNotNull; + } + + std::vector BrakeInputUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BRAKE_FORCE); + return propertyNamesNotNull; + } + + BrakeInputUnionCheckerRule::BrakeInputUnionCheckerRule() = default; + + void BrakeInputUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void BrakeInputUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ByValueConditionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetParameterCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION); + } + if (object->GetTimeOfDayCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION); + } + if (object->GetSimulationTimeCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION); + } + if (object->GetStoryboardElementStateCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION); + } + if (object->GetUserDefinedValueCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION); + } + if (object->GetTrafficSignalCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION); + } + if (object->GetTrafficSignalControllerCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION); + } + if (object->GetVariableCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION); + } + return propertyNamesNotNull; + } + + std::vector ByValueConditionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION); + return propertyNamesNotNull; + } + + ByValueConditionUnionCheckerRule::ByValueConditionUnionCheckerRule() = default; + + void ByValueConditionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ByValueConditionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector CollisionConditionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetEntityRef()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + } + if (object->GetByType()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_TYPE); + } + return propertyNamesNotNull; + } + + std::vector CollisionConditionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_TYPE); + return propertyNamesNotNull; + } + + CollisionConditionUnionCheckerRule::CollisionConditionUnionCheckerRule() = default; + + void CollisionConditionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void CollisionConditionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ColorUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetColorRgb()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLOR_RGB); + } + if (object->GetColorCmyk()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLOR_CMYK); + } + return propertyNamesNotNull; + } + + std::vector ColorUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLOR_RGB); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLOR_CMYK); + return propertyNamesNotNull; + } + + ColorUnionCheckerRule::ColorUnionCheckerRule() = default; + + void ColorUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ColorUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ComponentAnimationUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetVehicleComponent()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT); + } + if (object->GetUserDefinedComponent()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT); + } + return propertyNamesNotNull; + } + + std::vector ComponentAnimationUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT); + return propertyNamesNotNull; + } + + ComponentAnimationUnionCheckerRule::ComponentAnimationUnionCheckerRule() = default; + + void ComponentAnimationUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ComponentAnimationUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ConditionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetByEntityCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION); + } + if (object->GetByValueCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION); + } + return propertyNamesNotNull; + } + + std::vector ConditionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION); + return propertyNamesNotNull; + } + + ConditionUnionCheckerRule::ConditionUnionCheckerRule() = default; + + void ConditionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ConditionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ControllerDistributionEntryUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetController()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector ControllerDistributionEntryUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + return propertyNamesNotNull; + } + + ControllerDistributionEntryUnionCheckerRule::ControllerDistributionEntryUnionCheckerRule() = default; + + void ControllerDistributionEntryUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ControllerDistributionEntryUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector DeterministicParameterDistributionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetDeterministicMultiParameterDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION); + } + if (object->GetDeterministicSingleParameterDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION); + } + return propertyNamesNotNull; + } + + std::vector DeterministicParameterDistributionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION); + return propertyNamesNotNull; + } + + DeterministicParameterDistributionUnionCheckerRule::DeterministicParameterDistributionUnionCheckerRule() = default; + + void DeterministicParameterDistributionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicParameterDistributionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector DeterministicSingleParameterDistributionTypeUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetDistributionSet()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET); + } + if (object->GetDistributionRange()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE); + } + if (object->GetUserDefinedDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION); + } + return propertyNamesNotNull; + } + + std::vector DeterministicSingleParameterDistributionTypeUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION); + return propertyNamesNotNull; + } + + DeterministicSingleParameterDistributionTypeUnionCheckerRule::DeterministicSingleParameterDistributionTypeUnionCheckerRule() = default; + + void DeterministicSingleParameterDistributionTypeUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void DeterministicSingleParameterDistributionTypeUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector DistributionDefinitionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetDeterministic()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC); + } + if (object->GetStochastic()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STOCHASTIC); + } + return propertyNamesNotNull; + } + + std::vector DistributionDefinitionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DETERMINISTIC); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STOCHASTIC); + return propertyNamesNotNull; + } + + DistributionDefinitionUnionCheckerRule::DistributionDefinitionUnionCheckerRule() = default; + + void DistributionDefinitionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void DistributionDefinitionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector EntityActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetAddEntityAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION); + } + if (object->GetDeleteEntityAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION); + } + return propertyNamesNotNull; + } + + std::vector EntityActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION); + return propertyNamesNotNull; + } + + EntityActionUnionCheckerRule::EntityActionUnionCheckerRule() = default; + + void EntityActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void EntityActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector EntityConditionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetEndOfRoadCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION); + } + if (object->GetCollisionCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION); + } + if (object->GetOffroadCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION); + } + if (object->GetTimeHeadwayCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION); + } + if (object->GetTimeToCollisionCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION); + } + if (object->GetAccelerationCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION); + } + if (object->GetStandStillCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION); + } + if (object->GetSpeedCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_CONDITION); + } + if (object->GetRelativeSpeedCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION); + } + if (object->GetTraveledDistanceCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION); + } + if (object->GetReachPositionCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION); + } + if (object->GetDistanceCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION); + } + if (object->GetRelativeDistanceCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION); + } + if (object->GetRelativeClearanceCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION); + } + if (object->GetAngleCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION); + } + if (object->GetRelativeAngleCondition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION); + } + return propertyNamesNotNull; + } + + std::vector EntityConditionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION); + return propertyNamesNotNull; + } + + EntityConditionUnionCheckerRule::EntityConditionUnionCheckerRule() = default; + + void EntityConditionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void EntityConditionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector EntityObjectUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + if (object->GetVehicle()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE); + } + if (object->GetPedestrian()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PEDESTRIAN); + } + if (object->GetMiscObject()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MISC_OBJECT); + } + if (object->GetExternalObjectReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector EntityObjectUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PEDESTRIAN); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MISC_OBJECT); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE); + return propertyNamesNotNull; + } + + EntityObjectUnionCheckerRule::EntityObjectUnionCheckerRule() = default; + + void EntityObjectUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void EntityObjectUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector EnvironmentActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetEnvironment()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENVIRONMENT); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector EnvironmentActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENVIRONMENT); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + return propertyNamesNotNull; + } + + EnvironmentActionUnionCheckerRule::EnvironmentActionUnionCheckerRule() = default; + + void EnvironmentActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void EnvironmentActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector FinalSpeedUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetAbsoluteSpeed()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED); + } + if (object->GetRelativeSpeedToMaster()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER); + } + return propertyNamesNotNull; + } + + std::vector FinalSpeedUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER); + return propertyNamesNotNull; + } + + FinalSpeedUnionCheckerRule::FinalSpeedUnionCheckerRule() = default; + + void FinalSpeedUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void FinalSpeedUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector GearUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetManualGear()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MANUAL_GEAR); + } + if (object->GetAutomaticGear()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR); + } + return propertyNamesNotNull; + } + + std::vector GearUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MANUAL_GEAR); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR); + return propertyNamesNotNull; + } + + GearUnionCheckerRule::GearUnionCheckerRule() = default; + + void GearUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void GearUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector GlobalActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetEnvironmentAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION); + } + if (object->GetEntityAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_ACTION); + } + if (object->GetInfrastructureAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION); + } + if (object->GetSetMonitorAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION); + } + if (object->GetParameterAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION); + } + if (object->GetTrafficAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION); + } + if (object->GetVariableAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector GlobalActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION); + return propertyNamesNotNull; + } + + GlobalActionUnionCheckerRule::GlobalActionUnionCheckerRule() = default; + + void GlobalActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void GlobalActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector InRoutePositionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetFromCurrentEntity()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY); + } + if (object->GetFromRoadCoordinates()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES); + } + if (object->GetFromLaneCoordinates()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES); + } + return propertyNamesNotNull; + } + + std::vector InRoutePositionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES); + return propertyNamesNotNull; + } + + InRoutePositionUnionCheckerRule::InRoutePositionUnionCheckerRule() = default; + + void InRoutePositionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void InRoutePositionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector LaneChangeTargetUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetRelativeTargetLane()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE); + } + if (object->GetAbsoluteTargetLane()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE); + } + return propertyNamesNotNull; + } + + std::vector LaneChangeTargetUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE); + return propertyNamesNotNull; + } + + LaneChangeTargetUnionCheckerRule::LaneChangeTargetUnionCheckerRule() = default; + + void LaneChangeTargetUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void LaneChangeTargetUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector LaneOffsetTargetUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetRelativeTargetLaneOffset()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET); + } + if (object->GetAbsoluteTargetLaneOffset()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET); + } + return propertyNamesNotNull; + } + + std::vector LaneOffsetTargetUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET); + return propertyNamesNotNull; + } + + LaneOffsetTargetUnionCheckerRule::LaneOffsetTargetUnionCheckerRule() = default; + + void LaneOffsetTargetUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void LaneOffsetTargetUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector LateralActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetLaneChangeAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION); + } + if (object->GetLaneOffsetAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION); + } + if (object->GetLateralDistanceAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector LateralActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION); + return propertyNamesNotNull; + } + + LateralActionUnionCheckerRule::LateralActionUnionCheckerRule() = default; + + void LateralActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void LateralActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector LightTypeUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetVehicleLight()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT); + } + if (object->GetUserDefinedLight()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT); + } + return propertyNamesNotNull; + } + + std::vector LightTypeUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT); + return propertyNamesNotNull; + } + + LightTypeUnionCheckerRule::LightTypeUnionCheckerRule() = default; + + void LightTypeUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void LightTypeUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector LongitudinalActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetSpeedAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_ACTION); + } + if (object->GetLongitudinalDistanceAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION); + } + if (object->GetSpeedProfileAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector LongitudinalActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION); + return propertyNamesNotNull; + } + + LongitudinalActionUnionCheckerRule::LongitudinalActionUnionCheckerRule() = default; + + void LongitudinalActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void LongitudinalActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ModifyRuleUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetAddValue()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_VALUE); + } + if (object->GetMultiplyByValue()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE); + } + return propertyNamesNotNull; + } + + std::vector ModifyRuleUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_VALUE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE); + return propertyNamesNotNull; + } + + ModifyRuleUnionCheckerRule::ModifyRuleUnionCheckerRule() = default; + + void ModifyRuleUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ModifyRuleUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ObjectControllerUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + if (object->GetController()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER); + } + return propertyNamesNotNull; + } + + std::vector ObjectControllerUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER); + return propertyNamesNotNull; + } + + ObjectControllerUnionCheckerRule::ObjectControllerUnionCheckerRule() = default; + + void ObjectControllerUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ObjectControllerUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector OpenScenarioCategoryUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetScenarioDefinition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SCENARIO_DEFINITION); + } + if (object->GetCatalogDefinition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_DEFINITION); + } + if (object->GetParameterValueDistributionDefinition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION_DEFINITION); + } + return propertyNamesNotNull; + } + + std::vector OpenScenarioCategoryUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SCENARIO_DEFINITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_DEFINITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION_DEFINITION); + return propertyNamesNotNull; + } + + OpenScenarioCategoryUnionCheckerRule::OpenScenarioCategoryUnionCheckerRule() = default; + + void OpenScenarioCategoryUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void OpenScenarioCategoryUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ParameterActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetSetAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_ACTION); + } + if (object->GetModifyAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION); + } + return propertyNamesNotNull; + } + + std::vector ParameterActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION); + return propertyNamesNotNull; + } + + ParameterActionUnionCheckerRule::ParameterActionUnionCheckerRule() = default; + + void ParameterActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ParameterActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector PositionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetWorldPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__WORLD_POSITION); + } + if (object->GetRelativeWorldPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION); + } + if (object->GetRelativeObjectPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION); + } + if (object->GetRoadPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROAD_POSITION); + } + if (object->GetRelativeRoadPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION); + } + if (object->GetLanePosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_POSITION); + } + if (object->GetRelativeLanePosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION); + } + if (object->GetRoutePosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE_POSITION); + } + if (object->GetGeoPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__GEO_POSITION); + } + if (object->GetTrajectoryPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION); + } + return propertyNamesNotNull; + } + + std::vector PositionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__WORLD_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROAD_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LANE_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__GEO_POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION); + return propertyNamesNotNull; + } + + PositionUnionCheckerRule::PositionUnionCheckerRule() = default; + + void PositionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void PositionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector PrivateActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetLongitudinalAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION); + } + if (object->GetLateralAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LATERAL_ACTION); + } + if (object->GetVisibilityAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION); + } + if (object->GetSynchronizeAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION); + } + if (object->GetActivateControllerAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION); + } + if (object->GetControllerAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION); + } + if (object->GetTeleportAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION); + } + if (object->GetRoutingAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTING_ACTION); + } + if (object->GetAppearanceAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION); + } + if (object->GetTrailerAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAILER_ACTION); + } + return propertyNamesNotNull; + } + + std::vector PrivateActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LATERAL_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTING_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAILER_ACTION); + return propertyNamesNotNull; + } + + PrivateActionUnionCheckerRule::PrivateActionUnionCheckerRule() = default; + + void PrivateActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void PrivateActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector RouteRefUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetRoute()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector RouteRefUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ROUTE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + return propertyNamesNotNull; + } + + RouteRefUnionCheckerRule::RouteRefUnionCheckerRule() = default; + + void RouteRefUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void RouteRefUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector RoutingActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetAssignRouteAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION); + } + if (object->GetFollowTrajectoryAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION); + } + if (object->GetAcquirePositionAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION); + } + if (object->GetRandomRouteAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector RoutingActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION); + return propertyNamesNotNull; + } + + RoutingActionUnionCheckerRule::RoutingActionUnionCheckerRule() = default; + + void RoutingActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void RoutingActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector SelectedEntitiesUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetEntityRefSize() != 0) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + } + if (object->GetByTypeSize() != 0) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_TYPE); + } + return propertyNamesNotNull; + } + + std::vector SelectedEntitiesUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__BY_TYPE); + return propertyNamesNotNull; + } + + SelectedEntitiesUnionCheckerRule::SelectedEntitiesUnionCheckerRule() = default; + + void SelectedEntitiesUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void SelectedEntitiesUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector ShapeUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetPolyline()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POLYLINE); + } + if (object->GetClothoid()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CLOTHOID); + } + if (object->GetClothoidSpline()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE); + } + if (object->GetNurbs()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NURBS); + } + return propertyNamesNotNull; + } + + std::vector ShapeUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POLYLINE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CLOTHOID); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NURBS); + return propertyNamesNotNull; + } + + ShapeUnionCheckerRule::ShapeUnionCheckerRule() = default; + + void ShapeUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void ShapeUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector SpeedActionTargetUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetRelativeTargetSpeed()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED); + } + if (object->GetAbsoluteTargetSpeed()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED); + } + return propertyNamesNotNull; + } + + std::vector SpeedActionTargetUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED); + return propertyNamesNotNull; + } + + SpeedActionTargetUnionCheckerRule::SpeedActionTargetUnionCheckerRule() = default; + + void SpeedActionTargetUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void SpeedActionTargetUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector SteadyStateUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetTargetDistanceSteadyState()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE); + } + if (object->GetTargetTimeSteadyState()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE); + } + return propertyNamesNotNull; + } + + std::vector SteadyStateUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE); + return propertyNamesNotNull; + } + + SteadyStateUnionCheckerRule::SteadyStateUnionCheckerRule() = default; + + void SteadyStateUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void SteadyStateUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector StochasticDistributionTypeUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetProbabilityDistributionSet()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET); + } + if (object->GetNormalDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION); + } + if (object->GetLogNormalDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION); + } + if (object->GetUniformDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION); + } + if (object->GetPoissonDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION); + } + if (object->GetHistogram()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__HISTOGRAM); + } + if (object->GetUserDefinedDistribution()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION); + } + return propertyNamesNotNull; + } + + std::vector StochasticDistributionTypeUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__HISTOGRAM); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION); + return propertyNamesNotNull; + } + + StochasticDistributionTypeUnionCheckerRule::StochasticDistributionTypeUnionCheckerRule() = default; + + void StochasticDistributionTypeUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void StochasticDistributionTypeUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector TimeReferenceUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetNone()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NONE); + } + if (object->GetTiming()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIMING); + } + return propertyNamesNotNull; + } + + std::vector TimeReferenceUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__NONE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TIMING); + return propertyNamesNotNull; + } + + TimeReferenceUnionCheckerRule::TimeReferenceUnionCheckerRule() = default; + + void TimeReferenceUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void TimeReferenceUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector TimeToCollisionConditionTargetUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetPosition()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POSITION); + } + if (object->GetEntityRef()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + } + return propertyNamesNotNull; + } + + std::vector TimeToCollisionConditionTargetUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__POSITION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ENTITY_REF); + return propertyNamesNotNull; + } + + TimeToCollisionConditionTargetUnionCheckerRule::TimeToCollisionConditionTargetUnionCheckerRule() = default; + + void TimeToCollisionConditionTargetUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void TimeToCollisionConditionTargetUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector TrafficActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetTrafficSourceAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION); + } + if (object->GetTrafficSinkAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION); + } + if (object->GetTrafficSwarmAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION); + } + if (object->GetTrafficAreaAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION); + } + if (object->GetTrafficStopAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION); + } + return propertyNamesNotNull; + } + + std::vector TrafficActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION); + return propertyNamesNotNull; + } + + TrafficActionUnionCheckerRule::TrafficActionUnionCheckerRule() = default; + + void TrafficActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void TrafficActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector TrafficSignalActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetTrafficSignalControllerAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION); + } + if (object->GetTrafficSignalStateAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION); + } + return propertyNamesNotNull; + } + + std::vector TrafficSignalActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION); + return propertyNamesNotNull; + } + + TrafficSignalActionUnionCheckerRule::TrafficSignalActionUnionCheckerRule() = default; + + void TrafficSignalActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void TrafficSignalActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector TrajectoryRefUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetTrajectory()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAJECTORY); + } + if (object->GetCatalogReference()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + } + return propertyNamesNotNull; + } + + std::vector TrajectoryRefUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__TRAJECTORY); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE); + return propertyNamesNotNull; + } + + TrajectoryRefUnionCheckerRule::TrajectoryRefUnionCheckerRule() = default; + + void TrajectoryRefUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void TrajectoryRefUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector VariableActionUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetSetAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_ACTION); + } + if (object->GetModifyAction()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION); + } + return propertyNamesNotNull; + } + + std::vector VariableActionUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__SET_ACTION); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION); + return propertyNamesNotNull; + } + + VariableActionUnionCheckerRule::VariableActionUnionCheckerRule() = default; + + void VariableActionUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void VariableActionUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + std::vector VariableModifyRuleUnionCheckerRule::GetNotNullChildren(std::shared_ptr object) + { + std::vector propertyNamesNotNull; + if (object->GetAddValue()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_VALUE); + } + if (object->GetMultiplyByValue()) + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE); + } + return propertyNamesNotNull; + } + + std::vector VariableModifyRuleUnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__ADD_VALUE); + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE); + return propertyNamesNotNull; + } + + VariableModifyRuleUnionCheckerRule::VariableModifyRuleUnionCheckerRule() = default; + + void VariableModifyRuleUnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + } + + void VariableModifyRuleUnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + } + } +} + + diff --git a/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.h new file mode 100644 index 00000000..0da951d0 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/model/UnionCheckerRulesV1_3.h @@ -0,0 +1,1042 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include "UnionCheckerRule.h" +#include "IParserMessageLogger.h" +#include "ITreeMessageLogger.h" +#include "ApiClassInterfacesV1_3.h" +#include "PropertyTreeContext.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IAnimationType according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationTypeUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + AnimationTypeUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IAppearanceAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AppearanceActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + AppearanceActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IAssignControllerAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignControllerActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + AssignControllerActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IAssignRouteAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignRouteActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + AssignRouteActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IBrakeInput according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeInputUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + BrakeInputUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IByValueCondition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByValueConditionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ByValueConditionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ICollisionCondition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CollisionConditionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + CollisionConditionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IColor according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ColorUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IComponentAnimation according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ComponentAnimationUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ComponentAnimationUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ICondition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ConditionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IControllerDistributionEntry according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionEntryUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ControllerDistributionEntryUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IDeterministicParameterDistribution according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicParameterDistributionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + DeterministicParameterDistributionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IDeterministicSingleParameterDistributionType according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionTypeUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + DeterministicSingleParameterDistributionTypeUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IDistributionDefinition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionDefinitionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + DistributionDefinitionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IEntityAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + EntityActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IEntityCondition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityConditionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + EntityConditionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IEntityObject according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityObjectUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + EntityObjectUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IEnvironmentAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + EnvironmentActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IFinalSpeed according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FinalSpeedUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + FinalSpeedUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IGear according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GearUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + GearUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IGlobalAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GlobalActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + GlobalActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IInRoutePosition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InRoutePositionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + InRoutePositionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ILaneChangeTarget according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeTargetUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + LaneChangeTargetUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ILaneOffsetTarget according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetTargetUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + LaneOffsetTargetUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ILateralAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + LateralActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ILightType according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightTypeUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + LightTypeUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ILongitudinalAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + LongitudinalActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IModifyRule according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ModifyRuleUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ModifyRuleUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IObjectController according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ObjectControllerUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ObjectControllerUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IOpenScenarioCategory according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioCategoryUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + OpenScenarioCategoryUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IParameterAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ParameterActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IPosition according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + PositionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IPrivateAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + PrivateActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IRouteRef according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteRefUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + RouteRefUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IRoutingAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutingActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + RoutingActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ISelectedEntities according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SelectedEntitiesUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + SelectedEntitiesUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IShape according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ShapeUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + ShapeUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ISpeedActionTarget according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionTargetUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + SpeedActionTargetUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ISteadyState according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SteadyStateUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + SteadyStateUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IStochasticDistributionType according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionTypeUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + StochasticDistributionTypeUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ITimeReference according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeReferenceUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + TimeReferenceUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ITimeToCollisionConditionTarget according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionTargetUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + TimeToCollisionConditionTargetUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ITrafficAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + TrafficActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ITrafficSignalAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + TrafficSignalActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type ITrajectoryRef according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryRefUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + TrajectoryRefUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IVariableAction according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableActionUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + VariableActionUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A union checker rule class for the type IVariableModifyRule according to OpenSCENARIO standard + * all xor elements are checked + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyRuleUnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr object); + + std::vector GetAllChildren(); + + public: + VariableModifyRuleUnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + + }; + } +} + diff --git a/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.cpp new file mode 100644 index 00000000..374cafc8 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.cpp @@ -0,0 +1,92 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "RangeCheckerHelperV1_3.h" +#include "RangeCheckerRulesV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void RangeCheckerHelper::AddAllRangeCheckerRules(std::shared_ptr scenarioChecker) + { + scenarioChecker->AddAbsoluteSpeedCheckerRule(std::shared_ptr(new AbsoluteSpeedRangeCheckerRule())); + scenarioChecker->AddAnimationActionCheckerRule(std::shared_ptr(new AnimationActionRangeCheckerRule())); + scenarioChecker->AddAnimationFileCheckerRule(std::shared_ptr(new AnimationFileRangeCheckerRule())); + scenarioChecker->AddAnimationStateCheckerRule(std::shared_ptr(new AnimationStateRangeCheckerRule())); + scenarioChecker->AddAxleCheckerRule(std::shared_ptr(new AxleRangeCheckerRule())); + scenarioChecker->AddClothoidCheckerRule(std::shared_ptr(new ClothoidRangeCheckerRule())); + scenarioChecker->AddColorCmykCheckerRule(std::shared_ptr(new ColorCmykRangeCheckerRule())); + scenarioChecker->AddColorRgbCheckerRule(std::shared_ptr(new ColorRgbRangeCheckerRule())); + scenarioChecker->AddConditionCheckerRule(std::shared_ptr(new ConditionRangeCheckerRule())); + scenarioChecker->AddControlPointCheckerRule(std::shared_ptr(new ControlPointRangeCheckerRule())); + scenarioChecker->AddControllerDistributionEntryCheckerRule(std::shared_ptr(new ControllerDistributionEntryRangeCheckerRule())); + scenarioChecker->AddDimensionsCheckerRule(std::shared_ptr(new DimensionsRangeCheckerRule())); + scenarioChecker->AddDirectionOfTravelDistributionCheckerRule(std::shared_ptr(new DirectionOfTravelDistributionRangeCheckerRule())); + scenarioChecker->AddDistanceConditionCheckerRule(std::shared_ptr(new DistanceConditionRangeCheckerRule())); + scenarioChecker->AddDomeImageCheckerRule(std::shared_ptr(new DomeImageRangeCheckerRule())); + scenarioChecker->AddDynamicConstraintsCheckerRule(std::shared_ptr(new DynamicConstraintsRangeCheckerRule())); + scenarioChecker->AddEndOfRoadConditionCheckerRule(std::shared_ptr(new EndOfRoadConditionRangeCheckerRule())); + scenarioChecker->AddEventCheckerRule(std::shared_ptr(new EventRangeCheckerRule())); + scenarioChecker->AddFogCheckerRule(std::shared_ptr(new FogRangeCheckerRule())); + scenarioChecker->AddGeoPositionCheckerRule(std::shared_ptr(new GeoPositionRangeCheckerRule())); + scenarioChecker->AddLaneOffsetActionDynamicsCheckerRule(std::shared_ptr(new LaneOffsetActionDynamicsRangeCheckerRule())); + scenarioChecker->AddLanePositionCheckerRule(std::shared_ptr(new LanePositionRangeCheckerRule())); + scenarioChecker->AddLateralDistanceActionCheckerRule(std::shared_ptr(new LateralDistanceActionRangeCheckerRule())); + scenarioChecker->AddLightStateCheckerRule(std::shared_ptr(new LightStateRangeCheckerRule())); + scenarioChecker->AddLightStateActionCheckerRule(std::shared_ptr(new LightStateActionRangeCheckerRule())); + scenarioChecker->AddLongitudinalDistanceActionCheckerRule(std::shared_ptr(new LongitudinalDistanceActionRangeCheckerRule())); + scenarioChecker->AddManeuverGroupCheckerRule(std::shared_ptr(new ManeuverGroupRangeCheckerRule())); + scenarioChecker->AddMiscObjectCheckerRule(std::shared_ptr(new MiscObjectRangeCheckerRule())); + scenarioChecker->AddNurbsCheckerRule(std::shared_ptr(new NurbsRangeCheckerRule())); + scenarioChecker->AddOffroadConditionCheckerRule(std::shared_ptr(new OffroadConditionRangeCheckerRule())); + scenarioChecker->AddOverrideBrakeActionCheckerRule(std::shared_ptr(new OverrideBrakeActionRangeCheckerRule())); + scenarioChecker->AddOverrideClutchActionCheckerRule(std::shared_ptr(new OverrideClutchActionRangeCheckerRule())); + scenarioChecker->AddOverrideParkingBrakeActionCheckerRule(std::shared_ptr(new OverrideParkingBrakeActionRangeCheckerRule())); + scenarioChecker->AddOverrideSteeringWheelActionCheckerRule(std::shared_ptr(new OverrideSteeringWheelActionRangeCheckerRule())); + scenarioChecker->AddOverrideThrottleActionCheckerRule(std::shared_ptr(new OverrideThrottleActionRangeCheckerRule())); + scenarioChecker->AddPerformanceCheckerRule(std::shared_ptr(new PerformanceRangeCheckerRule())); + scenarioChecker->AddPhaseCheckerRule(std::shared_ptr(new PhaseRangeCheckerRule())); + scenarioChecker->AddPositionInLaneCoordinatesCheckerRule(std::shared_ptr(new PositionInLaneCoordinatesRangeCheckerRule())); + scenarioChecker->AddPrecipitationCheckerRule(std::shared_ptr(new PrecipitationRangeCheckerRule())); + scenarioChecker->AddReachPositionConditionCheckerRule(std::shared_ptr(new ReachPositionConditionRangeCheckerRule())); + scenarioChecker->AddRelativeClearanceConditionCheckerRule(std::shared_ptr(new RelativeClearanceConditionRangeCheckerRule())); + scenarioChecker->AddRelativeDistanceConditionCheckerRule(std::shared_ptr(new RelativeDistanceConditionRangeCheckerRule())); + scenarioChecker->AddRoadConditionCheckerRule(std::shared_ptr(new RoadConditionRangeCheckerRule())); + scenarioChecker->AddRoadPositionCheckerRule(std::shared_ptr(new RoadPositionRangeCheckerRule())); + scenarioChecker->AddSpeedProfileEntryCheckerRule(std::shared_ptr(new SpeedProfileEntryRangeCheckerRule())); + scenarioChecker->AddStandStillConditionCheckerRule(std::shared_ptr(new StandStillConditionRangeCheckerRule())); + scenarioChecker->AddSunCheckerRule(std::shared_ptr(new SunRangeCheckerRule())); + scenarioChecker->AddTimeHeadwayConditionCheckerRule(std::shared_ptr(new TimeHeadwayConditionRangeCheckerRule())); + scenarioChecker->AddTimeToCollisionConditionCheckerRule(std::shared_ptr(new TimeToCollisionConditionRangeCheckerRule())); + scenarioChecker->AddTimingCheckerRule(std::shared_ptr(new TimingRangeCheckerRule())); + scenarioChecker->AddTrafficSignalControllerCheckerRule(std::shared_ptr(new TrafficSignalControllerRangeCheckerRule())); + scenarioChecker->AddTrafficSinkActionCheckerRule(std::shared_ptr(new TrafficSinkActionRangeCheckerRule())); + scenarioChecker->AddTrafficSourceActionCheckerRule(std::shared_ptr(new TrafficSourceActionRangeCheckerRule())); + scenarioChecker->AddTrafficSwarmActionCheckerRule(std::shared_ptr(new TrafficSwarmActionRangeCheckerRule())); + scenarioChecker->AddTransitionDynamicsCheckerRule(std::shared_ptr(new TransitionDynamicsRangeCheckerRule())); + scenarioChecker->AddTraveledDistanceConditionCheckerRule(std::shared_ptr(new TraveledDistanceConditionRangeCheckerRule())); + scenarioChecker->AddVehicleCategoryDistributionEntryCheckerRule(std::shared_ptr(new VehicleCategoryDistributionEntryRangeCheckerRule())); + scenarioChecker->AddVehicleRoleDistributionEntryCheckerRule(std::shared_ptr(new VehicleRoleDistributionEntryRangeCheckerRule())); + scenarioChecker->AddWeatherCheckerRule(std::shared_ptr(new WeatherRangeCheckerRule())); + scenarioChecker->AddWindCheckerRule(std::shared_ptr(new WindRangeCheckerRule())); + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.h new file mode 100644 index 00000000..63c11dc0 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerHelperV1_3.h @@ -0,0 +1,45 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IScenarioCheckerV1_3.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A helper class for connection all RangeChecker rules to the specific classes + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RangeCheckerHelper + { + public: + /** + * Connects all range checker rules to a global scenarioChecker + * @param scenarioChecker the global scenarioChecker + */ + OPENSCENARIOLIB_EXP static void AddAllRangeCheckerRules(std::shared_ptr scenarioChecker); + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.cpp new file mode 100644 index 00000000..f20fe02c --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.cpp @@ -0,0 +1,2786 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define _USE_MATH_DEFINES +#include "RangeCheckerRulesV1_3.h" +#include "OscConstantsV1_3.h" +#include + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void AbsoluteSpeedRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void AbsoluteSpeedRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void AbsoluteSpeedRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void AnimationActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void AnimationActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void AnimationActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kAnimationDuration = typedObject->GetAnimationDuration(); + if (!(kAnimationDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION , std::to_string(typedObject->GetAnimationDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION , std::to_string(typedObject->GetAnimationDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION); + } + } + } + } + + void AnimationFileRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void AnimationFileRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void AnimationFileRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTimeOffset = typedObject->GetTimeOffset(); + if (!(kTimeOffset >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET , std::to_string(typedObject->GetTimeOffset()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET , std::to_string(typedObject->GetTimeOffset()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET); + } + } + } + } + + void AnimationStateRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void AnimationStateRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void AnimationStateRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kState = typedObject->GetState(); + if (!(kState <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STATE,std::to_string(typedObject->GetState()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__STATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STATE,std::to_string(typedObject->GetState()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__STATE); + } + } + if (!(kState >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STATE , std::to_string(typedObject->GetState()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__STATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STATE , std::to_string(typedObject->GetState()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__STATE); + } + } + } + } + + void AxleRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void AxleRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void AxleRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxSteering = typedObject->GetMaxSteering(); + if (!(kMaxSteering <= M_PI)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING,std::to_string(typedObject->GetMaxSteering()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING,std::to_string(typedObject->GetMaxSteering()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + } + } + if (!(kMaxSteering >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING , std::to_string(typedObject->GetMaxSteering()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING , std::to_string(typedObject->GetMaxSteering()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kPositionX = typedObject->GetPositionX(); + if (!(kPositionX >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__POSITION_X , std::to_string(typedObject->GetPositionX()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__POSITION_X); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__POSITION_X , std::to_string(typedObject->GetPositionX()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__POSITION_X); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kPositionZ = typedObject->GetPositionZ(); + if (!(kPositionZ >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__POSITION_Z , std::to_string(typedObject->GetPositionZ()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__POSITION_Z); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__POSITION_Z , std::to_string(typedObject->GetPositionZ()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__POSITION_Z); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTrackWidth = typedObject->GetTrackWidth(); + if (!(kTrackWidth >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH , std::to_string(typedObject->GetTrackWidth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH , std::to_string(typedObject->GetTrackWidth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kWheelDiameter = typedObject->GetWheelDiameter(); + if (!(kWheelDiameter > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER , std::to_string(typedObject->GetWheelDiameter()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER , std::to_string(typedObject->GetWheelDiameter()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER); + } + } + } + } + + void ClothoidRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ClothoidRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ClothoidRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kCurvatureDot = typedObject->GetCurvatureDot(); + if (!(kCurvatureDot >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT , std::to_string(typedObject->GetCurvatureDot()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT , std::to_string(typedObject->GetCurvatureDot()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kStartTime = typedObject->GetStartTime(); + if (!(kStartTime >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__START_TIME , std::to_string(typedObject->GetStartTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__START_TIME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__START_TIME , std::to_string(typedObject->GetStartTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__START_TIME); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kStopTime = typedObject->GetStopTime(); + if (!(kStopTime > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STOP_TIME , std::to_string(typedObject->GetStopTime()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__STOP_TIME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__STOP_TIME , std::to_string(typedObject->GetStopTime()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__STOP_TIME); + } + } + } + } + + void ColorCmykRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ColorCmykRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ColorCmykRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kCyan = typedObject->GetCyan(); + if (!(kCyan <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CYAN,std::to_string(typedObject->GetCyan()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__CYAN); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CYAN,std::to_string(typedObject->GetCyan()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__CYAN); + } + } + if (!(kCyan >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CYAN , std::to_string(typedObject->GetCyan()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__CYAN); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__CYAN , std::to_string(typedObject->GetCyan()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__CYAN); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kKey = typedObject->GetKey(); + if (!(kKey <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__KEY,std::to_string(typedObject->GetKey()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__KEY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__KEY,std::to_string(typedObject->GetKey()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__KEY); + } + } + if (!(kKey >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__KEY , std::to_string(typedObject->GetKey()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__KEY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__KEY , std::to_string(typedObject->GetKey()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__KEY); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMagenta = typedObject->GetMagenta(); + if (!(kMagenta <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAGENTA,std::to_string(typedObject->GetMagenta()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAGENTA,std::to_string(typedObject->GetMagenta()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + } + } + if (!(kMagenta >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAGENTA , std::to_string(typedObject->GetMagenta()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAGENTA , std::to_string(typedObject->GetMagenta()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kYellow = typedObject->GetYellow(); + if (!(kYellow <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__YELLOW,std::to_string(typedObject->GetYellow()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__YELLOW); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__YELLOW,std::to_string(typedObject->GetYellow()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__YELLOW); + } + } + if (!(kYellow >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__YELLOW , std::to_string(typedObject->GetYellow()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__YELLOW); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__YELLOW , std::to_string(typedObject->GetYellow()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__YELLOW); + } + } + } + } + + void ColorRgbRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ColorRgbRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ColorRgbRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kBlue = typedObject->GetBlue(); + if (!(kBlue <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__BLUE,std::to_string(typedObject->GetBlue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__BLUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__BLUE,std::to_string(typedObject->GetBlue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__BLUE); + } + } + if (!(kBlue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__BLUE , std::to_string(typedObject->GetBlue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__BLUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__BLUE , std::to_string(typedObject->GetBlue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__BLUE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kGreen = typedObject->GetGreen(); + if (!(kGreen <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__GREEN,std::to_string(typedObject->GetGreen()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__GREEN); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__GREEN,std::to_string(typedObject->GetGreen()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__GREEN); + } + } + if (!(kGreen >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__GREEN , std::to_string(typedObject->GetGreen()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__GREEN); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__GREEN , std::to_string(typedObject->GetGreen()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__GREEN); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kRed = typedObject->GetRed(); + if (!(kRed <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RED,std::to_string(typedObject->GetRed()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__RED); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RED,std::to_string(typedObject->GetRed()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__RED); + } + } + if (!(kRed >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RED , std::to_string(typedObject->GetRed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RED); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RED , std::to_string(typedObject->GetRed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RED); + } + } + } + } + + void ConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDelay = typedObject->GetDelay(); + if (!(kDelay >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DELAY , std::to_string(typedObject->GetDelay()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DELAY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DELAY , std::to_string(typedObject->GetDelay()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DELAY); + } + } + } + } + + void ControlPointRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ControlPointRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ControlPointRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTime = typedObject->GetTime(); + if (!(kTime >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME , std::to_string(typedObject->GetTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME , std::to_string(typedObject->GetTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME); + } + } + } + } + + void ControllerDistributionEntryRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ControllerDistributionEntryRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ControllerDistributionEntryRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kWeight = typedObject->GetWeight(); + if (!(kWeight > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + } + } + } + + void DimensionsRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void DimensionsRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void DimensionsRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kHeight = typedObject->GetHeight(); + if (!(kHeight >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__HEIGHT , std::to_string(typedObject->GetHeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__HEIGHT , std::to_string(typedObject->GetHeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLength = typedObject->GetLength(); + if (!(kLength >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LENGTH , std::to_string(typedObject->GetLength()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__LENGTH); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LENGTH , std::to_string(typedObject->GetLength()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__LENGTH); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kWidth = typedObject->GetWidth(); + if (!(kWidth >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WIDTH , std::to_string(typedObject->GetWidth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WIDTH); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WIDTH , std::to_string(typedObject->GetWidth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WIDTH); + } + } + } + } + + void DirectionOfTravelDistributionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void DirectionOfTravelDistributionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void DirectionOfTravelDistributionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kOpposite = typedObject->GetOpposite(); + if (!(kOpposite >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__OPPOSITE , std::to_string(typedObject->GetOpposite()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__OPPOSITE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__OPPOSITE , std::to_string(typedObject->GetOpposite()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__OPPOSITE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kSame = typedObject->GetSame(); + if (!(kSame >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SAME , std::to_string(typedObject->GetSame()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SAME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SAME , std::to_string(typedObject->GetSame()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SAME); + } + } + } + } + + void DistanceConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void DistanceConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void DistanceConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void DomeImageRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void DomeImageRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void DomeImageRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kAzimuthOffset = typedObject->GetAzimuthOffset(); + if (!(kAzimuthOffset <= M_PI *2)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET,std::to_string(typedObject->GetAzimuthOffset()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET,std::to_string(typedObject->GetAzimuthOffset()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + } + } + if (!(kAzimuthOffset >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET , std::to_string(typedObject->GetAzimuthOffset()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET , std::to_string(typedObject->GetAzimuthOffset()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + } + } + } + } + + void DynamicConstraintsRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void DynamicConstraintsRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void DynamicConstraintsRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxAcceleration = typedObject->GetMaxAcceleration(); + if (!(kMaxAcceleration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION , std::to_string(typedObject->GetMaxAcceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION , std::to_string(typedObject->GetMaxAcceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxAccelerationRate = typedObject->GetMaxAccelerationRate(); + if (!(kMaxAccelerationRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE , std::to_string(typedObject->GetMaxAccelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE , std::to_string(typedObject->GetMaxAccelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxDeceleration = typedObject->GetMaxDeceleration(); + if (!(kMaxDeceleration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION , std::to_string(typedObject->GetMaxDeceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION , std::to_string(typedObject->GetMaxDeceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxDecelerationRate = typedObject->GetMaxDecelerationRate(); + if (!(kMaxDecelerationRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE , std::to_string(typedObject->GetMaxDecelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE , std::to_string(typedObject->GetMaxDecelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxSpeed = typedObject->GetMaxSpeed(); + if (!(kMaxSpeed >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED , std::to_string(typedObject->GetMaxSpeed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED , std::to_string(typedObject->GetMaxSpeed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + } + } + } + } + + void EndOfRoadConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void EndOfRoadConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void EndOfRoadConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDuration = typedObject->GetDuration(); + if (!(kDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + } + } + } + + void EventRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void EventRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void EventRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaximumExecutionCount = typedObject->GetMaximumExecutionCount(); + if (!(kMaximumExecutionCount >= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT , std::to_string(typedObject->GetMaximumExecutionCount()), ">=", "1", OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT , std::to_string(typedObject->GetMaximumExecutionCount()), ">=", "1", OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + } + } + } + } + + void FogRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void FogRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void FogRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kVisualRange = typedObject->GetVisualRange(); + if (!(kVisualRange >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE , std::to_string(typedObject->GetVisualRange()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE , std::to_string(typedObject->GetVisualRange()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE); + } + } + } + } + + void GeoPositionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void GeoPositionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void GeoPositionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kAltitude = typedObject->GetAltitude(); + if (!(kAltitude >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ALTITUDE , std::to_string(typedObject->GetAltitude()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ALTITUDE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ALTITUDE , std::to_string(typedObject->GetAltitude()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ALTITUDE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLatitude = typedObject->GetLatitude(); + if (!(kLatitude <= M_PI)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE,std::to_string(typedObject->GetLatitude()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE,std::to_string(typedObject->GetLatitude()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + } + } + if (!(kLatitude >= (M_PI * -1))) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE , std::to_string(typedObject->GetLatitude()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE , std::to_string(typedObject->GetLatitude()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLatitudeDeg = typedObject->GetLatitudeDeg(); + if (!(kLatitudeDeg <= 90)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG,std::to_string(typedObject->GetLatitudeDeg()), "<=", "90", OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG,std::to_string(typedObject->GetLatitudeDeg()), "<=", "90", OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + } + } + if (!(kLatitudeDeg >= -90)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG , std::to_string(typedObject->GetLatitudeDeg()), ">=", "-90", OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG , std::to_string(typedObject->GetLatitudeDeg()), ">=", "-90", OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLongitude = typedObject->GetLongitude(); + if (!(kLongitude <= M_PI)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE,std::to_string(typedObject->GetLongitude()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE,std::to_string(typedObject->GetLongitude()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + } + } + if (!(kLongitude >= (M_PI * -1))) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE , std::to_string(typedObject->GetLongitude()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE , std::to_string(typedObject->GetLongitude()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLongitudeDeg = typedObject->GetLongitudeDeg(); + if (!(kLongitudeDeg <= 90)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG,std::to_string(typedObject->GetLongitudeDeg()), "<=", "90", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG,std::to_string(typedObject->GetLongitudeDeg()), "<=", "90", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + } + } + if (!(kLongitudeDeg >= -90)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG , std::to_string(typedObject->GetLongitudeDeg()), ">=", "-90", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG , std::to_string(typedObject->GetLongitudeDeg()), ">=", "-90", OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + } + } + } + } + + void LaneOffsetActionDynamicsRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LaneOffsetActionDynamicsRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LaneOffsetActionDynamicsRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxLateralAcc = typedObject->GetMaxLateralAcc(); + if (!(kMaxLateralAcc >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC , std::to_string(typedObject->GetMaxLateralAcc()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC , std::to_string(typedObject->GetMaxLateralAcc()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC); + } + } + } + } + + void LanePositionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LanePositionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LanePositionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kS = typedObject->GetS(); + if (!(kS >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__S , std::to_string(typedObject->GetS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__S); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__S , std::to_string(typedObject->GetS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__S); + } + } + } + } + + void LateralDistanceActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LateralDistanceActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LateralDistanceActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDistance = typedObject->GetDistance(); + if (!(kDistance >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE , std::to_string(typedObject->GetDistance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE , std::to_string(typedObject->GetDistance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + } + } + } + } + + void LightStateRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LightStateRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LightStateRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kFlashingOffDuration = typedObject->GetFlashingOffDuration(); + if (!(kFlashingOffDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION , std::to_string(typedObject->GetFlashingOffDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION , std::to_string(typedObject->GetFlashingOffDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kFlashingOnDuration = typedObject->GetFlashingOnDuration(); + if (!(kFlashingOnDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION , std::to_string(typedObject->GetFlashingOnDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION , std::to_string(typedObject->GetFlashingOnDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kLuminousIntensity = typedObject->GetLuminousIntensity(); + if (!(kLuminousIntensity >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY , std::to_string(typedObject->GetLuminousIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY , std::to_string(typedObject->GetLuminousIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY); + } + } + } + } + + void LightStateActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LightStateActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LightStateActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTransitionTime = typedObject->GetTransitionTime(); + if (!(kTransitionTime >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME , std::to_string(typedObject->GetTransitionTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME , std::to_string(typedObject->GetTransitionTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME); + } + } + } + } + + void LongitudinalDistanceActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void LongitudinalDistanceActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void LongitudinalDistanceActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDistance = typedObject->GetDistance(); + if (!(kDistance >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE , std::to_string(typedObject->GetDistance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE , std::to_string(typedObject->GetDistance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTimeGap = typedObject->GetTimeGap(); + if (!(kTimeGap >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME_GAP , std::to_string(typedObject->GetTimeGap()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME_GAP); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME_GAP , std::to_string(typedObject->GetTimeGap()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME_GAP); + } + } + } + } + + void ManeuverGroupRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ManeuverGroupRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ManeuverGroupRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaximumExecutionCount = typedObject->GetMaximumExecutionCount(); + if (!(kMaximumExecutionCount >= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT , std::to_string(typedObject->GetMaximumExecutionCount()), ">=", "1", OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT , std::to_string(typedObject->GetMaximumExecutionCount()), ">=", "1", OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + } + } + } + } + + void MiscObjectRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void MiscObjectRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void MiscObjectRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMass = typedObject->GetMass(); + if (!(kMass >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MASS , std::to_string(typedObject->GetMass()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MASS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MASS , std::to_string(typedObject->GetMass()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MASS); + } + } + } + } + + void NurbsRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void NurbsRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void NurbsRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kOrder = typedObject->GetOrder(); + if (!(kOrder >= 2)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ORDER , std::to_string(typedObject->GetOrder()), ">=", "2", OSC_CONSTANTS::ATTRIBUTE__ORDER); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ORDER , std::to_string(typedObject->GetOrder()), ">=", "2", OSC_CONSTANTS::ATTRIBUTE__ORDER); + } + } + } + } + + void OffroadConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OffroadConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OffroadConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDuration = typedObject->GetDuration(); + if (!(kDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + } + } + } + + void OverrideBrakeActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OverrideBrakeActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OverrideBrakeActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void OverrideClutchActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OverrideClutchActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OverrideClutchActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxRate = typedObject->GetMaxRate(); + if (!(kMaxRate <= 100)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE,std::to_string(typedObject->GetMaxRate()), "<=", "100", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE,std::to_string(typedObject->GetMaxRate()), "<=", "100", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + } + if (!(kMaxRate > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE , std::to_string(typedObject->GetMaxRate()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE , std::to_string(typedObject->GetMaxRate()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void OverrideParkingBrakeActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OverrideParkingBrakeActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OverrideParkingBrakeActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void OverrideSteeringWheelActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OverrideSteeringWheelActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OverrideSteeringWheelActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxRate = typedObject->GetMaxRate(); + if (!(kMaxRate <= 100)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE,std::to_string(typedObject->GetMaxRate()), "<=", "100", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE,std::to_string(typedObject->GetMaxRate()), "<=", "100", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + } + if (!(kMaxRate > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE , std::to_string(typedObject->GetMaxRate()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_RATE , std::to_string(typedObject->GetMaxRate()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxTorque = typedObject->GetMaxTorque(); + if (!(kMaxTorque > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE , std::to_string(typedObject->GetMaxTorque()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE , std::to_string(typedObject->GetMaxTorque()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE); + } + } + } + } + + void OverrideThrottleActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void OverrideThrottleActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void OverrideThrottleActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE,std::to_string(typedObject->GetValue()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void PerformanceRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void PerformanceRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void PerformanceRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxAcceleration = typedObject->GetMaxAcceleration(); + if (!(kMaxAcceleration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION , std::to_string(typedObject->GetMaxAcceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION , std::to_string(typedObject->GetMaxAcceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxAccelerationRate = typedObject->GetMaxAccelerationRate(); + if (!(kMaxAccelerationRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE , std::to_string(typedObject->GetMaxAccelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE , std::to_string(typedObject->GetMaxAccelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxDeceleration = typedObject->GetMaxDeceleration(); + if (!(kMaxDeceleration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION , std::to_string(typedObject->GetMaxDeceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION , std::to_string(typedObject->GetMaxDeceleration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kMaxDecelerationRate = typedObject->GetMaxDecelerationRate(); + if (!(kMaxDecelerationRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE , std::to_string(typedObject->GetMaxDecelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE , std::to_string(typedObject->GetMaxDecelerationRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + } + } + } + } + + void PhaseRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void PhaseRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void PhaseRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDuration = typedObject->GetDuration(); + if (!(kDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + } + } + } + + void PositionInLaneCoordinatesRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void PositionInLaneCoordinatesRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void PositionInLaneCoordinatesRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kPathS = typedObject->GetPathS(); + if (!(kPathS >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__PATH_S , std::to_string(typedObject->GetPathS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__PATH_S); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__PATH_S , std::to_string(typedObject->GetPathS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__PATH_S); + } + } + } + } + + void PrecipitationRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void PrecipitationRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void PrecipitationRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kIntensity = typedObject->GetIntensity(); + if (!(kIntensity <= 1)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY,std::to_string(typedObject->GetIntensity()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY,std::to_string(typedObject->GetIntensity()), "<=", "1", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + } + if (!(kIntensity >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY , std::to_string(typedObject->GetIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY , std::to_string(typedObject->GetIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + } + } + } + + void ReachPositionConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void ReachPositionConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void ReachPositionConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTolerance = typedObject->GetTolerance(); + if (!(kTolerance >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TOLERANCE , std::to_string(typedObject->GetTolerance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TOLERANCE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TOLERANCE , std::to_string(typedObject->GetTolerance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TOLERANCE); + } + } + } + } + + void RelativeClearanceConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void RelativeClearanceConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void RelativeClearanceConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDistanceBackward = typedObject->GetDistanceBackward(); + if (!(kDistanceBackward >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD , std::to_string(typedObject->GetDistanceBackward()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD , std::to_string(typedObject->GetDistanceBackward()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDistanceForward = typedObject->GetDistanceForward(); + if (!(kDistanceForward >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD , std::to_string(typedObject->GetDistanceForward()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD , std::to_string(typedObject->GetDistanceForward()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD); + } + } + } + } + + void RelativeDistanceConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void RelativeDistanceConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void RelativeDistanceConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void RoadConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void RoadConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void RoadConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kFrictionScaleFactor = typedObject->GetFrictionScaleFactor(); + if (!(kFrictionScaleFactor >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR , std::to_string(typedObject->GetFrictionScaleFactor()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR , std::to_string(typedObject->GetFrictionScaleFactor()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR); + } + } + } + } + + void RoadPositionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void RoadPositionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void RoadPositionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kS = typedObject->GetS(); + if (!(kS >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__S , std::to_string(typedObject->GetS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__S); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__S , std::to_string(typedObject->GetS()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__S); + } + } + } + } + + void SpeedProfileEntryRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void SpeedProfileEntryRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void SpeedProfileEntryRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTime = typedObject->GetTime(); + if (!(kTime >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME , std::to_string(typedObject->GetTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TIME , std::to_string(typedObject->GetTime()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__TIME); + } + } + } + } + + void StandStillConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void StandStillConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void StandStillConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDuration = typedObject->GetDuration(); + if (!(kDuration >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DURATION , std::to_string(typedObject->GetDuration()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DURATION); + } + } + } + } + + void SunRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void SunRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void SunRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kAzimuth = typedObject->GetAzimuth(); + if (!(kAzimuth <= (2* M_PI))) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH,std::to_string(typedObject->GetAzimuth()), "<=", "2PI", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH,std::to_string(typedObject->GetAzimuth()), "<=", "2PI", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + } + } + if (!(kAzimuth >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH , std::to_string(typedObject->GetAzimuth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__AZIMUTH , std::to_string(typedObject->GetAzimuth()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kElevation = typedObject->GetElevation(); + if (!(kElevation <= M_PI)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ELEVATION,std::to_string(typedObject->GetElevation()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ELEVATION,std::to_string(typedObject->GetElevation()), "<=", "PI", OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + } + } + if (!(kElevation >= (- M_PI))) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ELEVATION , std::to_string(typedObject->GetElevation()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ELEVATION , std::to_string(typedObject->GetElevation()), ">=", "-PI", OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kIlluminance = typedObject->GetIlluminance(); + if (!(kIlluminance >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE , std::to_string(typedObject->GetIlluminance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE , std::to_string(typedObject->GetIlluminance()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kIntensity = typedObject->GetIntensity(); + if (!(kIntensity >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY , std::to_string(typedObject->GetIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INTENSITY , std::to_string(typedObject->GetIntensity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + } + } + } + } + + void TimeHeadwayConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TimeHeadwayConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TimeHeadwayConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void TimeToCollisionConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TimeToCollisionConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TimeToCollisionConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void TimingRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TimingRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TimingRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kScale = typedObject->GetScale(); + if (!(kScale > 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SCALE , std::to_string(typedObject->GetScale()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__SCALE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SCALE , std::to_string(typedObject->GetScale()), ">", "0", OSC_CONSTANTS::ATTRIBUTE__SCALE); + } + } + } + } + + void TrafficSignalControllerRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TrafficSignalControllerRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TrafficSignalControllerRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDelay = typedObject->GetDelay(); + if (!(kDelay >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DELAY , std::to_string(typedObject->GetDelay()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DELAY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DELAY , std::to_string(typedObject->GetDelay()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DELAY); + } + } + } + } + + void TrafficSinkActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TrafficSinkActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TrafficSinkActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kRadius = typedObject->GetRadius(); + if (!(kRadius >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RADIUS , std::to_string(typedObject->GetRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RADIUS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RADIUS , std::to_string(typedObject->GetRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RADIUS); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kRate = typedObject->GetRate(); + if (!(kRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RATE , std::to_string(typedObject->GetRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RATE , std::to_string(typedObject->GetRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RATE); + } + } + } + } + + void TrafficSourceActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TrafficSourceActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TrafficSourceActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kRadius = typedObject->GetRadius(); + if (!(kRadius >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RADIUS , std::to_string(typedObject->GetRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RADIUS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RADIUS , std::to_string(typedObject->GetRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RADIUS); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kRate = typedObject->GetRate(); + if (!(kRate >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RATE , std::to_string(typedObject->GetRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RATE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__RATE , std::to_string(typedObject->GetRate()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__RATE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kVelocity = typedObject->GetVelocity(); + if (!(kVelocity >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VELOCITY , std::to_string(typedObject->GetVelocity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VELOCITY , std::to_string(typedObject->GetVelocity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + } + } + } + } + + void TrafficSwarmActionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TrafficSwarmActionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TrafficSwarmActionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kInnerRadius = typedObject->GetInnerRadius(); + if (!(kInnerRadius >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS , std::to_string(typedObject->GetInnerRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS , std::to_string(typedObject->GetInnerRadius()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kSemiMajorAxis = typedObject->GetSemiMajorAxis(); + if (!(kSemiMajorAxis >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS , std::to_string(typedObject->GetSemiMajorAxis()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS , std::to_string(typedObject->GetSemiMajorAxis()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kSemiMinorAxis = typedObject->GetSemiMinorAxis(); + if (!(kSemiMinorAxis >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS , std::to_string(typedObject->GetSemiMinorAxis()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS , std::to_string(typedObject->GetSemiMinorAxis()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kVelocity = typedObject->GetVelocity(); + if (!(kVelocity >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VELOCITY , std::to_string(typedObject->GetVelocity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VELOCITY , std::to_string(typedObject->GetVelocity()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + } + } + } + } + + void TransitionDynamicsRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TransitionDynamicsRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TransitionDynamicsRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void TraveledDistanceConditionRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void TraveledDistanceConditionRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void TraveledDistanceConditionRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kValue = typedObject->GetValue(); + if (!(kValue >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__VALUE , std::to_string(typedObject->GetValue()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + } + } + } + + void VehicleCategoryDistributionEntryRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void VehicleCategoryDistributionEntryRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void VehicleCategoryDistributionEntryRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kWeight = typedObject->GetWeight(); + if (!(kWeight >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + } + } + } + + void VehicleRoleDistributionEntryRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void VehicleRoleDistributionEntryRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void VehicleRoleDistributionEntryRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kWeight = typedObject->GetWeight(); + if (!(kWeight >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__WEIGHT , std::to_string(typedObject->GetWeight()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + } + } + } + } + + void WeatherRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void WeatherRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void WeatherRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kAtmosphericPressure = typedObject->GetAtmosphericPressure(); + if (!(kAtmosphericPressure <= 120000)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE,std::to_string(typedObject->GetAtmosphericPressure()), "<=", "120000", OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE,std::to_string(typedObject->GetAtmosphericPressure()), "<=", "120000", OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + } + } + if (!(kAtmosphericPressure >= 80000)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE , std::to_string(typedObject->GetAtmosphericPressure()), ">=", "80000", OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE , std::to_string(typedObject->GetAtmosphericPressure()), ">=", "80000", OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kTemperature = typedObject->GetTemperature(); + if (!(kTemperature <= 340)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE,std::to_string(typedObject->GetTemperature()), "<=", "340", OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE,std::to_string(typedObject->GetTemperature()), "<=", "340", OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + } + } + if (!(kTemperature >= 170)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE , std::to_string(typedObject->GetTemperature()), ">=", "170", OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE , std::to_string(typedObject->GetTemperature()), ">=", "170", OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + } + } + } + } + + void WindRangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void WindRangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void WindRangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kDirection = typedObject->GetDirection(); + if (!(kDirection < 2 * M_PI)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DIRECTION,std::to_string(typedObject->GetDirection()), "<", "2PI", OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DIRECTION,std::to_string(typedObject->GetDirection()), "<", "2PI", OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + } + } + if (!(kDirection >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DIRECTION , std::to_string(typedObject->GetDirection()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__DIRECTION , std::to_string(typedObject->GetDirection()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + } + } + } + if (object) + { + auto typedObject = std::dynamic_pointer_cast(object); + const auto kSpeed = typedObject->GetSpeed(); + if (!(kSpeed >= 0)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SPEED , std::to_string(typedObject->GetSpeed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SPEED); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__SPEED , std::to_string(typedObject->GetSpeed()), ">=", "0", OSC_CONSTANTS::ATTRIBUTE__SPEED); + } + } + } + } + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.h b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.h new file mode 100644 index 00000000..a2981a9a --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/checker/range/RangeCheckerRulesV1_3.h @@ -0,0 +1,992 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IParserMessageLogger.h" +#include "ApiClassInterfacesV1_3.h" +#include "RangeCheckerRule.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IAbsoluteSpeed according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteSpeedRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + AbsoluteSpeedRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IAnimationAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + AnimationActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IAnimationFile according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationFileRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + AnimationFileRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IAnimationState according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationStateRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + AnimationStateRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IAxle according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxleRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + AxleRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IClothoid according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ClothoidRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IColorCmyk according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorCmykRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ColorCmykRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IColorRgb according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorRgbRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ColorRgbRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ICondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IControlPoint according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControlPointRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ControlPointRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IControllerDistributionEntry according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionEntryRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ControllerDistributionEntryRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IDimensions according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DimensionsRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + DimensionsRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IDirectionOfTravelDistribution according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectionOfTravelDistributionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + DirectionOfTravelDistributionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IDistanceCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistanceConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + DistanceConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IDomeImage according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DomeImageRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + DomeImageRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IDynamicConstraints according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DynamicConstraintsRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + DynamicConstraintsRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IEndOfRoadCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EndOfRoadConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + EndOfRoadConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IEvent according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EventRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + EventRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IFog according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FogRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + FogRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IGeoPosition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GeoPositionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + GeoPositionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILaneOffsetActionDynamics according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionDynamicsRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LaneOffsetActionDynamicsRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILanePosition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LanePositionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LanePositionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILateralDistanceAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralDistanceActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LateralDistanceActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILightState according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LightStateRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILightStateAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LightStateActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ILongitudinalDistanceAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalDistanceActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + LongitudinalDistanceActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IManeuverGroup according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverGroupRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ManeuverGroupRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IMiscObject according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + MiscObjectRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type INurbs according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NurbsRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + NurbsRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOffroadCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OffroadConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OffroadConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOverrideBrakeAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideBrakeActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OverrideBrakeActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOverrideClutchAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideClutchActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OverrideClutchActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOverrideParkingBrakeAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideParkingBrakeActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OverrideParkingBrakeActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOverrideSteeringWheelAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideSteeringWheelActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OverrideSteeringWheelActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IOverrideThrottleAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideThrottleActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + OverrideThrottleActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IPerformance according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PerformanceRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + PerformanceRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IPhase according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PhaseRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + PhaseRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IPositionInLaneCoordinates according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInLaneCoordinatesRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + PositionInLaneCoordinatesRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IPrecipitation according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrecipitationRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + PrecipitationRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IReachPositionCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ReachPositionConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + ReachPositionConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IRelativeClearanceCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeClearanceConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + RelativeClearanceConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IRelativeDistanceCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeDistanceConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + RelativeDistanceConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IRoadCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + RoadConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IRoadPosition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadPositionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + RoadPositionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ISpeedProfileEntry according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileEntryRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + SpeedProfileEntryRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IStandStillCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StandStillConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + StandStillConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ISun according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SunRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + SunRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITimeHeadwayCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeHeadwayConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TimeHeadwayConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITimeToCollisionCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TimeToCollisionConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITiming according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimingRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TimingRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITrafficSignalController according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TrafficSignalControllerRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITrafficSinkAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSinkActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TrafficSinkActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITrafficSourceAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSourceActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TrafficSourceActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITrafficSwarmAction according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSwarmActionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TrafficSwarmActionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITransitionDynamics according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TransitionDynamicsRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TransitionDynamicsRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type ITraveledDistanceCondition according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TraveledDistanceConditionRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + TraveledDistanceConditionRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IVehicleCategoryDistributionEntry according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionEntryRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + VehicleCategoryDistributionEntryRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IVehicleRoleDistributionEntry according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionEntryRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + VehicleRoleDistributionEntryRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IWeather according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WeatherRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + WeatherRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * A range checker rule class for the type IWind according to OpenSCENARIO standard + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WindRangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + WindRangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/common/OscConstantsV1_3.h b/cpp/openScenarioLib/generated/v1_3/common/OscConstantsV1_3.h new file mode 100644 index 00000000..81a524b3 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/common/OscConstantsV1_3.h @@ -0,0 +1,555 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * This class contains constants for any literal from the OSC XSD schema (element names and attribute names) + * + * @author RA Consulting OpenSCENARIO generation facility +*/ +#pragma once +#include +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + namespace OSC_CONSTANTS + { + const std::string ATTRIBUTE__ACTIVATE_ANIMATION = "activateAnimation"; + const std::string ATTRIBUTE__ACTIVATE_LATERAL = "activateLateral"; + const std::string ATTRIBUTE__ACTIVATE_LIGHTING = "activateLighting"; + const std::string ATTRIBUTE__ACTIVATE_LONGITUDINAL = "activateLongitudinal"; + const std::string ATTRIBUTE__ACTIVE = "active"; + const std::string ATTRIBUTE__ALONG_ROUTE = "alongRoute"; + const std::string ATTRIBUTE__ALTITUDE = "altitude"; + const std::string ATTRIBUTE__ANGLE = "angle"; + const std::string ATTRIBUTE__ANGLE_TOLERANCE = "angleTolerance"; + const std::string ATTRIBUTE__ANGLE_TYPE = "angleType"; + const std::string ATTRIBUTE__ANIMATION = "animation"; + const std::string ATTRIBUTE__ANIMATION_DURATION = "animationDuration"; + const std::string ATTRIBUTE__ATMOSPHERIC_PRESSURE = "atmosphericPressure"; + const std::string ATTRIBUTE__AUTHOR = "author"; + const std::string ATTRIBUTE__AZIMUTH = "azimuth"; + const std::string ATTRIBUTE__AZIMUTH_OFFSET = "azimuthOffset"; + const std::string ATTRIBUTE__BLUE = "blue"; + const std::string ATTRIBUTE__CATALOG_NAME = "catalogName"; + const std::string ATTRIBUTE__CATEGORY = "category"; + const std::string ATTRIBUTE__CLOSED = "closed"; + const std::string ATTRIBUTE__CLOUD_STATE = "cloudState"; + const std::string ATTRIBUTE__COLOR_TYPE = "colorType"; + const std::string ATTRIBUTE__CONDITION_EDGE = "conditionEdge"; + const std::string ATTRIBUTE__CONTENT = "content"; + const std::string ATTRIBUTE__CONTINUOUS = "continuous"; + const std::string ATTRIBUTE__CONTROLLER_REF = "controllerRef"; + const std::string ATTRIBUTE__CONTROLLER_TYPE = "controllerType"; + const std::string ATTRIBUTE__COORDINATE_SYSTEM = "coordinateSystem"; + const std::string ATTRIBUTE__CURVATURE = "curvature"; + const std::string ATTRIBUTE__CURVATURE_DOT = "curvatureDot"; + const std::string ATTRIBUTE__CURVATURE_END = "curvatureEnd"; + const std::string ATTRIBUTE__CURVATURE_PRIME = "curvaturePrime"; + const std::string ATTRIBUTE__CURVATURE_START = "curvatureStart"; + const std::string ATTRIBUTE__CYAN = "cyan"; + const std::string ATTRIBUTE__DATE = "date"; + const std::string ATTRIBUTE__DATE_TIME = "dateTime"; + const std::string ATTRIBUTE__DELAY = "delay"; + const std::string ATTRIBUTE__DESCRIPTION = "description"; + const std::string ATTRIBUTE__DIRECTION = "direction"; + const std::string ATTRIBUTE__DISPLACEMENT = "displacement"; + const std::string ATTRIBUTE__DISTANCE = "distance"; + const std::string ATTRIBUTE__DISTANCE_BACKWARD = "distanceBackward"; + const std::string ATTRIBUTE__DISTANCE_FORWARD = "distanceForward"; + const std::string ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE = "domainAbsoluteRelative"; + const std::string ATTRIBUTE__DS = "ds"; + const std::string ATTRIBUTE__DS_LANE = "dsLane"; + const std::string ATTRIBUTE__DT = "dt"; + const std::string ATTRIBUTE__DURATION = "duration"; + const std::string ATTRIBUTE__DX = "dx"; + const std::string ATTRIBUTE__DY = "dy"; + const std::string ATTRIBUTE__DYNAMICS_DIMENSION = "dynamicsDimension"; + const std::string ATTRIBUTE__DYNAMICS_SHAPE = "dynamicsShape"; + const std::string ATTRIBUTE__DZ = "dz"; + const std::string ATTRIBUTE__D_LANE = "dLane"; + const std::string ATTRIBUTE__ELEVATION = "elevation"; + const std::string ATTRIBUTE__ENTITY_REF = "entityRef"; + const std::string ATTRIBUTE__ENTRY_NAME = "entryName"; + const std::string ATTRIBUTE__EXPECTED_VALUE = "expectedValue"; + const std::string ATTRIBUTE__FILEPATH = "filepath"; + const std::string ATTRIBUTE__FLASHING_OFF_DURATION = "flashingOffDuration"; + const std::string ATTRIBUTE__FLASHING_ON_DURATION = "flashingOnDuration"; + const std::string ATTRIBUTE__FOLLOWING_MODE = "followingMode"; + const std::string ATTRIBUTE__FRACTIONAL_CLOUD_COVER = "fractionalCloudCover"; + const std::string ATTRIBUTE__FREESPACE = "freespace"; + const std::string ATTRIBUTE__FREE_SPACE = "freeSpace"; + const std::string ATTRIBUTE__FRICTION_SCALE_FACTOR = "frictionScaleFactor"; + const std::string ATTRIBUTE__FROM = "from"; + const std::string ATTRIBUTE__GEAR = "gear"; + const std::string ATTRIBUTE__GESTURE = "gesture"; + const std::string ATTRIBUTE__GRAPHICS = "graphics"; + const std::string ATTRIBUTE__GREEN = "green"; + const std::string ATTRIBUTE__H = "h"; + const std::string ATTRIBUTE__HEIGHT = "height"; + const std::string ATTRIBUTE__H_OFFSET = "hOffset"; + const std::string ATTRIBUTE__ID = "id"; + const std::string ATTRIBUTE__ILLUMINANCE = "illuminance"; + const std::string ATTRIBUTE__INITIAL_DISTANCE_OFFSET = "initialDistanceOffset"; + const std::string ATTRIBUTE__INNER_RADIUS = "innerRadius"; + const std::string ATTRIBUTE__INTENSITY = "intensity"; + const std::string ATTRIBUTE__KEY = "key"; + const std::string ATTRIBUTE__LANE_ID = "laneId"; + const std::string ATTRIBUTE__LANE_OFFSET = "laneOffset"; + const std::string ATTRIBUTE__LATERAL = "lateral"; + const std::string ATTRIBUTE__LATITUDE = "latitude"; + const std::string ATTRIBUTE__LATITUDE_DEG = "latitudeDeg"; + const std::string ATTRIBUTE__LENGTH = "length"; + const std::string ATTRIBUTE__LIGHTING = "lighting"; + const std::string ATTRIBUTE__LONGITUDE = "longitude"; + const std::string ATTRIBUTE__LONGITUDE_DEG = "longitudeDeg"; + const std::string ATTRIBUTE__LONGITUDINAL = "longitudinal"; + const std::string ATTRIBUTE__LOOP = "loop"; + const std::string ATTRIBUTE__LOWER_LIMIT = "lowerLimit"; + const std::string ATTRIBUTE__LUMINOUS_INTENSITY = "luminousIntensity"; + const std::string ATTRIBUTE__MAGENTA = "magenta"; + const std::string ATTRIBUTE__MASS = "mass"; + const std::string ATTRIBUTE__MASTER_ENTITY_REF = "masterEntityRef"; + const std::string ATTRIBUTE__MAXIMUM_EXECUTION_COUNT = "maximumExecutionCount"; + const std::string ATTRIBUTE__MAX_ACCELERATION = "maxAcceleration"; + const std::string ATTRIBUTE__MAX_ACCELERATION_RATE = "maxAccelerationRate"; + const std::string ATTRIBUTE__MAX_DECELERATION = "maxDeceleration"; + const std::string ATTRIBUTE__MAX_DECELERATION_RATE = "maxDecelerationRate"; + const std::string ATTRIBUTE__MAX_LATERAL_ACC = "maxLateralAcc"; + const std::string ATTRIBUTE__MAX_RATE = "maxRate"; + const std::string ATTRIBUTE__MAX_SPEED = "maxSpeed"; + const std::string ATTRIBUTE__MAX_STEERING = "maxSteering"; + const std::string ATTRIBUTE__MAX_TORQUE = "maxTorque"; + const std::string ATTRIBUTE__MISC_OBJECT_CATEGORY = "miscObjectCategory"; + const std::string ATTRIBUTE__MODE = "mode"; + const std::string ATTRIBUTE__MODEL = "model"; + const std::string ATTRIBUTE__MODEL3D = "model3d"; + const std::string ATTRIBUTE__MONITOR_REF = "monitorRef"; + const std::string ATTRIBUTE__MOTION = "motion"; + const std::string ATTRIBUTE__NAME = "name"; + const std::string ATTRIBUTE__NUMBER = "number"; + const std::string ATTRIBUTE__NUMBER_OF_ENTITIES = "numberOfEntities"; + const std::string ATTRIBUTE__NUMBER_OF_TEST_RUNS = "numberOfTestRuns"; + const std::string ATTRIBUTE__NUMBER_OF_VEHICLES = "numberOfVehicles"; + const std::string ATTRIBUTE__OBJECT_CONTROLLER_REF = "objectControllerRef"; + const std::string ATTRIBUTE__OBJECT_TYPE = "objectType"; + const std::string ATTRIBUTE__OFFSET = "offset"; + const std::string ATTRIBUTE__OPPOSITE = "opposite"; + const std::string ATTRIBUTE__OPPOSITE_LANES = "oppositeLanes"; + const std::string ATTRIBUTE__ORDER = "order"; + const std::string ATTRIBUTE__P = "p"; + const std::string ATTRIBUTE__PARAMETER_NAME = "parameterName"; + const std::string ATTRIBUTE__PARAMETER_REF = "parameterRef"; + const std::string ATTRIBUTE__PARAMETER_TYPE = "parameterType"; + const std::string ATTRIBUTE__PATH = "path"; + const std::string ATTRIBUTE__PATH_S = "pathS"; + const std::string ATTRIBUTE__PEDESTRIAN_CATEGORY = "pedestrianCategory"; + const std::string ATTRIBUTE__PHASE = "phase"; + const std::string ATTRIBUTE__POSITION_X = "positionX"; + const std::string ATTRIBUTE__POSITION_Z = "positionZ"; + const std::string ATTRIBUTE__PRECIPITATION_INTENSITY = "precipitationIntensity"; + const std::string ATTRIBUTE__PRECIPITATION_TYPE = "precipitationType"; + const std::string ATTRIBUTE__PRIORITY = "priority"; + const std::string ATTRIBUTE__R = "r"; + const std::string ATTRIBUTE__RADIUS = "radius"; + const std::string ATTRIBUTE__RANDOM_SEED = "randomSeed"; + const std::string ATTRIBUTE__RATE = "rate"; + const std::string ATTRIBUTE__RED = "red"; + const std::string ATTRIBUTE__REFERENCE = "reference"; + const std::string ATTRIBUTE__RELATIVE_DISTANCE_TYPE = "relativeDistanceType"; + const std::string ATTRIBUTE__RESOURCE = "resource"; + const std::string ATTRIBUTE__REV_MAJOR = "revMajor"; + const std::string ATTRIBUTE__REV_MINOR = "revMinor"; + const std::string ATTRIBUTE__ROAD_ID = "roadId"; + const std::string ATTRIBUTE__ROLE = "role"; + const std::string ATTRIBUTE__ROUTE_STRATEGY = "routeStrategy"; + const std::string ATTRIBUTE__ROUTING_ALGORITHM = "routingAlgorithm"; + const std::string ATTRIBUTE__RULE = "rule"; + const std::string ATTRIBUTE__S = "s"; + const std::string ATTRIBUTE__SAME = "same"; + const std::string ATTRIBUTE__SCALE = "scale"; + const std::string ATTRIBUTE__SELECT_TRIGGERING_ENTITIES = "selectTriggeringEntities"; + const std::string ATTRIBUTE__SEMI_MAJOR_AXIS = "semiMajorAxis"; + const std::string ATTRIBUTE__SEMI_MINOR_AXIS = "semiMinorAxis"; + const std::string ATTRIBUTE__SENSORS = "sensors"; + const std::string ATTRIBUTE__SPDX_ID = "spdxId"; + const std::string ATTRIBUTE__SPEED = "speed"; + const std::string ATTRIBUTE__SPEED_TARGET_VALUE_TYPE = "speedTargetValueType"; + const std::string ATTRIBUTE__START_TIME = "startTime"; + const std::string ATTRIBUTE__STATE = "state"; + const std::string ATTRIBUTE__STEP_WIDTH = "stepWidth"; + const std::string ATTRIBUTE__STOP_TIME = "stopTime"; + const std::string ATTRIBUTE__STORYBOARD_ELEMENT_REF = "storyboardElementRef"; + const std::string ATTRIBUTE__STORYBOARD_ELEMENT_TYPE = "storyboardElementType"; + const std::string ATTRIBUTE__T = "t"; + const std::string ATTRIBUTE__TARGET_LANE_OFFSET = "targetLaneOffset"; + const std::string ATTRIBUTE__TARGET_TOLERANCE = "targetTolerance"; + const std::string ATTRIBUTE__TARGET_TOLERANCE_MASTER = "targetToleranceMaster"; + const std::string ATTRIBUTE__TEMPERATURE = "temperature"; + const std::string ATTRIBUTE__TEXT = "text"; + const std::string ATTRIBUTE__TIME = "time"; + const std::string ATTRIBUTE__TIME_END = "timeEnd"; + const std::string ATTRIBUTE__TIME_GAP = "timeGap"; + const std::string ATTRIBUTE__TIME_OFFSET = "timeOffset"; + const std::string ATTRIBUTE__TIME_START = "timeStart"; + const std::string ATTRIBUTE__TO = "to"; + const std::string ATTRIBUTE__TOLERANCE = "tolerance"; + const std::string ATTRIBUTE__TRACK_WIDTH = "trackWidth"; + const std::string ATTRIBUTE__TRAFFIC = "traffic"; + const std::string ATTRIBUTE__TRAFFIC_NAME = "trafficName"; + const std::string ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF = "trafficSignalControllerRef"; + const std::string ATTRIBUTE__TRAFFIC_SIGNAL_ID = "trafficSignalId"; + const std::string ATTRIBUTE__TRAILER_REF = "trailerRef"; + const std::string ATTRIBUTE__TRANSITION_TIME = "transitionTime"; + const std::string ATTRIBUTE__TRIGGERING_ENTITIES_RULE = "triggeringEntitiesRule"; + const std::string ATTRIBUTE__TYPE = "type"; + const std::string ATTRIBUTE__UPPER_LIMIT = "upperLimit"; + const std::string ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE = "userDefinedAnimationType"; + const std::string ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE = "userDefinedComponentType"; + const std::string ATTRIBUTE__USER_DEFINED_LIGHT_TYPE = "userDefinedLightType"; + const std::string ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION = "userDefinedPedestrianAnimation"; + const std::string ATTRIBUTE__VALUE = "value"; + const std::string ATTRIBUTE__VARIABLE_REF = "variableRef"; + const std::string ATTRIBUTE__VARIABLE_TYPE = "variableType"; + const std::string ATTRIBUTE__VARIANCE = "variance"; + const std::string ATTRIBUTE__VEHICLE_CATEGORY = "vehicleCategory"; + const std::string ATTRIBUTE__VEHICLE_COMPONENT_TYPE = "vehicleComponentType"; + const std::string ATTRIBUTE__VEHICLE_LIGHT_TYPE = "vehicleLightType"; + const std::string ATTRIBUTE__VELOCITY = "velocity"; + const std::string ATTRIBUTE__VERTICAL_ROAD_SELECTION = "verticalRoadSelection"; + const std::string ATTRIBUTE__VISUAL_RANGE = "visualRange"; + const std::string ATTRIBUTE__WEIGHT = "weight"; + const std::string ATTRIBUTE__WETNESS = "wetness"; + const std::string ATTRIBUTE__WHEEL_DIAMETER = "wheelDiameter"; + const std::string ATTRIBUTE__WIDTH = "width"; + const std::string ATTRIBUTE__X = "x"; + const std::string ATTRIBUTE__Y = "y"; + const std::string ATTRIBUTE__YELLOW = "yellow"; + const std::string ATTRIBUTE__Z = "z"; + const std::string ELEMENT__ABSOLUTE_SPEED = "AbsoluteSpeed"; + const std::string ELEMENT__ABSOLUTE_TARGET_LANE = "AbsoluteTargetLane"; + const std::string ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET = "AbsoluteTargetLaneOffset"; + const std::string ELEMENT__ABSOLUTE_TARGET_SPEED = "AbsoluteTargetSpeed"; + const std::string ELEMENT__ACCELERATION_CONDITION = "AccelerationCondition"; + const std::string ELEMENT__ACQUIRE_POSITION_ACTION = "AcquirePositionAction"; + const std::string ELEMENT__ACT = "Act"; + const std::string ELEMENT__ACTION = "Action"; + const std::string ELEMENT__ACTIONS = "Actions"; + const std::string ELEMENT__ACTIVATE_CONTROLLER_ACTION = "ActivateControllerAction"; + const std::string ELEMENT__ACTORS = "Actors"; + const std::string ELEMENT__ADDITIONAL_AXLE = "AdditionalAxle"; + const std::string ELEMENT__ADD_ENTITY_ACTION = "AddEntityAction"; + const std::string ELEMENT__ADD_VALUE = "AddValue"; + const std::string ELEMENT__ANGLE_CONDITION = "AngleCondition"; + const std::string ELEMENT__ANIMATION_ACTION = "AnimationAction"; + const std::string ELEMENT__ANIMATION_FILE = "AnimationFile"; + const std::string ELEMENT__ANIMATION_STATE = "AnimationState"; + const std::string ELEMENT__ANIMATION_TYPE = "AnimationType"; + const std::string ELEMENT__APPEARANCE_ACTION = "AppearanceAction"; + const std::string ELEMENT__ASSIGN_CONTROLLER_ACTION = "AssignControllerAction"; + const std::string ELEMENT__ASSIGN_ROUTE_ACTION = "AssignRouteAction"; + const std::string ELEMENT__AUTOMATIC_GEAR = "AutomaticGear"; + const std::string ELEMENT__AXLES = "Axles"; + const std::string ELEMENT__BIN = "Bin"; + const std::string ELEMENT__BOUNDING_BOX = "BoundingBox"; + const std::string ELEMENT__BRAKE = "Brake"; + const std::string ELEMENT__BRAKE_FORCE = "BrakeForce"; + const std::string ELEMENT__BRAKE_INPUT = "BrakeInput"; + const std::string ELEMENT__BRAKE_PERCENT = "BrakePercent"; + const std::string ELEMENT__BY_ENTITY_CONDITION = "ByEntityCondition"; + const std::string ELEMENT__BY_TYPE = "ByType"; + const std::string ELEMENT__BY_VALUE_CONDITION = "ByValueCondition"; + const std::string ELEMENT__CATALOG = "Catalog"; + const std::string ELEMENT__CATALOG_DEFINITION = "CatalogDefinition"; + const std::string ELEMENT__CATALOG_LOCATIONS = "CatalogLocations"; + const std::string ELEMENT__CATALOG_REFERENCE = "CatalogReference"; + const std::string ELEMENT__CENTER = "Center"; + const std::string ELEMENT__CENTRAL_OBJECT = "CentralObject"; + const std::string ELEMENT__CLOTHOID = "Clothoid"; + const std::string ELEMENT__CLOTHOID_SPLINE = "ClothoidSpline"; + const std::string ELEMENT__CLOTHOID_SPLINE_SEGMENT = "ClothoidSplineSegment"; + const std::string ELEMENT__CLUTCH = "Clutch"; + const std::string ELEMENT__COLLISION_CONDITION = "CollisionCondition"; + const std::string ELEMENT__COLOR = "Color"; + const std::string ELEMENT__COLOR_CMYK = "ColorCmyk"; + const std::string ELEMENT__COLOR_RGB = "ColorRgb"; + const std::string ELEMENT__COMPONENT_ANIMATION = "ComponentAnimation"; + const std::string ELEMENT__CONDITION = "Condition"; + const std::string ELEMENT__CONDITION_GROUP = "ConditionGroup"; + const std::string ELEMENT__CONNECT_TRAILER_ACTION = "ConnectTrailerAction"; + const std::string ELEMENT__CONSTRAINT_GROUP = "ConstraintGroup"; + const std::string ELEMENT__CONTROLLER = "Controller"; + const std::string ELEMENT__CONTROLLER_ACTION = "ControllerAction"; + const std::string ELEMENT__CONTROLLER_CATALOG = "ControllerCatalog"; + const std::string ELEMENT__CONTROLLER_DISTRIBUTION = "ControllerDistribution"; + const std::string ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY = "ControllerDistributionEntry"; + const std::string ELEMENT__CONTROL_POINT = "ControlPoint"; + const std::string ELEMENT__CUSTOM_COMMAND_ACTION = "CustomCommandAction"; + const std::string ELEMENT__CUSTOM_CONTENT = "CustomContent"; + const std::string ELEMENT__DELETE_ENTITY_ACTION = "DeleteEntityAction"; + const std::string ELEMENT__DETERMINISTIC = "Deterministic"; + const std::string ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION = "DeterministicMultiParameterDistribution"; + const std::string ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION_TYPE = "DeterministicMultiParameterDistributionType"; + const std::string ELEMENT__DETERMINISTIC_PARAMETER_DISTRIBUTIONS = "DeterministicParameterDistributions"; + const std::string ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION = "DeterministicSingleParameterDistribution"; + const std::string ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION_TYPE = "DeterministicSingleParameterDistributionType"; + const std::string ELEMENT__DIMENSIONS = "Dimensions"; + const std::string ELEMENT__DIRECTION_OF_TRAVEL_DISTRIBUTION = "DirectionOfTravelDistribution"; + const std::string ELEMENT__DIRECTORY = "Directory"; + const std::string ELEMENT__DISCONNECT_TRAILER_ACTION = "DisconnectTrailerAction"; + const std::string ELEMENT__DISTANCE_CONDITION = "DistanceCondition"; + const std::string ELEMENT__DISTRIBUTION_DEFINITION = "DistributionDefinition"; + const std::string ELEMENT__DISTRIBUTION_RANGE = "DistributionRange"; + const std::string ELEMENT__DISTRIBUTION_SET = "DistributionSet"; + const std::string ELEMENT__DOME_FILE = "DomeFile"; + const std::string ELEMENT__DOME_IMAGE = "DomeImage"; + const std::string ELEMENT__DYNAMIC_CONSTRAINTS = "DynamicConstraints"; + const std::string ELEMENT__ELEMENT = "Element"; + const std::string ELEMENT__END_OF_ROAD_CONDITION = "EndOfRoadCondition"; + const std::string ELEMENT__ENTITIES = "Entities"; + const std::string ELEMENT__ENTITIY_OBJECT = "EntitiyObject"; + const std::string ELEMENT__ENTITY_ACTION = "EntityAction"; + const std::string ELEMENT__ENTITY_CONDITION = "EntityCondition"; + const std::string ELEMENT__ENTITY_DISTRIBUTION = "EntityDistribution"; + const std::string ELEMENT__ENTITY_DISTRIBUTION_ENTRY = "EntityDistributionEntry"; + const std::string ELEMENT__ENTITY_OBJECT = "EntityObject"; + const std::string ELEMENT__ENTITY_REF = "EntityRef"; + const std::string ELEMENT__ENTITY_SELECTION = "EntitySelection"; + const std::string ELEMENT__ENVIRONMENT = "Environment"; + const std::string ELEMENT__ENVIRONMENT_ACTION = "EnvironmentAction"; + const std::string ELEMENT__ENVIRONMENT_CATALOG = "EnvironmentCatalog"; + const std::string ELEMENT__EVENT = "Event"; + const std::string ELEMENT__EXTERNAL_OBJECT_REFERENCE = "ExternalObjectReference"; + const std::string ELEMENT__FILE = "File"; + const std::string ELEMENT__FILE_HEADER = "FileHeader"; + const std::string ELEMENT__FINAL_SPEED = "FinalSpeed"; + const std::string ELEMENT__FOG = "Fog"; + const std::string ELEMENT__FOLLOW_TRAJECTORY_ACTION = "FollowTrajectoryAction"; + const std::string ELEMENT__FROM_CURRENT_ENTITY = "FromCurrentEntity"; + const std::string ELEMENT__FROM_LANE_COORDINATES = "FromLaneCoordinates"; + const std::string ELEMENT__FROM_ROAD_COORDINATES = "FromRoadCoordinates"; + const std::string ELEMENT__FRONT_AXLE = "FrontAxle"; + const std::string ELEMENT__GEAR = "Gear"; + const std::string ELEMENT__GEO_POSITION = "GeoPosition"; + const std::string ELEMENT__GLOBAL_ACTION = "GlobalAction"; + const std::string ELEMENT__HISTOGRAM = "Histogram"; + const std::string ELEMENT__INFRASTRUCTURE_ACTION = "InfrastructureAction"; + const std::string ELEMENT__INIT = "Init"; + const std::string ELEMENT__INITIAL_SPEED_RANGE = "InitialSpeedRange"; + const std::string ELEMENT__IN_ROUTE_POSITION = "InRoutePosition"; + const std::string ELEMENT__KNOT = "Knot"; + const std::string ELEMENT__LANE = "Lane"; + const std::string ELEMENT__LANE_CHANGE_ACTION = "LaneChangeAction"; + const std::string ELEMENT__LANE_CHANGE_ACTION_DYNAMICS = "LaneChangeActionDynamics"; + const std::string ELEMENT__LANE_CHANGE_TARGET = "LaneChangeTarget"; + const std::string ELEMENT__LANE_OFFSET_ACTION = "LaneOffsetAction"; + const std::string ELEMENT__LANE_OFFSET_ACTION_DYNAMICS = "LaneOffsetActionDynamics"; + const std::string ELEMENT__LANE_OFFSET_TARGET = "LaneOffsetTarget"; + const std::string ELEMENT__LANE_POSITION = "LanePosition"; + const std::string ELEMENT__LATERAL_ACTION = "LateralAction"; + const std::string ELEMENT__LATERAL_DISTANCE_ACTION = "LateralDistanceAction"; + const std::string ELEMENT__LICENSE = "License"; + const std::string ELEMENT__LIGHT_STATE = "LightState"; + const std::string ELEMENT__LIGHT_STATE_ACTION = "LightStateAction"; + const std::string ELEMENT__LIGHT_TYPE = "LightType"; + const std::string ELEMENT__LOGIC_FILE = "LogicFile"; + const std::string ELEMENT__LOG_NORMAL_DISTRIBUTION = "LogNormalDistribution"; + const std::string ELEMENT__LONGITUDINAL_ACTION = "LongitudinalAction"; + const std::string ELEMENT__LONGITUDINAL_DISTANCE_ACTION = "LongitudinalDistanceAction"; + const std::string ELEMENT__MANEUVER = "Maneuver"; + const std::string ELEMENT__MANEUVER_CATALOG = "ManeuverCatalog"; + const std::string ELEMENT__MANEUVER_GROUP = "ManeuverGroup"; + const std::string ELEMENT__MANUAL_GEAR = "ManualGear"; + const std::string ELEMENT__MEMBERS = "Members"; + const std::string ELEMENT__MISC_OBJECT = "MiscObject"; + const std::string ELEMENT__MISC_OBJECT_CATALOG = "MiscObjectCatalog"; + const std::string ELEMENT__MODIFY_ACTION = "ModifyAction"; + const std::string ELEMENT__MONITOR_DECLARATION = "MonitorDeclaration"; + const std::string ELEMENT__MONITOR_DECLARATIONS = "MonitorDeclarations"; + const std::string ELEMENT__MULTIPLY_BY_VALUE = "MultiplyByValue"; + const std::string ELEMENT__NONE = "None"; + const std::string ELEMENT__NORMAL_DISTRIBUTION = "NormalDistribution"; + const std::string ELEMENT__NURBS = "Nurbs"; + const std::string ELEMENT__OBJECT_CONTROLLER = "ObjectController"; + const std::string ELEMENT__OFFROAD_CONDITION = "OffroadCondition"; + const std::string ELEMENT__OPEN_SCENARIO_CATEGORY = "OpenScenarioCategory"; + const std::string ELEMENT__ORIENTATION = "Orientation"; + const std::string ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION = "OverrideControllerValueAction"; + const std::string ELEMENT__PARAMETER_ACTION = "ParameterAction"; + const std::string ELEMENT__PARAMETER_ASSIGNMENT = "ParameterAssignment"; + const std::string ELEMENT__PARAMETER_ASSIGNMENTS = "ParameterAssignments"; + const std::string ELEMENT__PARAMETER_CONDITION = "ParameterCondition"; + const std::string ELEMENT__PARAMETER_DECLARATION = "ParameterDeclaration"; + const std::string ELEMENT__PARAMETER_DECLARATIONS = "ParameterDeclarations"; + const std::string ELEMENT__PARAMETER_VALUE_DISTRIBUTION = "ParameterValueDistribution"; + const std::string ELEMENT__PARAMETER_VALUE_DISTRIBUTION_DEFINITION = "ParameterValueDistributionDefinition"; + const std::string ELEMENT__PARAMETER_VALUE_SET = "ParameterValueSet"; + const std::string ELEMENT__PARKING_BRAKE = "ParkingBrake"; + const std::string ELEMENT__PEDESTRIAN = "Pedestrian"; + const std::string ELEMENT__PEDESTRIAN_ANIMATION = "PedestrianAnimation"; + const std::string ELEMENT__PEDESTRIAN_CATALOG = "PedestrianCatalog"; + const std::string ELEMENT__PEDESTRIAN_GESTURE = "PedestrianGesture"; + const std::string ELEMENT__PERFORMANCE = "Performance"; + const std::string ELEMENT__PHASE = "Phase"; + const std::string ELEMENT__POISSON_DISTRIBUTION = "PoissonDistribution"; + const std::string ELEMENT__POLYGON = "Polygon"; + const std::string ELEMENT__POLYLINE = "Polyline"; + const std::string ELEMENT__POSITION = "Position"; + const std::string ELEMENT__POSITION_START = "PositionStart"; + const std::string ELEMENT__PRECIPITATION = "Precipitation"; + const std::string ELEMENT__PRIVATE = "Private"; + const std::string ELEMENT__PRIVATE_ACTION = "PrivateAction"; + const std::string ELEMENT__PROBABILITY_DISTRIBUTION_SET = "ProbabilityDistributionSet"; + const std::string ELEMENT__PROPERTIES = "Properties"; + const std::string ELEMENT__PROPERTY = "Property"; + const std::string ELEMENT__RANDOM_ROUTE_ACTION = "RandomRouteAction"; + const std::string ELEMENT__RANGE = "Range"; + const std::string ELEMENT__REACH_POSITION_CONDITION = "ReachPositionCondition"; + const std::string ELEMENT__REAR_AXLE = "RearAxle"; + const std::string ELEMENT__RELATIVE_ANGLE_CONDITION = "RelativeAngleCondition"; + const std::string ELEMENT__RELATIVE_CLEARANCE_CONDITION = "RelativeClearanceCondition"; + const std::string ELEMENT__RELATIVE_DISTANCE_CONDITION = "RelativeDistanceCondition"; + const std::string ELEMENT__RELATIVE_LANE_POSITION = "RelativeLanePosition"; + const std::string ELEMENT__RELATIVE_LANE_RANGE = "RelativeLaneRange"; + const std::string ELEMENT__RELATIVE_OBJECT_POSITION = "RelativeObjectPosition"; + const std::string ELEMENT__RELATIVE_ROAD_POSITION = "RelativeRoadPosition"; + const std::string ELEMENT__RELATIVE_SPEED_CONDITION = "RelativeSpeedCondition"; + const std::string ELEMENT__RELATIVE_SPEED_TO_MASTER = "RelativeSpeedToMaster"; + const std::string ELEMENT__RELATIVE_TARGET_LANE = "RelativeTargetLane"; + const std::string ELEMENT__RELATIVE_TARGET_LANE_OFFSET = "RelativeTargetLaneOffset"; + const std::string ELEMENT__RELATIVE_TARGET_SPEED = "RelativeTargetSpeed"; + const std::string ELEMENT__RELATIVE_WORLD_POSITION = "RelativeWorldPosition"; + const std::string ELEMENT__ROAD_CONDITION = "RoadCondition"; + const std::string ELEMENT__ROAD_CURSOR = "RoadCursor"; + const std::string ELEMENT__ROAD_NETWORK = "RoadNetwork"; + const std::string ELEMENT__ROAD_POSITION = "RoadPosition"; + const std::string ELEMENT__ROAD_RANGE = "RoadRange"; + const std::string ELEMENT__ROUTE = "Route"; + const std::string ELEMENT__ROUTE_CATALOG = "RouteCatalog"; + const std::string ELEMENT__ROUTE_POSITION = "RoutePosition"; + const std::string ELEMENT__ROUTE_REF = "RouteRef"; + const std::string ELEMENT__ROUTING_ACTION = "RoutingAction"; + const std::string ELEMENT__RULE = "Rule"; + const std::string ELEMENT__SCENARIO_DEFINITION = "ScenarioDefinition"; + const std::string ELEMENT__SCENARIO_FILE = "ScenarioFile"; + const std::string ELEMENT__SCENARIO_OBJECT = "ScenarioObject"; + const std::string ELEMENT__SCENARIO_OBJECT_TEMPLATE = "ScenarioObjectTemplate"; + const std::string ELEMENT__SCENE_GRAPH_FILE = "SceneGraphFile"; + const std::string ELEMENT__SENSOR_REFERENCE = "SensorReference"; + const std::string ELEMENT__SENSOR_REFERENCE_SET = "SensorReferenceSet"; + const std::string ELEMENT__SET_ACTION = "SetAction"; + const std::string ELEMENT__SET_MONITOR_ACTION = "SetMonitorAction"; + const std::string ELEMENT__SHAPE = "Shape"; + const std::string ELEMENT__SIMULATION_TIME_CONDITION = "SimulationTimeCondition"; + const std::string ELEMENT__SPEED_ACTION = "SpeedAction"; + const std::string ELEMENT__SPEED_ACTION_DYNAMICS = "SpeedActionDynamics"; + const std::string ELEMENT__SPEED_ACTION_TARGET = "SpeedActionTarget"; + const std::string ELEMENT__SPEED_CONDITION = "SpeedCondition"; + const std::string ELEMENT__SPEED_PROFILE_ACTION = "SpeedProfileAction"; + const std::string ELEMENT__SPEED_PROFILE_ENTRY = "SpeedProfileEntry"; + const std::string ELEMENT__STAND_STILL_CONDITION = "StandStillCondition"; + const std::string ELEMENT__START_TRIGGER = "StartTrigger"; + const std::string ELEMENT__STEADY_STATE = "SteadyState"; + const std::string ELEMENT__STEERING_WHEEL = "SteeringWheel"; + const std::string ELEMENT__STOCHASTIC = "Stochastic"; + const std::string ELEMENT__STOCHASTIC_DISTRIBUTION = "StochasticDistribution"; + const std::string ELEMENT__STOCHASTIC_DISTRIBUTION_TYPE = "StochasticDistributionType"; + const std::string ELEMENT__STOP_TRIGGER = "StopTrigger"; + const std::string ELEMENT__STORY = "Story"; + const std::string ELEMENT__STORYBOARD = "Storyboard"; + const std::string ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION = "StoryboardElementStateCondition"; + const std::string ELEMENT__SUN = "Sun"; + const std::string ELEMENT__SYNCHRONIZE_ACTION = "SynchronizeAction"; + const std::string ELEMENT__TARGET_DISTANCE_STEADY_STATE = "TargetDistanceSteadyState"; + const std::string ELEMENT__TARGET_POSITION = "TargetPosition"; + const std::string ELEMENT__TARGET_POSITION_MASTER = "TargetPositionMaster"; + const std::string ELEMENT__TARGET_TIME_STEADY_STATE = "TargetTimeSteadyState"; + const std::string ELEMENT__TELEPORT_ACTION = "TeleportAction"; + const std::string ELEMENT__THROTTLE = "Throttle"; + const std::string ELEMENT__TIME_HEADWAY_CONDITION = "TimeHeadwayCondition"; + const std::string ELEMENT__TIME_OF_DAY = "TimeOfDay"; + const std::string ELEMENT__TIME_OF_DAY_CONDITION = "TimeOfDayCondition"; + const std::string ELEMENT__TIME_REFERENCE = "TimeReference"; + const std::string ELEMENT__TIME_TO_COLLISION_CONDITION = "TimeToCollisionCondition"; + const std::string ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET = "TimeToCollisionConditionTarget"; + const std::string ELEMENT__TIMING = "Timing"; + const std::string ELEMENT__TRAFFIC_ACTION = "TrafficAction"; + const std::string ELEMENT__TRAFFIC_AREA = "TrafficArea"; + const std::string ELEMENT__TRAFFIC_AREA_ACTION = "TrafficAreaAction"; + const std::string ELEMENT__TRAFFIC_DEFINITION = "TrafficDefinition"; + const std::string ELEMENT__TRAFFIC_DISTRIBUTION = "TrafficDistribution"; + const std::string ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY = "TrafficDistributionEntry"; + const std::string ELEMENT__TRAFFIC_SIGNALS = "TrafficSignals"; + const std::string ELEMENT__TRAFFIC_SIGNAL_ACTION = "TrafficSignalAction"; + const std::string ELEMENT__TRAFFIC_SIGNAL_CONDITION = "TrafficSignalCondition"; + const std::string ELEMENT__TRAFFIC_SIGNAL_CONTROLLER = "TrafficSignalController"; + const std::string ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION = "TrafficSignalControllerAction"; + const std::string ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION = "TrafficSignalControllerCondition"; + const std::string ELEMENT__TRAFFIC_SIGNAL_GROUP_STATE = "TrafficSignalGroupState"; + const std::string ELEMENT__TRAFFIC_SIGNAL_STATE = "TrafficSignalState"; + const std::string ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION = "TrafficSignalStateAction"; + const std::string ELEMENT__TRAFFIC_SINK_ACTION = "TrafficSinkAction"; + const std::string ELEMENT__TRAFFIC_SOURCE_ACTION = "TrafficSourceAction"; + const std::string ELEMENT__TRAFFIC_STOP_ACTION = "TrafficStopAction"; + const std::string ELEMENT__TRAFFIC_SWARM_ACTION = "TrafficSwarmAction"; + const std::string ELEMENT__TRAILER = "Trailer"; + const std::string ELEMENT__TRAILER_ACTION = "TrailerAction"; + const std::string ELEMENT__TRAILER_COUPLER = "TrailerCoupler"; + const std::string ELEMENT__TRAILER_HITCH = "TrailerHitch"; + const std::string ELEMENT__TRAILER_REF = "TrailerRef"; + const std::string ELEMENT__TRAJECTORY = "Trajectory"; + const std::string ELEMENT__TRAJECTORY_CATALOG = "TrajectoryCatalog"; + const std::string ELEMENT__TRAJECTORY_FOLLOWING_MODE = "TrajectoryFollowingMode"; + const std::string ELEMENT__TRAJECTORY_POSITION = "TrajectoryPosition"; + const std::string ELEMENT__TRAJECTORY_REF = "TrajectoryRef"; + const std::string ELEMENT__TRAVELED_DISTANCE_CONDITION = "TraveledDistanceCondition"; + const std::string ELEMENT__TRIGGERING_ENTITIES = "TriggeringEntities"; + const std::string ELEMENT__UNIFORM_DISTRIBUTION = "UniformDistribution"; + const std::string ELEMENT__USED_AREA = "UsedArea"; + const std::string ELEMENT__USER_DEFINED_ACTION = "UserDefinedAction"; + const std::string ELEMENT__USER_DEFINED_ANIMATION = "UserDefinedAnimation"; + const std::string ELEMENT__USER_DEFINED_COMPONENT = "UserDefinedComponent"; + const std::string ELEMENT__USER_DEFINED_DISTRIBUTION = "UserDefinedDistribution"; + const std::string ELEMENT__USER_DEFINED_LIGHT = "UserDefinedLight"; + const std::string ELEMENT__USER_DEFINED_VALUE_CONDITION = "UserDefinedValueCondition"; + const std::string ELEMENT__VALUE_CONSTRAINT = "ValueConstraint"; + const std::string ELEMENT__VALUE_SET_DISTRIBUTION = "ValueSetDistribution"; + const std::string ELEMENT__VARIABLE_ACTION = "VariableAction"; + const std::string ELEMENT__VARIABLE_CONDITION = "VariableCondition"; + const std::string ELEMENT__VARIABLE_DECLARATION = "VariableDeclaration"; + const std::string ELEMENT__VARIABLE_DECLARATIONS = "VariableDeclarations"; + const std::string ELEMENT__VEHICLE = "Vehicle"; + const std::string ELEMENT__VEHICLE_CATALOG = "VehicleCatalog"; + const std::string ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION = "VehicleCategoryDistribution"; + const std::string ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY = "VehicleCategoryDistributionEntry"; + const std::string ELEMENT__VEHICLE_COMPONENT = "VehicleComponent"; + const std::string ELEMENT__VEHICLE_LIGHT = "VehicleLight"; + const std::string ELEMENT__VEHICLE_ROLE_DISTRIBUTION = "VehicleRoleDistribution"; + const std::string ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY = "VehicleRoleDistributionEntry"; + const std::string ELEMENT__VERTEX = "Vertex"; + const std::string ELEMENT__VISIBILITY_ACTION = "VisibilityAction"; + const std::string ELEMENT__WAYPOINT = "Waypoint"; + const std::string ELEMENT__WEATHER = "Weather"; + const std::string ELEMENT__WIND = "Wind"; + const std::string ELEMENT__WORLD_POSITION = "WorldPosition"; + } + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.cpp new file mode 100644 index 00000000..cb90a17e --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.cpp @@ -0,0 +1,8540 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include +#include +#include "XmlExportHelper.h" +#include "IParserMessageLogger.h" +#include "OscConstantsV1_3.h" +#include "INamedReference.h" +#include "ApiClassImplV1_3.h" +#include "ApiClassInterfacesV1_3.h" + +#include "OpenScenarioXmlExporterV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + std::shared_ptr OpenScenarioXmlExporter::CreateXmlDocument(std::shared_ptr openScenarioWriter) + { + auto document = std::make_shared(); + + try + { + tinyxml2::XMLNode* root = document->NewElement("OpenSCENARIO"); + document->InsertFirstChild(root); + FillOpenScenarioNode(document, root, openScenarioWriter); + } + catch (std::exception& e) + { + (void)e; + // do nothing + } + + return document; + } + + void OpenScenarioXmlExporter::FillAbsoluteSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteSpeedWriter) + { + // Add Attributes (Parameters) + const auto kValue = absoluteSpeedWriter->GetValue(); + if (absoluteSpeedWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), absoluteSpeedWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + const auto kSteadyState = absoluteSpeedWriter->GetWriterSteadyState(); + if (kSteadyState) + { + FillSteadyStateNode(document, elementNode, kSteadyState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAbsoluteTargetLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetLaneWriter) + { + // Add Attributes (Parameters) + const auto kValue = absoluteTargetLaneWriter->GetValue(); + if (absoluteTargetLaneWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), absoluteTargetLaneWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAbsoluteTargetLaneOffsetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetLaneOffsetWriter) + { + // Add Attributes (Parameters) + const auto kValue = absoluteTargetLaneOffsetWriter->GetValue(); + if (absoluteTargetLaneOffsetWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), absoluteTargetLaneOffsetWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAbsoluteTargetSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetSpeedWriter) + { + // Add Attributes (Parameters) + const auto kValue = absoluteTargetSpeedWriter->GetValue(); + if (absoluteTargetSpeedWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), absoluteTargetSpeedWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAccelerationConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr accelerationConditionWriter) + { + // Add Attributes (Parameters) + const auto kDirection = accelerationConditionWriter->GetDirection(); + if (!( kDirection == DirectionalDimension::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), kDirection.GetLiteral().c_str()); + } + else if (accelerationConditionWriter->IsDirectionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), accelerationConditionWriter->GetParameterFromDirection().c_str()); + } + const auto kRule = accelerationConditionWriter->GetRule(); + if (accelerationConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), accelerationConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = accelerationConditionWriter->GetValue(); + if (accelerationConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), accelerationConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAcquirePositionActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr acquirePositionActionWriter) + { + // Add Attributes (Parameters) + const auto kPosition = acquirePositionActionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillActNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actWriter) + { + // Add Attributes (Parameters) + const auto kName = actWriter->GetName(); + if (actWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), actWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kManeuverGroups = actWriter->GetWriterManeuverGroups(); + if (!kManeuverGroups.empty()) + { + for (auto maneuverGroupsWriterItem : kManeuverGroups) + { + tinyxml2::XMLNode* maneuverGroupsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MANEUVER_GROUP.c_str()); + elementNode->InsertEndChild(maneuverGroupsElement); + FillManeuverGroupNode(document, maneuverGroupsElement, maneuverGroupsWriterItem); + + } + } + const auto kStartTrigger = actWriter->GetWriterStartTrigger(); + if (kStartTrigger) + { + tinyxml2::XMLNode* startTriggerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__START_TRIGGER.c_str()); + elementNode->InsertEndChild(startTriggerElement); + FillTriggerNode(document, startTriggerElement, kStartTrigger); + } + const auto kStopTrigger = actWriter->GetWriterStopTrigger(); + if (kStopTrigger) + { + tinyxml2::XMLNode* stopTriggerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STOP_TRIGGER.c_str()); + elementNode->InsertEndChild(stopTriggerElement); + FillTriggerNode(document, stopTriggerElement, kStopTrigger); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actionWriter) + { + // Add Attributes (Parameters) + const auto kName = actionWriter->GetName(); + if (actionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), actionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kGlobalAction = actionWriter->GetWriterGlobalAction(); + if (kGlobalAction) + { + tinyxml2::XMLNode* globalActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION.c_str()); + elementNode->InsertEndChild(globalActionElement); + FillGlobalActionNode(document, globalActionElement, kGlobalAction); + } + const auto kUserDefinedAction = actionWriter->GetWriterUserDefinedAction(); + if (kUserDefinedAction) + { + tinyxml2::XMLNode* userDefinedActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION.c_str()); + elementNode->InsertEndChild(userDefinedActionElement); + FillUserDefinedActionNode(document, userDefinedActionElement, kUserDefinedAction); + } + const auto kPrivateAction = actionWriter->GetWriterPrivateAction(); + if (kPrivateAction) + { + tinyxml2::XMLNode* privateActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION.c_str()); + elementNode->InsertEndChild(privateActionElement); + FillPrivateActionNode(document, privateActionElement, kPrivateAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillActivateControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr activateControllerActionWriter) + { + // Add Attributes (Parameters) + const auto kAnimation = activateControllerActionWriter->GetAnimation(); + if (!( kAnimation == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kAnimation).c_str()); + } + else if (activateControllerActionWriter->IsAnimationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION.c_str(), activateControllerActionWriter->GetParameterFromAnimation().c_str()); + } + const auto kControllerRef = activateControllerActionWriter->GetControllerRef(); + if (kControllerRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kControllerRef->GetNameRef()).c_str()); + } + const auto kLateral = activateControllerActionWriter->GetLateral(); + if (!( kLateral == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATERAL.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kLateral).c_str()); + } + else if (activateControllerActionWriter->IsLateralParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATERAL.c_str(), activateControllerActionWriter->GetParameterFromLateral().c_str()); + } + const auto kLighting = activateControllerActionWriter->GetLighting(); + if (!( kLighting == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LIGHTING.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kLighting).c_str()); + } + else if (activateControllerActionWriter->IsLightingParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LIGHTING.c_str(), activateControllerActionWriter->GetParameterFromLighting().c_str()); + } + const auto kLongitudinal = activateControllerActionWriter->GetLongitudinal(); + if (!( kLongitudinal == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kLongitudinal).c_str()); + } + else if (activateControllerActionWriter->IsLongitudinalParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL.c_str(), activateControllerActionWriter->GetParameterFromLongitudinal().c_str()); + } + const auto kObjectControllerRef = activateControllerActionWriter->GetObjectControllerRef(); + if (kObjectControllerRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kObjectControllerRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillActorsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actorsWriter) + { + // Add Attributes (Parameters) + const auto kSelectTriggeringEntities = actorsWriter->GetSelectTriggeringEntities(); + if (actorsWriter->IsSelectTriggeringEntitiesParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES.c_str(), actorsWriter->GetParameterFromSelectTriggeringEntities().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kSelectTriggeringEntities).c_str()); + } + const auto kEntityRefs = actorsWriter->GetWriterEntityRefs(); + if (!kEntityRefs.empty()) + { + for (auto entityRefsWriterItem : kEntityRefs) + { + tinyxml2::XMLNode* entityRefsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefsElement); + FillEntityRefNode(document, entityRefsElement, entityRefsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAddEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr addEntityActionWriter) + { + // Add Attributes (Parameters) + const auto kPosition = addEntityActionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAngleConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr angleConditionWriter) + { + // Add Attributes (Parameters) + const auto kAngle = angleConditionWriter->GetAngle(); + if (angleConditionWriter->IsAngleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE.c_str(), angleConditionWriter->GetParameterFromAngle().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAngle).c_str()); + } + const auto kAngleTolerance = angleConditionWriter->GetAngleTolerance(); + if (angleConditionWriter->IsAngleToleranceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE.c_str(), angleConditionWriter->GetParameterFromAngleTolerance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAngleTolerance).c_str()); + } + const auto kAngleType = angleConditionWriter->GetAngleType(); + if (angleConditionWriter->IsAngleTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE.c_str(), angleConditionWriter->GetParameterFromAngleType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE.c_str(), kAngleType.GetLiteral().c_str()); + } + const auto kCoordinateSystem = angleConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (angleConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), angleConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAnimationActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationActionWriter) + { + // Add Attributes (Parameters) + const auto kAnimationDuration = animationActionWriter->GetAnimationDuration(); + if (!( kAnimationDuration == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAnimationDuration).c_str()); + } + else if (animationActionWriter->IsAnimationDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION.c_str(), animationActionWriter->GetParameterFromAnimationDuration().c_str()); + } + const auto kLoop = animationActionWriter->GetLoop(); + if (!( kLoop == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LOOP.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kLoop).c_str()); + } + else if (animationActionWriter->IsLoopParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LOOP.c_str(), animationActionWriter->GetParameterFromLoop().c_str()); + } + const auto kAnimationType = animationActionWriter->GetWriterAnimationType(); + if (kAnimationType) + { + tinyxml2::XMLNode* animationTypeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ANIMATION_TYPE.c_str()); + elementNode->InsertEndChild(animationTypeElement); + FillAnimationTypeNode(document, animationTypeElement, kAnimationType); + } + const auto kAnimationState = animationActionWriter->GetWriterAnimationState(); + if (kAnimationState) + { + tinyxml2::XMLNode* animationStateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ANIMATION_STATE.c_str()); + elementNode->InsertEndChild(animationStateElement); + FillAnimationStateNode(document, animationStateElement, kAnimationState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAnimationFileNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationFileWriter) + { + // Add Attributes (Parameters) + const auto kTimeOffset = animationFileWriter->GetTimeOffset(); + if (!( kTimeOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTimeOffset).c_str()); + } + else if (animationFileWriter->IsTimeOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET.c_str(), animationFileWriter->GetParameterFromTimeOffset().c_str()); + } + const auto kFile = animationFileWriter->GetWriterFile(); + if (kFile) + { + tinyxml2::XMLNode* fileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FILE.c_str()); + elementNode->InsertEndChild(fileElement); + FillFileNode(document, fileElement, kFile); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAnimationStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationStateWriter) + { + // Add Attributes (Parameters) + const auto kState = animationStateWriter->GetState(); + if (animationStateWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), animationStateWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kState).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAnimationTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationTypeWriter) + { + // Add Attributes (Parameters) + const auto kComponentAnimation = animationTypeWriter->GetWriterComponentAnimation(); + if (kComponentAnimation) + { + tinyxml2::XMLNode* componentAnimationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION.c_str()); + elementNode->InsertEndChild(componentAnimationElement); + FillComponentAnimationNode(document, componentAnimationElement, kComponentAnimation); + } + const auto kPedestrianAnimation = animationTypeWriter->GetWriterPedestrianAnimation(); + if (kPedestrianAnimation) + { + tinyxml2::XMLNode* pedestrianAnimationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION.c_str()); + elementNode->InsertEndChild(pedestrianAnimationElement); + FillPedestrianAnimationNode(document, pedestrianAnimationElement, kPedestrianAnimation); + } + const auto kAnimationFile = animationTypeWriter->GetWriterAnimationFile(); + if (kAnimationFile) + { + tinyxml2::XMLNode* animationFileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ANIMATION_FILE.c_str()); + elementNode->InsertEndChild(animationFileElement); + FillAnimationFileNode(document, animationFileElement, kAnimationFile); + } + const auto kUserDefinedAnimation = animationTypeWriter->GetWriterUserDefinedAnimation(); + if (kUserDefinedAnimation) + { + tinyxml2::XMLNode* userDefinedAnimationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION.c_str()); + elementNode->InsertEndChild(userDefinedAnimationElement); + FillUserDefinedAnimationNode(document, userDefinedAnimationElement, kUserDefinedAnimation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAppearanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr appearanceActionWriter) + { + // Add Attributes (Parameters) + const auto kLightStateAction = appearanceActionWriter->GetWriterLightStateAction(); + if (kLightStateAction) + { + tinyxml2::XMLNode* lightStateActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION.c_str()); + elementNode->InsertEndChild(lightStateActionElement); + FillLightStateActionNode(document, lightStateActionElement, kLightStateAction); + } + const auto kAnimationAction = appearanceActionWriter->GetWriterAnimationAction(); + if (kAnimationAction) + { + tinyxml2::XMLNode* animationActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION.c_str()); + elementNode->InsertEndChild(animationActionElement); + FillAnimationActionNode(document, animationActionElement, kAnimationAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAssignControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr assignControllerActionWriter) + { + // Add Attributes (Parameters) + const auto kActivateAnimation = assignControllerActionWriter->GetActivateAnimation(); + if (!( kActivateAnimation == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActivateAnimation).c_str()); + } + else if (assignControllerActionWriter->IsActivateAnimationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION.c_str(), assignControllerActionWriter->GetParameterFromActivateAnimation().c_str()); + } + const auto kActivateLateral = assignControllerActionWriter->GetActivateLateral(); + if (!( kActivateLateral == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActivateLateral).c_str()); + } + else if (assignControllerActionWriter->IsActivateLateralParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL.c_str(), assignControllerActionWriter->GetParameterFromActivateLateral().c_str()); + } + const auto kActivateLighting = assignControllerActionWriter->GetActivateLighting(); + if (!( kActivateLighting == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActivateLighting).c_str()); + } + else if (assignControllerActionWriter->IsActivateLightingParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING.c_str(), assignControllerActionWriter->GetParameterFromActivateLighting().c_str()); + } + const auto kActivateLongitudinal = assignControllerActionWriter->GetActivateLongitudinal(); + if (!( kActivateLongitudinal == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActivateLongitudinal).c_str()); + } + else if (assignControllerActionWriter->IsActivateLongitudinalParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL.c_str(), assignControllerActionWriter->GetParameterFromActivateLongitudinal().c_str()); + } + const auto kController = assignControllerActionWriter->GetWriterController(); + if (kController) + { + tinyxml2::XMLNode* controllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER.c_str()); + elementNode->InsertEndChild(controllerElement); + FillControllerNode(document, controllerElement, kController); + } + const auto kCatalogReference = assignControllerActionWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + const auto kObjectController = assignControllerActionWriter->GetWriterObjectController(); + if (kObjectController) + { + tinyxml2::XMLNode* objectControllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER.c_str()); + elementNode->InsertEndChild(objectControllerElement); + FillObjectControllerNode(document, objectControllerElement, kObjectController); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAssignRouteActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr assignRouteActionWriter) + { + // Add Attributes (Parameters) + const auto kRoute = assignRouteActionWriter->GetWriterRoute(); + if (kRoute) + { + tinyxml2::XMLNode* routeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE.c_str()); + elementNode->InsertEndChild(routeElement); + FillRouteNode(document, routeElement, kRoute); + } + const auto kCatalogReference = assignRouteActionWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAutomaticGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr automaticGearWriter) + { + // Add Attributes (Parameters) + const auto kGear = automaticGearWriter->GetGear(); + if (automaticGearWriter->IsGearParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GEAR.c_str(), automaticGearWriter->GetParameterFromGear().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GEAR.c_str(), kGear.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAxleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr axleWriter) + { + // Add Attributes (Parameters) + const auto kMaxSteering = axleWriter->GetMaxSteering(); + if (axleWriter->IsMaxSteeringParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING.c_str(), axleWriter->GetParameterFromMaxSteering().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxSteering).c_str()); + } + const auto kPositionX = axleWriter->GetPositionX(); + if (axleWriter->IsPositionXParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__POSITION_X.c_str(), axleWriter->GetParameterFromPositionX().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__POSITION_X.c_str(), XmlExportHelper::ToXmlStringFromDouble( kPositionX).c_str()); + } + const auto kPositionZ = axleWriter->GetPositionZ(); + if (axleWriter->IsPositionZParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z.c_str(), axleWriter->GetParameterFromPositionZ().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z.c_str(), XmlExportHelper::ToXmlStringFromDouble( kPositionZ).c_str()); + } + const auto kTrackWidth = axleWriter->GetTrackWidth(); + if (axleWriter->IsTrackWidthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH.c_str(), axleWriter->GetParameterFromTrackWidth().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTrackWidth).c_str()); + } + const auto kWheelDiameter = axleWriter->GetWheelDiameter(); + if (axleWriter->IsWheelDiameterParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER.c_str(), axleWriter->GetParameterFromWheelDiameter().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWheelDiameter).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillAxlesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr axlesWriter) + { + // Add Attributes (Parameters) + const auto kFrontAxle = axlesWriter->GetWriterFrontAxle(); + if (kFrontAxle) + { + tinyxml2::XMLNode* frontAxleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FRONT_AXLE.c_str()); + elementNode->InsertEndChild(frontAxleElement); + FillAxleNode(document, frontAxleElement, kFrontAxle); + } + const auto kRearAxle = axlesWriter->GetWriterRearAxle(); + if (kRearAxle) + { + tinyxml2::XMLNode* rearAxleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__REAR_AXLE.c_str()); + elementNode->InsertEndChild(rearAxleElement); + FillAxleNode(document, rearAxleElement, kRearAxle); + } + const auto kAdditionalAxles = axlesWriter->GetWriterAdditionalAxles(); + if (!kAdditionalAxles.empty()) + { + for (auto additionalAxlesWriterItem : kAdditionalAxles) + { + tinyxml2::XMLNode* additionalAxlesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ADDITIONAL_AXLE.c_str()); + elementNode->InsertEndChild(additionalAxlesElement); + FillAxleNode(document, additionalAxlesElement, additionalAxlesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillBoundingBoxNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr boundingBoxWriter) + { + // Add Attributes (Parameters) + const auto kCenter = boundingBoxWriter->GetWriterCenter(); + if (kCenter) + { + tinyxml2::XMLNode* centerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CENTER.c_str()); + elementNode->InsertEndChild(centerElement); + FillCenterNode(document, centerElement, kCenter); + } + const auto kDimensions = boundingBoxWriter->GetWriterDimensions(); + if (kDimensions) + { + tinyxml2::XMLNode* dimensionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIMENSIONS.c_str()); + elementNode->InsertEndChild(dimensionsElement); + FillDimensionsNode(document, dimensionsElement, kDimensions); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillBrakeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr brakeWriter) + { + // Add Attributes (Parameters) + const auto kMaxRate = brakeWriter->GetMaxRate(); + if (!( kMaxRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxRate).c_str()); + } + else if (brakeWriter->IsMaxRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), brakeWriter->GetParameterFromMaxRate().c_str()); + } + const auto kValue = brakeWriter->GetValue(); + if (brakeWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), brakeWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillBrakeInputNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr brakeInputWriter) + { + // Add Attributes (Parameters) + const auto kBrakePercent = brakeInputWriter->GetWriterBrakePercent(); + if (kBrakePercent) + { + tinyxml2::XMLNode* brakePercentElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT.c_str()); + elementNode->InsertEndChild(brakePercentElement); + FillBrakeNode(document, brakePercentElement, kBrakePercent); + } + const auto kBrakeForce = brakeInputWriter->GetWriterBrakeForce(); + if (kBrakeForce) + { + tinyxml2::XMLNode* brakeForceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BRAKE_FORCE.c_str()); + elementNode->InsertEndChild(brakeForceElement); + FillBrakeNode(document, brakeForceElement, kBrakeForce); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillByEntityConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byEntityConditionWriter) + { + // Add Attributes (Parameters) + const auto kTriggeringEntities = byEntityConditionWriter->GetWriterTriggeringEntities(); + if (kTriggeringEntities) + { + tinyxml2::XMLNode* triggeringEntitiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRIGGERING_ENTITIES.c_str()); + elementNode->InsertEndChild(triggeringEntitiesElement); + FillTriggeringEntitiesNode(document, triggeringEntitiesElement, kTriggeringEntities); + } + const auto kEntityCondition = byEntityConditionWriter->GetWriterEntityCondition(); + if (kEntityCondition) + { + tinyxml2::XMLNode* entityConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_CONDITION.c_str()); + elementNode->InsertEndChild(entityConditionElement); + FillEntityConditionNode(document, entityConditionElement, kEntityCondition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillByObjectTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byObjectTypeWriter) + { + // Add Attributes (Parameters) + const auto kType = byObjectTypeWriter->GetType(); + if (byObjectTypeWriter->IsTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), byObjectTypeWriter->GetParameterFromType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), kType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillByTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byTypeWriter) + { + // Add Attributes (Parameters) + const auto kObjectType = byTypeWriter->GetObjectType(); + if (byTypeWriter->IsObjectTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE.c_str(), byTypeWriter->GetParameterFromObjectType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE.c_str(), kObjectType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillByValueConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byValueConditionWriter) + { + // Add Attributes (Parameters) + const auto kParameterCondition = byValueConditionWriter->GetWriterParameterCondition(); + if (kParameterCondition) + { + tinyxml2::XMLNode* parameterConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION.c_str()); + elementNode->InsertEndChild(parameterConditionElement); + FillParameterConditionNode(document, parameterConditionElement, kParameterCondition); + } + const auto kTimeOfDayCondition = byValueConditionWriter->GetWriterTimeOfDayCondition(); + if (kTimeOfDayCondition) + { + tinyxml2::XMLNode* timeOfDayConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION.c_str()); + elementNode->InsertEndChild(timeOfDayConditionElement); + FillTimeOfDayConditionNode(document, timeOfDayConditionElement, kTimeOfDayCondition); + } + const auto kSimulationTimeCondition = byValueConditionWriter->GetWriterSimulationTimeCondition(); + if (kSimulationTimeCondition) + { + tinyxml2::XMLNode* simulationTimeConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION.c_str()); + elementNode->InsertEndChild(simulationTimeConditionElement); + FillSimulationTimeConditionNode(document, simulationTimeConditionElement, kSimulationTimeCondition); + } + const auto kStoryboardElementStateCondition = byValueConditionWriter->GetWriterStoryboardElementStateCondition(); + if (kStoryboardElementStateCondition) + { + tinyxml2::XMLNode* storyboardElementStateConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION.c_str()); + elementNode->InsertEndChild(storyboardElementStateConditionElement); + FillStoryboardElementStateConditionNode(document, storyboardElementStateConditionElement, kStoryboardElementStateCondition); + } + const auto kUserDefinedValueCondition = byValueConditionWriter->GetWriterUserDefinedValueCondition(); + if (kUserDefinedValueCondition) + { + tinyxml2::XMLNode* userDefinedValueConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION.c_str()); + elementNode->InsertEndChild(userDefinedValueConditionElement); + FillUserDefinedValueConditionNode(document, userDefinedValueConditionElement, kUserDefinedValueCondition); + } + const auto kTrafficSignalCondition = byValueConditionWriter->GetWriterTrafficSignalCondition(); + if (kTrafficSignalCondition) + { + tinyxml2::XMLNode* trafficSignalConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION.c_str()); + elementNode->InsertEndChild(trafficSignalConditionElement); + FillTrafficSignalConditionNode(document, trafficSignalConditionElement, kTrafficSignalCondition); + } + const auto kTrafficSignalControllerCondition = byValueConditionWriter->GetWriterTrafficSignalControllerCondition(); + if (kTrafficSignalControllerCondition) + { + tinyxml2::XMLNode* trafficSignalControllerConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION.c_str()); + elementNode->InsertEndChild(trafficSignalControllerConditionElement); + FillTrafficSignalControllerConditionNode(document, trafficSignalControllerConditionElement, kTrafficSignalControllerCondition); + } + const auto kVariableCondition = byValueConditionWriter->GetWriterVariableCondition(); + if (kVariableCondition) + { + tinyxml2::XMLNode* variableConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION.c_str()); + elementNode->InsertEndChild(variableConditionElement); + FillVariableConditionNode(document, variableConditionElement, kVariableCondition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCatalogNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogWriter) + { + // Add Attributes (Parameters) + const auto kName = catalogWriter->GetName(); + if (catalogWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), catalogWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kVehicles = catalogWriter->GetWriterVehicles(); + if (!kVehicles.empty()) + { + for (auto vehiclesWriterItem : kVehicles) + { + tinyxml2::XMLNode* vehiclesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE.c_str()); + elementNode->InsertEndChild(vehiclesElement); + FillVehicleNode(document, vehiclesElement, vehiclesWriterItem); + + } + } + const auto kControllers = catalogWriter->GetWriterControllers(); + if (!kControllers.empty()) + { + for (auto controllersWriterItem : kControllers) + { + tinyxml2::XMLNode* controllersElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER.c_str()); + elementNode->InsertEndChild(controllersElement); + FillControllerNode(document, controllersElement, controllersWriterItem); + + } + } + const auto kPedestrians = catalogWriter->GetWriterPedestrians(); + if (!kPedestrians.empty()) + { + for (auto pedestriansWriterItem : kPedestrians) + { + tinyxml2::XMLNode* pedestriansElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PEDESTRIAN.c_str()); + elementNode->InsertEndChild(pedestriansElement); + FillPedestrianNode(document, pedestriansElement, pedestriansWriterItem); + + } + } + const auto kMiscObjects = catalogWriter->GetWriterMiscObjects(); + if (!kMiscObjects.empty()) + { + for (auto miscObjectsWriterItem : kMiscObjects) + { + tinyxml2::XMLNode* miscObjectsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MISC_OBJECT.c_str()); + elementNode->InsertEndChild(miscObjectsElement); + FillMiscObjectNode(document, miscObjectsElement, miscObjectsWriterItem); + + } + } + const auto kEnvironments = catalogWriter->GetWriterEnvironments(); + if (!kEnvironments.empty()) + { + for (auto environmentsWriterItem : kEnvironments) + { + tinyxml2::XMLNode* environmentsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENVIRONMENT.c_str()); + elementNode->InsertEndChild(environmentsElement); + FillEnvironmentNode(document, environmentsElement, environmentsWriterItem); + + } + } + const auto kManeuvers = catalogWriter->GetWriterManeuvers(); + if (!kManeuvers.empty()) + { + for (auto maneuversWriterItem : kManeuvers) + { + tinyxml2::XMLNode* maneuversElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MANEUVER.c_str()); + elementNode->InsertEndChild(maneuversElement); + FillManeuverNode(document, maneuversElement, maneuversWriterItem); + + } + } + const auto kTrajectories = catalogWriter->GetWriterTrajectories(); + if (!kTrajectories.empty()) + { + for (auto trajectoriesWriterItem : kTrajectories) + { + tinyxml2::XMLNode* trajectoriesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY.c_str()); + elementNode->InsertEndChild(trajectoriesElement); + FillTrajectoryNode(document, trajectoriesElement, trajectoriesWriterItem); + + } + } + const auto kRoutes = catalogWriter->GetWriterRoutes(); + if (!kRoutes.empty()) + { + for (auto routesWriterItem : kRoutes) + { + tinyxml2::XMLNode* routesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE.c_str()); + elementNode->InsertEndChild(routesElement); + FillRouteNode(document, routesElement, routesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCatalogDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogDefinitionWriter) + { + // Add Attributes (Parameters) + const auto kCatalog = catalogDefinitionWriter->GetWriterCatalog(); + if (kCatalog) + { + tinyxml2::XMLNode* catalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG.c_str()); + elementNode->InsertEndChild(catalogElement); + FillCatalogNode(document, catalogElement, kCatalog); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCatalogLocationsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogLocationsWriter) + { + // Add Attributes (Parameters) + const auto kVehicleCatalog = catalogLocationsWriter->GetWriterVehicleCatalog(); + if (kVehicleCatalog) + { + tinyxml2::XMLNode* vehicleCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_CATALOG.c_str()); + elementNode->InsertEndChild(vehicleCatalogElement); + FillVehicleCatalogLocationNode(document, vehicleCatalogElement, kVehicleCatalog); + } + const auto kControllerCatalog = catalogLocationsWriter->GetWriterControllerCatalog(); + if (kControllerCatalog) + { + tinyxml2::XMLNode* controllerCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER_CATALOG.c_str()); + elementNode->InsertEndChild(controllerCatalogElement); + FillControllerCatalogLocationNode(document, controllerCatalogElement, kControllerCatalog); + } + const auto kPedestrianCatalog = catalogLocationsWriter->GetWriterPedestrianCatalog(); + if (kPedestrianCatalog) + { + tinyxml2::XMLNode* pedestrianCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PEDESTRIAN_CATALOG.c_str()); + elementNode->InsertEndChild(pedestrianCatalogElement); + FillPedestrianCatalogLocationNode(document, pedestrianCatalogElement, kPedestrianCatalog); + } + const auto kMiscObjectCatalog = catalogLocationsWriter->GetWriterMiscObjectCatalog(); + if (kMiscObjectCatalog) + { + tinyxml2::XMLNode* miscObjectCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MISC_OBJECT_CATALOG.c_str()); + elementNode->InsertEndChild(miscObjectCatalogElement); + FillMiscObjectCatalogLocationNode(document, miscObjectCatalogElement, kMiscObjectCatalog); + } + const auto kEnvironmentCatalog = catalogLocationsWriter->GetWriterEnvironmentCatalog(); + if (kEnvironmentCatalog) + { + tinyxml2::XMLNode* environmentCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENVIRONMENT_CATALOG.c_str()); + elementNode->InsertEndChild(environmentCatalogElement); + FillEnvironmentCatalogLocationNode(document, environmentCatalogElement, kEnvironmentCatalog); + } + const auto kManeuverCatalog = catalogLocationsWriter->GetWriterManeuverCatalog(); + if (kManeuverCatalog) + { + tinyxml2::XMLNode* maneuverCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MANEUVER_CATALOG.c_str()); + elementNode->InsertEndChild(maneuverCatalogElement); + FillManeuverCatalogLocationNode(document, maneuverCatalogElement, kManeuverCatalog); + } + const auto kTrajectoryCatalog = catalogLocationsWriter->GetWriterTrajectoryCatalog(); + if (kTrajectoryCatalog) + { + tinyxml2::XMLNode* trajectoryCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY_CATALOG.c_str()); + elementNode->InsertEndChild(trajectoryCatalogElement); + FillTrajectoryCatalogLocationNode(document, trajectoryCatalogElement, kTrajectoryCatalog); + } + const auto kRouteCatalog = catalogLocationsWriter->GetWriterRouteCatalog(); + if (kRouteCatalog) + { + tinyxml2::XMLNode* routeCatalogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE_CATALOG.c_str()); + elementNode->InsertEndChild(routeCatalogElement); + FillRouteCatalogLocationNode(document, routeCatalogElement, kRouteCatalog); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCatalogReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogReferenceWriter) + { + // Add Attributes (Parameters) + const auto kCatalogName = catalogReferenceWriter->GetCatalogName(); + if (catalogReferenceWriter->IsCatalogNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME.c_str(), catalogReferenceWriter->GetParameterFromCatalogName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kCatalogName).c_str()); + } + const auto kEntryName = catalogReferenceWriter->GetEntryName(); + if (catalogReferenceWriter->IsEntryNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME.c_str(), catalogReferenceWriter->GetParameterFromEntryName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kEntryName).c_str()); + } + const auto kParameterAssignments = catalogReferenceWriter->GetWriterParameterAssignments(); + if (!kParameterAssignments.empty()) + { + tinyxml2::XMLNode* parameterAssignmentsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT.c_str()); + elementNode->InsertEndChild(parameterAssignmentsWrapperElement); + for (auto parameterAssignmentsWriterItem : kParameterAssignments) + { + tinyxml2::XMLNode* parameterAssignmentsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENTS.c_str()); + parameterAssignmentsWrapperElement->InsertEndChild(parameterAssignmentsElement); + FillParameterAssignmentNode(document, parameterAssignmentsElement, parameterAssignmentsWriterItem); + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCenterNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr centerWriter) + { + // Add Attributes (Parameters) + const auto kX = centerWriter->GetX(); + if (centerWriter->IsXParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__X.c_str(), centerWriter->GetParameterFromX().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__X.c_str(), XmlExportHelper::ToXmlStringFromDouble( kX).c_str()); + } + const auto kY = centerWriter->GetY(); + if (centerWriter->IsYParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Y.c_str(), centerWriter->GetParameterFromY().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Y.c_str(), XmlExportHelper::ToXmlStringFromDouble( kY).c_str()); + } + const auto kZ = centerWriter->GetZ(); + if (centerWriter->IsZParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Z.c_str(), centerWriter->GetParameterFromZ().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Z.c_str(), XmlExportHelper::ToXmlStringFromDouble( kZ).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCentralSwarmObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr centralSwarmObjectWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = centralSwarmObjectWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillClothoidNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidWriter) + { + // Add Attributes (Parameters) + const auto kCurvature = clothoidWriter->GetCurvature(); + if (clothoidWriter->IsCurvatureParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE.c_str(), clothoidWriter->GetParameterFromCurvature().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCurvature).c_str()); + } + const auto kCurvatureDot = clothoidWriter->GetCurvatureDot(); + if (!( kCurvatureDot == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCurvatureDot).c_str()); + } + else if (clothoidWriter->IsCurvatureDotParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT.c_str(), clothoidWriter->GetParameterFromCurvatureDot().c_str()); + } + const auto kCurvaturePrime = clothoidWriter->GetCurvaturePrime(); + if (!( kCurvaturePrime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCurvaturePrime).c_str()); + } + else if (clothoidWriter->IsCurvaturePrimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME.c_str(), clothoidWriter->GetParameterFromCurvaturePrime().c_str()); + } + const auto kLength = clothoidWriter->GetLength(); + if (clothoidWriter->IsLengthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), clothoidWriter->GetParameterFromLength().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLength).c_str()); + } + const auto kStartTime = clothoidWriter->GetStartTime(); + if (!( kStartTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__START_TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kStartTime).c_str()); + } + else if (clothoidWriter->IsStartTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__START_TIME.c_str(), clothoidWriter->GetParameterFromStartTime().c_str()); + } + const auto kStopTime = clothoidWriter->GetStopTime(); + if (!( kStopTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kStopTime).c_str()); + } + else if (clothoidWriter->IsStopTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME.c_str(), clothoidWriter->GetParameterFromStopTime().c_str()); + } + const auto kPosition = clothoidWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillClothoidSplineNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidSplineWriter) + { + // Add Attributes (Parameters) + const auto kTimeEnd = clothoidSplineWriter->GetTimeEnd(); + if (!( kTimeEnd == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_END.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTimeEnd).c_str()); + } + else if (clothoidSplineWriter->IsTimeEndParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_END.c_str(), clothoidSplineWriter->GetParameterFromTimeEnd().c_str()); + } + const auto kSegments = clothoidSplineWriter->GetWriterSegments(); + if (!kSegments.empty()) + { + for (auto segmentsWriterItem : kSegments) + { + tinyxml2::XMLNode* segmentsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE_SEGMENT.c_str()); + elementNode->InsertEndChild(segmentsElement); + FillClothoidSplineSegmentNode(document, segmentsElement, segmentsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillClothoidSplineSegmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidSplineSegmentWriter) + { + // Add Attributes (Parameters) + const auto kCurvatureEnd = clothoidSplineSegmentWriter->GetCurvatureEnd(); + if (clothoidSplineSegmentWriter->IsCurvatureEndParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END.c_str(), clothoidSplineSegmentWriter->GetParameterFromCurvatureEnd().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCurvatureEnd).c_str()); + } + const auto kCurvatureStart = clothoidSplineSegmentWriter->GetCurvatureStart(); + if (clothoidSplineSegmentWriter->IsCurvatureStartParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START.c_str(), clothoidSplineSegmentWriter->GetParameterFromCurvatureStart().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCurvatureStart).c_str()); + } + const auto kHOffset = clothoidSplineSegmentWriter->GetHOffset(); + if (!( kHOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kHOffset).c_str()); + } + else if (clothoidSplineSegmentWriter->IsHOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET.c_str(), clothoidSplineSegmentWriter->GetParameterFromHOffset().c_str()); + } + const auto kLength = clothoidSplineSegmentWriter->GetLength(); + if (clothoidSplineSegmentWriter->IsLengthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), clothoidSplineSegmentWriter->GetParameterFromLength().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLength).c_str()); + } + const auto kTimeStart = clothoidSplineSegmentWriter->GetTimeStart(); + if (!( kTimeStart == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_START.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTimeStart).c_str()); + } + else if (clothoidSplineSegmentWriter->IsTimeStartParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_START.c_str(), clothoidSplineSegmentWriter->GetParameterFromTimeStart().c_str()); + } + const auto kPositionStart = clothoidSplineSegmentWriter->GetWriterPositionStart(); + if (kPositionStart) + { + tinyxml2::XMLNode* positionStartElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION_START.c_str()); + elementNode->InsertEndChild(positionStartElement); + FillPositionNode(document, positionStartElement, kPositionStart); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCollisionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr collisionConditionWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = collisionConditionWriter->GetWriterEntityRef(); + if (kEntityRef) + { + tinyxml2::XMLNode* entityRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefElement); + FillEntityRefNode(document, entityRefElement, kEntityRef); + } + const auto kByType = collisionConditionWriter->GetWriterByType(); + if (kByType) + { + tinyxml2::XMLNode* byTypeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BY_TYPE.c_str()); + elementNode->InsertEndChild(byTypeElement); + FillByObjectTypeNode(document, byTypeElement, kByType); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillColorNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorWriter) + { + // Add Attributes (Parameters) + const auto kColorType = colorWriter->GetColorType(); + if (colorWriter->IsColorTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE.c_str(), colorWriter->GetParameterFromColorType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE.c_str(), kColorType.GetLiteral().c_str()); + } + const auto kColorRgb = colorWriter->GetWriterColorRgb(); + if (kColorRgb) + { + tinyxml2::XMLNode* colorRgbElement = document->NewElement(OSC_CONSTANTS::ELEMENT__COLOR_RGB.c_str()); + elementNode->InsertEndChild(colorRgbElement); + FillColorRgbNode(document, colorRgbElement, kColorRgb); + } + const auto kColorCmyk = colorWriter->GetWriterColorCmyk(); + if (kColorCmyk) + { + tinyxml2::XMLNode* colorCmykElement = document->NewElement(OSC_CONSTANTS::ELEMENT__COLOR_CMYK.c_str()); + elementNode->InsertEndChild(colorCmykElement); + FillColorCmykNode(document, colorCmykElement, kColorCmyk); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillColorCmykNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorCmykWriter) + { + // Add Attributes (Parameters) + const auto kCyan = colorCmykWriter->GetCyan(); + if (colorCmykWriter->IsCyanParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CYAN.c_str(), colorCmykWriter->GetParameterFromCyan().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CYAN.c_str(), XmlExportHelper::ToXmlStringFromDouble( kCyan).c_str()); + } + const auto kKey = colorCmykWriter->GetKey(); + if (colorCmykWriter->IsKeyParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__KEY.c_str(), colorCmykWriter->GetParameterFromKey().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__KEY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kKey).c_str()); + } + const auto kMagenta = colorCmykWriter->GetMagenta(); + if (colorCmykWriter->IsMagentaParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAGENTA.c_str(), colorCmykWriter->GetParameterFromMagenta().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAGENTA.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMagenta).c_str()); + } + const auto kYellow = colorCmykWriter->GetYellow(); + if (colorCmykWriter->IsYellowParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__YELLOW.c_str(), colorCmykWriter->GetParameterFromYellow().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__YELLOW.c_str(), XmlExportHelper::ToXmlStringFromDouble( kYellow).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillColorRgbNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorRgbWriter) + { + // Add Attributes (Parameters) + const auto kBlue = colorRgbWriter->GetBlue(); + if (colorRgbWriter->IsBlueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__BLUE.c_str(), colorRgbWriter->GetParameterFromBlue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__BLUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kBlue).c_str()); + } + const auto kGreen = colorRgbWriter->GetGreen(); + if (colorRgbWriter->IsGreenParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GREEN.c_str(), colorRgbWriter->GetParameterFromGreen().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GREEN.c_str(), XmlExportHelper::ToXmlStringFromDouble( kGreen).c_str()); + } + const auto kRed = colorRgbWriter->GetRed(); + if (colorRgbWriter->IsRedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RED.c_str(), colorRgbWriter->GetParameterFromRed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRed).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillComponentAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr componentAnimationWriter) + { + // Add Attributes (Parameters) + const auto kVehicleComponent = componentAnimationWriter->GetWriterVehicleComponent(); + if (kVehicleComponent) + { + tinyxml2::XMLNode* vehicleComponentElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT.c_str()); + elementNode->InsertEndChild(vehicleComponentElement); + FillVehicleComponentNode(document, vehicleComponentElement, kVehicleComponent); + } + const auto kUserDefinedComponent = componentAnimationWriter->GetWriterUserDefinedComponent(); + if (kUserDefinedComponent) + { + tinyxml2::XMLNode* userDefinedComponentElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT.c_str()); + elementNode->InsertEndChild(userDefinedComponentElement); + FillUserDefinedComponentNode(document, userDefinedComponentElement, kUserDefinedComponent); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr conditionWriter) + { + // Add Attributes (Parameters) + const auto kConditionEdge = conditionWriter->GetConditionEdge(); + if (conditionWriter->IsConditionEdgeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE.c_str(), conditionWriter->GetParameterFromConditionEdge().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE.c_str(), kConditionEdge.GetLiteral().c_str()); + } + const auto kDelay = conditionWriter->GetDelay(); + if (conditionWriter->IsDelayParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DELAY.c_str(), conditionWriter->GetParameterFromDelay().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DELAY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDelay).c_str()); + } + const auto kName = conditionWriter->GetName(); + if (conditionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), conditionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kByEntityCondition = conditionWriter->GetWriterByEntityCondition(); + if (kByEntityCondition) + { + tinyxml2::XMLNode* byEntityConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION.c_str()); + elementNode->InsertEndChild(byEntityConditionElement); + FillByEntityConditionNode(document, byEntityConditionElement, kByEntityCondition); + } + const auto kByValueCondition = conditionWriter->GetWriterByValueCondition(); + if (kByValueCondition) + { + tinyxml2::XMLNode* byValueConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION.c_str()); + elementNode->InsertEndChild(byValueConditionElement); + FillByValueConditionNode(document, byValueConditionElement, kByValueCondition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillConditionGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr conditionGroupWriter) + { + // Add Attributes (Parameters) + const auto kConditions = conditionGroupWriter->GetWriterConditions(); + if (!kConditions.empty()) + { + for (auto conditionsWriterItem : kConditions) + { + tinyxml2::XMLNode* conditionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONDITION.c_str()); + elementNode->InsertEndChild(conditionsElement); + FillConditionNode(document, conditionsElement, conditionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillConnectTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr connectTrailerActionWriter) + { + // Add Attributes (Parameters) + const auto kTrailerRef = connectTrailerActionWriter->GetTrailerRef(); + if (kTrailerRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kTrailerRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControlPointNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controlPointWriter) + { + // Add Attributes (Parameters) + const auto kTime = controlPointWriter->GetTime(); + if (!( kTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTime).c_str()); + } + else if (controlPointWriter->IsTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), controlPointWriter->GetParameterFromTime().c_str()); + } + const auto kWeight = controlPointWriter->GetWeight(); + if (!( kWeight == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + else if (controlPointWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), controlPointWriter->GetParameterFromWeight().c_str()); + } + const auto kPosition = controlPointWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerWriter) + { + // Add Attributes (Parameters) + const auto kControllerType = controllerWriter->GetControllerType(); + if (!( kControllerType == ControllerType::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE.c_str(), kControllerType.GetLiteral().c_str()); + } + else if (controllerWriter->IsControllerTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE.c_str(), controllerWriter->GetParameterFromControllerType().c_str()); + } + const auto kName = controllerWriter->GetName(); + if (controllerWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), controllerWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = controllerWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kProperties = controllerWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerActionWriter) + { + // Add Attributes (Parameters) + const auto kAssignControllerAction = controllerActionWriter->GetWriterAssignControllerAction(); + if (kAssignControllerAction) + { + tinyxml2::XMLNode* assignControllerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ASSIGN_CONTROLLER_ACTION.c_str()); + elementNode->InsertEndChild(assignControllerActionElement); + FillAssignControllerActionNode(document, assignControllerActionElement, kAssignControllerAction); + } + const auto kOverrideControllerValueAction = controllerActionWriter->GetWriterOverrideControllerValueAction(); + if (kOverrideControllerValueAction) + { + tinyxml2::XMLNode* overrideControllerValueActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION.c_str()); + elementNode->InsertEndChild(overrideControllerValueActionElement); + FillOverrideControllerValueActionNode(document, overrideControllerValueActionElement, kOverrideControllerValueAction); + } + const auto kActivateControllerAction = controllerActionWriter->GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + tinyxml2::XMLNode* activateControllerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION.c_str()); + elementNode->InsertEndChild(activateControllerActionElement); + FillActivateControllerActionNode(document, activateControllerActionElement, kActivateControllerAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControllerCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = controllerCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControllerDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerDistributionWriter) + { + // Add Attributes (Parameters) + const auto kControllerDistributionEntries = controllerDistributionWriter->GetWriterControllerDistributionEntries(); + if (!kControllerDistributionEntries.empty()) + { + for (auto controllerDistributionEntriesWriterItem : kControllerDistributionEntries) + { + tinyxml2::XMLNode* controllerDistributionEntriesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY.c_str()); + elementNode->InsertEndChild(controllerDistributionEntriesElement); + FillControllerDistributionEntryNode(document, controllerDistributionEntriesElement, controllerDistributionEntriesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillControllerDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerDistributionEntryWriter) + { + // Add Attributes (Parameters) + const auto kWeight = controllerDistributionEntryWriter->GetWeight(); + if (controllerDistributionEntryWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), controllerDistributionEntryWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + const auto kController = controllerDistributionEntryWriter->GetWriterController(); + if (kController) + { + tinyxml2::XMLNode* controllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER.c_str()); + elementNode->InsertEndChild(controllerElement); + FillControllerNode(document, controllerElement, kController); + } + const auto kCatalogReference = controllerDistributionEntryWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCustomCommandActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr customCommandActionWriter) + { + // Add Attributes (Parameters) + const auto kContent = customCommandActionWriter->GetContent(); + if (customCommandActionWriter->IsContentParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), customCommandActionWriter->GetParameterFromContent().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), XmlExportHelper::ToXmlStringFromString( kContent).c_str()); + } + const auto kType = customCommandActionWriter->GetType(); + if (customCommandActionWriter->IsTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), customCommandActionWriter->GetParameterFromType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), XmlExportHelper::ToXmlStringFromString( kType).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillCustomContentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr customContentWriter) + { + // Add Attributes (Parameters) + const auto kContent = customContentWriter->GetContent(); + if (customContentWriter->IsContentParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), customContentWriter->GetParameterFromContent().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), XmlExportHelper::ToXmlStringFromString( kContent).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeleteEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deleteEntityActionWriter) + { + // Add Attributes (Parameters) + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicWriter) + { + // Add Attributes (Parameters) + const auto kDeterministicParameterDistributions = deterministicWriter->GetWriterDeterministicParameterDistributions(); + if (!kDeterministicParameterDistributions.empty()) + { + for (auto deterministicParameterDistributionsWriterItem : kDeterministicParameterDistributions) + { + tinyxml2::XMLNode* deterministicParameterDistributionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_PARAMETER_DISTRIBUTIONS.c_str()); + elementNode->InsertEndChild(deterministicParameterDistributionsElement); + FillDeterministicParameterDistributionNode(document, deterministicParameterDistributionsElement, deterministicParameterDistributionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicMultiParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicMultiParameterDistributionWriter) + { + // Add Attributes (Parameters) + const auto kDeterministicMultiParameterDistributionType = deterministicMultiParameterDistributionWriter->GetWriterDeterministicMultiParameterDistributionType(); + if (kDeterministicMultiParameterDistributionType) + { + FillDeterministicMultiParameterDistributionTypeNode(document, elementNode, kDeterministicMultiParameterDistributionType); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicMultiParameterDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicMultiParameterDistributionTypeWriter) + { + // Add Attributes (Parameters) + const auto kValueSetDistribution = deterministicMultiParameterDistributionTypeWriter->GetWriterValueSetDistribution(); + if (kValueSetDistribution) + { + tinyxml2::XMLNode* valueSetDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(valueSetDistributionElement); + FillValueSetDistributionNode(document, valueSetDistributionElement, kValueSetDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicParameterDistributionWriter) + { + // Add Attributes (Parameters) + const auto kDeterministicMultiParameterDistribution = deterministicParameterDistributionWriter->GetWriterDeterministicMultiParameterDistribution(); + if (kDeterministicMultiParameterDistribution) + { + tinyxml2::XMLNode* deterministicMultiParameterDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(deterministicMultiParameterDistributionElement); + FillDeterministicMultiParameterDistributionNode(document, deterministicMultiParameterDistributionElement, kDeterministicMultiParameterDistribution); + } + const auto kDeterministicSingleParameterDistribution = deterministicParameterDistributionWriter->GetWriterDeterministicSingleParameterDistribution(); + if (kDeterministicSingleParameterDistribution) + { + tinyxml2::XMLNode* deterministicSingleParameterDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(deterministicSingleParameterDistributionElement); + FillDeterministicSingleParameterDistributionNode(document, deterministicSingleParameterDistributionElement, kDeterministicSingleParameterDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicSingleParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicSingleParameterDistributionWriter) + { + // Add Attributes (Parameters) + const auto kParameterName = deterministicSingleParameterDistributionWriter->GetParameterName(); + if (deterministicSingleParameterDistributionWriter->IsParameterNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME.c_str(), deterministicSingleParameterDistributionWriter->GetParameterFromParameterName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kParameterName).c_str()); + } + const auto kDeterministicSingleParameterDistributionType = deterministicSingleParameterDistributionWriter->GetWriterDeterministicSingleParameterDistributionType(); + if (kDeterministicSingleParameterDistributionType) + { + FillDeterministicSingleParameterDistributionTypeNode(document, elementNode, kDeterministicSingleParameterDistributionType); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDeterministicSingleParameterDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicSingleParameterDistributionTypeWriter) + { + // Add Attributes (Parameters) + const auto kDistributionSet = deterministicSingleParameterDistributionTypeWriter->GetWriterDistributionSet(); + if (kDistributionSet) + { + tinyxml2::XMLNode* distributionSetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET.c_str()); + elementNode->InsertEndChild(distributionSetElement); + FillDistributionSetNode(document, distributionSetElement, kDistributionSet); + } + const auto kDistributionRange = deterministicSingleParameterDistributionTypeWriter->GetWriterDistributionRange(); + if (kDistributionRange) + { + tinyxml2::XMLNode* distributionRangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE.c_str()); + elementNode->InsertEndChild(distributionRangeElement); + FillDistributionRangeNode(document, distributionRangeElement, kDistributionRange); + } + const auto kUserDefinedDistribution = deterministicSingleParameterDistributionTypeWriter->GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + tinyxml2::XMLNode* userDefinedDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(userDefinedDistributionElement); + FillUserDefinedDistributionNode(document, userDefinedDistributionElement, kUserDefinedDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDimensionsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr dimensionsWriter) + { + // Add Attributes (Parameters) + const auto kHeight = dimensionsWriter->GetHeight(); + if (dimensionsWriter->IsHeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__HEIGHT.c_str(), dimensionsWriter->GetParameterFromHeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__HEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kHeight).c_str()); + } + const auto kLength = dimensionsWriter->GetLength(); + if (dimensionsWriter->IsLengthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), dimensionsWriter->GetParameterFromLength().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLength).c_str()); + } + const auto kWidth = dimensionsWriter->GetWidth(); + if (dimensionsWriter->IsWidthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WIDTH.c_str(), dimensionsWriter->GetParameterFromWidth().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WIDTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWidth).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDirectionOfTravelDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr directionOfTravelDistributionWriter) + { + // Add Attributes (Parameters) + const auto kOpposite = directionOfTravelDistributionWriter->GetOpposite(); + if (directionOfTravelDistributionWriter->IsOppositeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE.c_str(), directionOfTravelDistributionWriter->GetParameterFromOpposite().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kOpposite).c_str()); + } + const auto kSame = directionOfTravelDistributionWriter->GetSame(); + if (directionOfTravelDistributionWriter->IsSameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SAME.c_str(), directionOfTravelDistributionWriter->GetParameterFromSame().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SAME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSame).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDirectoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr directoryWriter) + { + // Add Attributes (Parameters) + const auto kPath = directoryWriter->GetPath(); + if (directoryWriter->IsPathParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH.c_str(), directoryWriter->GetParameterFromPath().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH.c_str(), XmlExportHelper::ToXmlStringFromString( kPath).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDisconnectTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr disconnectTrailerActionWriter) + { + // Add Attributes (Parameters) + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distanceConditionWriter) + { + // Add Attributes (Parameters) + const auto kAlongRoute = distanceConditionWriter->GetAlongRoute(); + if (!( kAlongRoute == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kAlongRoute).c_str()); + } + else if (distanceConditionWriter->IsAlongRouteParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), distanceConditionWriter->GetParameterFromAlongRoute().c_str()); + } + const auto kCoordinateSystem = distanceConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (distanceConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), distanceConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kFreespace = distanceConditionWriter->GetFreespace(); + if (distanceConditionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), distanceConditionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kRelativeDistanceType = distanceConditionWriter->GetRelativeDistanceType(); + if (!( kRelativeDistanceType == RelativeDistanceType::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), kRelativeDistanceType.GetLiteral().c_str()); + } + else if (distanceConditionWriter->IsRelativeDistanceTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), distanceConditionWriter->GetParameterFromRelativeDistanceType().c_str()); + } + const auto kRoutingAlgorithm = distanceConditionWriter->GetRoutingAlgorithm(); + if (!( kRoutingAlgorithm == RoutingAlgorithm::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), kRoutingAlgorithm.GetLiteral().c_str()); + } + else if (distanceConditionWriter->IsRoutingAlgorithmParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), distanceConditionWriter->GetParameterFromRoutingAlgorithm().c_str()); + } + const auto kRule = distanceConditionWriter->GetRule(); + if (distanceConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), distanceConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = distanceConditionWriter->GetValue(); + if (distanceConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), distanceConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + const auto kPosition = distanceConditionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDistributionDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionDefinitionWriter) + { + // Add Attributes (Parameters) + const auto kDeterministic = distributionDefinitionWriter->GetWriterDeterministic(); + if (kDeterministic) + { + tinyxml2::XMLNode* deterministicElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DETERMINISTIC.c_str()); + elementNode->InsertEndChild(deterministicElement); + FillDeterministicNode(document, deterministicElement, kDeterministic); + } + const auto kStochastic = distributionDefinitionWriter->GetWriterStochastic(); + if (kStochastic) + { + tinyxml2::XMLNode* stochasticElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STOCHASTIC.c_str()); + elementNode->InsertEndChild(stochasticElement); + FillStochasticNode(document, stochasticElement, kStochastic); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDistributionRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionRangeWriter) + { + // Add Attributes (Parameters) + const auto kStepWidth = distributionRangeWriter->GetStepWidth(); + if (distributionRangeWriter->IsStepWidthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH.c_str(), distributionRangeWriter->GetParameterFromStepWidth().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kStepWidth).c_str()); + } + const auto kRange = distributionRangeWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDistributionSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionSetWriter) + { + // Add Attributes (Parameters) + const auto kElements = distributionSetWriter->GetWriterElements(); + if (!kElements.empty()) + { + for (auto elementsWriterItem : kElements) + { + tinyxml2::XMLNode* elementsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ELEMENT.c_str()); + elementNode->InsertEndChild(elementsElement); + FillDistributionSetElementNode(document, elementsElement, elementsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDistributionSetElementNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionSetElementWriter) + { + // Add Attributes (Parameters) + const auto kValue = distributionSetElementWriter->GetValue(); + if (distributionSetElementWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), distributionSetElementWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDomeImageNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr domeImageWriter) + { + // Add Attributes (Parameters) + const auto kAzimuthOffset = domeImageWriter->GetAzimuthOffset(); + if (!( kAzimuthOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAzimuthOffset).c_str()); + } + else if (domeImageWriter->IsAzimuthOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET.c_str(), domeImageWriter->GetParameterFromAzimuthOffset().c_str()); + } + const auto kDomeFile = domeImageWriter->GetWriterDomeFile(); + if (kDomeFile) + { + tinyxml2::XMLNode* domeFileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DOME_FILE.c_str()); + elementNode->InsertEndChild(domeFileElement); + FillFileNode(document, domeFileElement, kDomeFile); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillDynamicConstraintsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr dynamicConstraintsWriter) + { + // Add Attributes (Parameters) + const auto kMaxAcceleration = dynamicConstraintsWriter->GetMaxAcceleration(); + if (!( kMaxAcceleration == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxAcceleration).c_str()); + } + else if (dynamicConstraintsWriter->IsMaxAccelerationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION.c_str(), dynamicConstraintsWriter->GetParameterFromMaxAcceleration().c_str()); + } + const auto kMaxAccelerationRate = dynamicConstraintsWriter->GetMaxAccelerationRate(); + if (!( kMaxAccelerationRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxAccelerationRate).c_str()); + } + else if (dynamicConstraintsWriter->IsMaxAccelerationRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE.c_str(), dynamicConstraintsWriter->GetParameterFromMaxAccelerationRate().c_str()); + } + const auto kMaxDeceleration = dynamicConstraintsWriter->GetMaxDeceleration(); + if (!( kMaxDeceleration == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxDeceleration).c_str()); + } + else if (dynamicConstraintsWriter->IsMaxDecelerationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION.c_str(), dynamicConstraintsWriter->GetParameterFromMaxDeceleration().c_str()); + } + const auto kMaxDecelerationRate = dynamicConstraintsWriter->GetMaxDecelerationRate(); + if (!( kMaxDecelerationRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxDecelerationRate).c_str()); + } + else if (dynamicConstraintsWriter->IsMaxDecelerationRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE.c_str(), dynamicConstraintsWriter->GetParameterFromMaxDecelerationRate().c_str()); + } + const auto kMaxSpeed = dynamicConstraintsWriter->GetMaxSpeed(); + if (!( kMaxSpeed == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxSpeed).c_str()); + } + else if (dynamicConstraintsWriter->IsMaxSpeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED.c_str(), dynamicConstraintsWriter->GetParameterFromMaxSpeed().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEndOfRoadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr endOfRoadConditionWriter) + { + // Add Attributes (Parameters) + const auto kDuration = endOfRoadConditionWriter->GetDuration(); + if (endOfRoadConditionWriter->IsDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), endOfRoadConditionWriter->GetParameterFromDuration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDuration).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entitiesWriter) + { + // Add Attributes (Parameters) + const auto kScenarioObjects = entitiesWriter->GetWriterScenarioObjects(); + if (!kScenarioObjects.empty()) + { + for (auto scenarioObjectsWriterItem : kScenarioObjects) + { + tinyxml2::XMLNode* scenarioObjectsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT.c_str()); + elementNode->InsertEndChild(scenarioObjectsElement); + FillScenarioObjectNode(document, scenarioObjectsElement, scenarioObjectsWriterItem); + + } + } + const auto kEntitySelections = entitiesWriter->GetWriterEntitySelections(); + if (!kEntitySelections.empty()) + { + for (auto entitySelectionsWriterItem : kEntitySelections) + { + tinyxml2::XMLNode* entitySelectionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_SELECTION.c_str()); + elementNode->InsertEndChild(entitySelectionsElement); + FillEntitySelectionNode(document, entitySelectionsElement, entitySelectionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityActionWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = entityActionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kAddEntityAction = entityActionWriter->GetWriterAddEntityAction(); + if (kAddEntityAction) + { + tinyxml2::XMLNode* addEntityActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION.c_str()); + elementNode->InsertEndChild(addEntityActionElement); + FillAddEntityActionNode(document, addEntityActionElement, kAddEntityAction); + } + const auto kDeleteEntityAction = entityActionWriter->GetWriterDeleteEntityAction(); + if (kDeleteEntityAction) + { + tinyxml2::XMLNode* deleteEntityActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION.c_str()); + elementNode->InsertEndChild(deleteEntityActionElement); + FillDeleteEntityActionNode(document, deleteEntityActionElement, kDeleteEntityAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityConditionWriter) + { + // Add Attributes (Parameters) + const auto kEndOfRoadCondition = entityConditionWriter->GetWriterEndOfRoadCondition(); + if (kEndOfRoadCondition) + { + tinyxml2::XMLNode* endOfRoadConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION.c_str()); + elementNode->InsertEndChild(endOfRoadConditionElement); + FillEndOfRoadConditionNode(document, endOfRoadConditionElement, kEndOfRoadCondition); + } + const auto kCollisionCondition = entityConditionWriter->GetWriterCollisionCondition(); + if (kCollisionCondition) + { + tinyxml2::XMLNode* collisionConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION.c_str()); + elementNode->InsertEndChild(collisionConditionElement); + FillCollisionConditionNode(document, collisionConditionElement, kCollisionCondition); + } + const auto kOffroadCondition = entityConditionWriter->GetWriterOffroadCondition(); + if (kOffroadCondition) + { + tinyxml2::XMLNode* offroadConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION.c_str()); + elementNode->InsertEndChild(offroadConditionElement); + FillOffroadConditionNode(document, offroadConditionElement, kOffroadCondition); + } + const auto kTimeHeadwayCondition = entityConditionWriter->GetWriterTimeHeadwayCondition(); + if (kTimeHeadwayCondition) + { + tinyxml2::XMLNode* timeHeadwayConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION.c_str()); + elementNode->InsertEndChild(timeHeadwayConditionElement); + FillTimeHeadwayConditionNode(document, timeHeadwayConditionElement, kTimeHeadwayCondition); + } + const auto kTimeToCollisionCondition = entityConditionWriter->GetWriterTimeToCollisionCondition(); + if (kTimeToCollisionCondition) + { + tinyxml2::XMLNode* timeToCollisionConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION.c_str()); + elementNode->InsertEndChild(timeToCollisionConditionElement); + FillTimeToCollisionConditionNode(document, timeToCollisionConditionElement, kTimeToCollisionCondition); + } + const auto kAccelerationCondition = entityConditionWriter->GetWriterAccelerationCondition(); + if (kAccelerationCondition) + { + tinyxml2::XMLNode* accelerationConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION.c_str()); + elementNode->InsertEndChild(accelerationConditionElement); + FillAccelerationConditionNode(document, accelerationConditionElement, kAccelerationCondition); + } + const auto kStandStillCondition = entityConditionWriter->GetWriterStandStillCondition(); + if (kStandStillCondition) + { + tinyxml2::XMLNode* standStillConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION.c_str()); + elementNode->InsertEndChild(standStillConditionElement); + FillStandStillConditionNode(document, standStillConditionElement, kStandStillCondition); + } + const auto kSpeedCondition = entityConditionWriter->GetWriterSpeedCondition(); + if (kSpeedCondition) + { + tinyxml2::XMLNode* speedConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_CONDITION.c_str()); + elementNode->InsertEndChild(speedConditionElement); + FillSpeedConditionNode(document, speedConditionElement, kSpeedCondition); + } + const auto kRelativeSpeedCondition = entityConditionWriter->GetWriterRelativeSpeedCondition(); + if (kRelativeSpeedCondition) + { + tinyxml2::XMLNode* relativeSpeedConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION.c_str()); + elementNode->InsertEndChild(relativeSpeedConditionElement); + FillRelativeSpeedConditionNode(document, relativeSpeedConditionElement, kRelativeSpeedCondition); + } + const auto kTraveledDistanceCondition = entityConditionWriter->GetWriterTraveledDistanceCondition(); + if (kTraveledDistanceCondition) + { + tinyxml2::XMLNode* traveledDistanceConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION.c_str()); + elementNode->InsertEndChild(traveledDistanceConditionElement); + FillTraveledDistanceConditionNode(document, traveledDistanceConditionElement, kTraveledDistanceCondition); + } + const auto kReachPositionCondition = entityConditionWriter->GetWriterReachPositionCondition(); + if (kReachPositionCondition) + { + tinyxml2::XMLNode* reachPositionConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION.c_str()); + elementNode->InsertEndChild(reachPositionConditionElement); + FillReachPositionConditionNode(document, reachPositionConditionElement, kReachPositionCondition); + } + const auto kDistanceCondition = entityConditionWriter->GetWriterDistanceCondition(); + if (kDistanceCondition) + { + tinyxml2::XMLNode* distanceConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION.c_str()); + elementNode->InsertEndChild(distanceConditionElement); + FillDistanceConditionNode(document, distanceConditionElement, kDistanceCondition); + } + const auto kRelativeDistanceCondition = entityConditionWriter->GetWriterRelativeDistanceCondition(); + if (kRelativeDistanceCondition) + { + tinyxml2::XMLNode* relativeDistanceConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION.c_str()); + elementNode->InsertEndChild(relativeDistanceConditionElement); + FillRelativeDistanceConditionNode(document, relativeDistanceConditionElement, kRelativeDistanceCondition); + } + const auto kRelativeClearanceCondition = entityConditionWriter->GetWriterRelativeClearanceCondition(); + if (kRelativeClearanceCondition) + { + tinyxml2::XMLNode* relativeClearanceConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION.c_str()); + elementNode->InsertEndChild(relativeClearanceConditionElement); + FillRelativeClearanceConditionNode(document, relativeClearanceConditionElement, kRelativeClearanceCondition); + } + const auto kAngleCondition = entityConditionWriter->GetWriterAngleCondition(); + if (kAngleCondition) + { + tinyxml2::XMLNode* angleConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION.c_str()); + elementNode->InsertEndChild(angleConditionElement); + FillAngleConditionNode(document, angleConditionElement, kAngleCondition); + } + const auto kRelativeAngleCondition = entityConditionWriter->GetWriterRelativeAngleCondition(); + if (kRelativeAngleCondition) + { + tinyxml2::XMLNode* relativeAngleConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION.c_str()); + elementNode->InsertEndChild(relativeAngleConditionElement); + FillRelativeAngleConditionNode(document, relativeAngleConditionElement, kRelativeAngleCondition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityDistributionWriter) + { + // Add Attributes (Parameters) + const auto kEntityDistributionEntry = entityDistributionWriter->GetWriterEntityDistributionEntry(); + if (!kEntityDistributionEntry.empty()) + { + for (auto entityDistributionEntryWriterItem : kEntityDistributionEntry) + { + tinyxml2::XMLNode* entityDistributionEntryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION_ENTRY.c_str()); + elementNode->InsertEndChild(entityDistributionEntryElement); + FillEntityDistributionEntryNode(document, entityDistributionEntryElement, entityDistributionEntryWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityDistributionEntryWriter) + { + // Add Attributes (Parameters) + const auto kWeight = entityDistributionEntryWriter->GetWeight(); + if (entityDistributionEntryWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), entityDistributionEntryWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + const auto kScenarioObjectTemplate = entityDistributionEntryWriter->GetWriterScenarioObjectTemplate(); + if (kScenarioObjectTemplate) + { + tinyxml2::XMLNode* scenarioObjectTemplateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT_TEMPLATE.c_str()); + elementNode->InsertEndChild(scenarioObjectTemplateElement); + FillScenarioObjectTemplateNode(document, scenarioObjectTemplateElement, kScenarioObjectTemplate); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityObjectWriter) + { + // Add Attributes (Parameters) + const auto kCatalogReference = entityObjectWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + const auto kVehicle = entityObjectWriter->GetWriterVehicle(); + if (kVehicle) + { + tinyxml2::XMLNode* vehicleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE.c_str()); + elementNode->InsertEndChild(vehicleElement); + FillVehicleNode(document, vehicleElement, kVehicle); + } + const auto kPedestrian = entityObjectWriter->GetWriterPedestrian(); + if (kPedestrian) + { + tinyxml2::XMLNode* pedestrianElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PEDESTRIAN.c_str()); + elementNode->InsertEndChild(pedestrianElement); + FillPedestrianNode(document, pedestrianElement, kPedestrian); + } + const auto kMiscObject = entityObjectWriter->GetWriterMiscObject(); + if (kMiscObject) + { + tinyxml2::XMLNode* miscObjectElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MISC_OBJECT.c_str()); + elementNode->InsertEndChild(miscObjectElement); + FillMiscObjectNode(document, miscObjectElement, kMiscObject); + } + const auto kExternalObjectReference = entityObjectWriter->GetWriterExternalObjectReference(); + if (kExternalObjectReference) + { + tinyxml2::XMLNode* externalObjectReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE.c_str()); + elementNode->InsertEndChild(externalObjectReferenceElement); + FillExternalObjectReferenceNode(document, externalObjectReferenceElement, kExternalObjectReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntityRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityRefWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = entityRefWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEntitySelectionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entitySelectionWriter) + { + // Add Attributes (Parameters) + const auto kName = entitySelectionWriter->GetName(); + if (entitySelectionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), entitySelectionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kMembers = entitySelectionWriter->GetWriterMembers(); + if (kMembers) + { + tinyxml2::XMLNode* membersElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MEMBERS.c_str()); + elementNode->InsertEndChild(membersElement); + FillSelectedEntitiesNode(document, membersElement, kMembers); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEnvironmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentWriter) + { + // Add Attributes (Parameters) + const auto kName = environmentWriter->GetName(); + if (environmentWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), environmentWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = environmentWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kTimeOfDay = environmentWriter->GetWriterTimeOfDay(); + if (kTimeOfDay) + { + tinyxml2::XMLNode* timeOfDayElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_OF_DAY.c_str()); + elementNode->InsertEndChild(timeOfDayElement); + FillTimeOfDayNode(document, timeOfDayElement, kTimeOfDay); + } + const auto kWeather = environmentWriter->GetWriterWeather(); + if (kWeather) + { + tinyxml2::XMLNode* weatherElement = document->NewElement(OSC_CONSTANTS::ELEMENT__WEATHER.c_str()); + elementNode->InsertEndChild(weatherElement); + FillWeatherNode(document, weatherElement, kWeather); + } + const auto kRoadCondition = environmentWriter->GetWriterRoadCondition(); + if (kRoadCondition) + { + tinyxml2::XMLNode* roadConditionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROAD_CONDITION.c_str()); + elementNode->InsertEndChild(roadConditionElement); + FillRoadConditionNode(document, roadConditionElement, kRoadCondition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEnvironmentActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentActionWriter) + { + // Add Attributes (Parameters) + const auto kEnvironment = environmentActionWriter->GetWriterEnvironment(); + if (kEnvironment) + { + tinyxml2::XMLNode* environmentElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENVIRONMENT.c_str()); + elementNode->InsertEndChild(environmentElement); + FillEnvironmentNode(document, environmentElement, kEnvironment); + } + const auto kCatalogReference = environmentActionWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEnvironmentCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = environmentCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillEventNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr eventWriter) + { + // Add Attributes (Parameters) + const auto kMaximumExecutionCount = eventWriter->GetMaximumExecutionCount(); + if (!( kMaximumExecutionCount == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kMaximumExecutionCount).c_str()); + } + else if (eventWriter->IsMaximumExecutionCountParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT.c_str(), eventWriter->GetParameterFromMaximumExecutionCount().c_str()); + } + const auto kName = eventWriter->GetName(); + if (eventWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), eventWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kPriority = eventWriter->GetPriority(); + if (eventWriter->IsPriorityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRIORITY.c_str(), eventWriter->GetParameterFromPriority().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRIORITY.c_str(), kPriority.GetLiteral().c_str()); + } + const auto kActions = eventWriter->GetWriterActions(); + if (!kActions.empty()) + { + for (auto actionsWriterItem : kActions) + { + tinyxml2::XMLNode* actionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACTION.c_str()); + elementNode->InsertEndChild(actionsElement); + FillActionNode(document, actionsElement, actionsWriterItem); + + } + } + const auto kStartTrigger = eventWriter->GetWriterStartTrigger(); + if (kStartTrigger) + { + tinyxml2::XMLNode* startTriggerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__START_TRIGGER.c_str()); + elementNode->InsertEndChild(startTriggerElement); + FillTriggerNode(document, startTriggerElement, kStartTrigger); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillExternalObjectReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr externalObjectReferenceWriter) + { + // Add Attributes (Parameters) + const auto kName = externalObjectReferenceWriter->GetName(); + if (externalObjectReferenceWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), externalObjectReferenceWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillFileNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fileWriter) + { + // Add Attributes (Parameters) + const auto kFilepath = fileWriter->GetFilepath(); + if (fileWriter->IsFilepathParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FILEPATH.c_str(), fileWriter->GetParameterFromFilepath().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FILEPATH.c_str(), XmlExportHelper::ToXmlStringFromString( kFilepath).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillFileHeaderNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fileHeaderWriter) + { + // Add Attributes (Parameters) + const auto kAuthor = fileHeaderWriter->GetAuthor(); + if (fileHeaderWriter->IsAuthorParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AUTHOR.c_str(), fileHeaderWriter->GetParameterFromAuthor().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AUTHOR.c_str(), XmlExportHelper::ToXmlStringFromString( kAuthor).c_str()); + } + const auto kDate = fileHeaderWriter->GetDate(); + if (fileHeaderWriter->IsDateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE.c_str(), fileHeaderWriter->GetParameterFromDate().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE.c_str(), XmlExportHelper::ToXmlStringFromDateTime( kDate).c_str()); + } + const auto kDescription = fileHeaderWriter->GetDescription(); + if (fileHeaderWriter->IsDescriptionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION.c_str(), fileHeaderWriter->GetParameterFromDescription().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION.c_str(), XmlExportHelper::ToXmlStringFromString( kDescription).c_str()); + } + const auto kRevMajor = fileHeaderWriter->GetRevMajor(); + if (fileHeaderWriter->IsRevMajorParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR.c_str(), fileHeaderWriter->GetParameterFromRevMajor().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR.c_str(), XmlExportHelper::ToXmlStringFromUnsignedShort( kRevMajor).c_str()); + } + const auto kRevMinor = fileHeaderWriter->GetRevMinor(); + if (fileHeaderWriter->IsRevMinorParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR.c_str(), fileHeaderWriter->GetParameterFromRevMinor().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR.c_str(), XmlExportHelper::ToXmlStringFromUnsignedShort( kRevMinor).c_str()); + } + const auto kLicense = fileHeaderWriter->GetWriterLicense(); + if (kLicense) + { + tinyxml2::XMLNode* licenseElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LICENSE.c_str()); + elementNode->InsertEndChild(licenseElement); + FillLicenseNode(document, licenseElement, kLicense); + } + const auto kProperties = fileHeaderWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillFinalSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr finalSpeedWriter) + { + // Add Attributes (Parameters) + const auto kAbsoluteSpeed = finalSpeedWriter->GetWriterAbsoluteSpeed(); + if (kAbsoluteSpeed) + { + tinyxml2::XMLNode* absoluteSpeedElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED.c_str()); + elementNode->InsertEndChild(absoluteSpeedElement); + FillAbsoluteSpeedNode(document, absoluteSpeedElement, kAbsoluteSpeed); + } + const auto kRelativeSpeedToMaster = finalSpeedWriter->GetWriterRelativeSpeedToMaster(); + if (kRelativeSpeedToMaster) + { + tinyxml2::XMLNode* relativeSpeedToMasterElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER.c_str()); + elementNode->InsertEndChild(relativeSpeedToMasterElement); + FillRelativeSpeedToMasterNode(document, relativeSpeedToMasterElement, kRelativeSpeedToMaster); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillFogNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fogWriter) + { + // Add Attributes (Parameters) + const auto kVisualRange = fogWriter->GetVisualRange(); + if (fogWriter->IsVisualRangeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE.c_str(), fogWriter->GetParameterFromVisualRange().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kVisualRange).c_str()); + } + const auto kBoundingBox = fogWriter->GetWriterBoundingBox(); + if (kBoundingBox) + { + tinyxml2::XMLNode* boundingBoxElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX.c_str()); + elementNode->InsertEndChild(boundingBoxElement); + FillBoundingBoxNode(document, boundingBoxElement, kBoundingBox); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillFollowTrajectoryActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr followTrajectoryActionWriter) + { + // Add Attributes (Parameters) + const auto kInitialDistanceOffset = followTrajectoryActionWriter->GetInitialDistanceOffset(); + if (!( kInitialDistanceOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kInitialDistanceOffset).c_str()); + } + else if (followTrajectoryActionWriter->IsInitialDistanceOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET.c_str(), followTrajectoryActionWriter->GetParameterFromInitialDistanceOffset().c_str()); + } + const auto kTrajectory = followTrajectoryActionWriter->GetWriterTrajectory(); + if (kTrajectory) + { + tinyxml2::XMLNode* trajectoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY.c_str()); + elementNode->InsertEndChild(trajectoryElement); + FillTrajectoryNode(document, trajectoryElement, kTrajectory); + } + const auto kCatalogReference = followTrajectoryActionWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + const auto kTimeReference = followTrajectoryActionWriter->GetWriterTimeReference(); + if (kTimeReference) + { + tinyxml2::XMLNode* timeReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_REFERENCE.c_str()); + elementNode->InsertEndChild(timeReferenceElement); + FillTimeReferenceNode(document, timeReferenceElement, kTimeReference); + } + const auto kTrajectoryFollowingMode = followTrajectoryActionWriter->GetWriterTrajectoryFollowingMode(); + if (kTrajectoryFollowingMode) + { + tinyxml2::XMLNode* trajectoryFollowingModeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY_FOLLOWING_MODE.c_str()); + elementNode->InsertEndChild(trajectoryFollowingModeElement); + FillTrajectoryFollowingModeNode(document, trajectoryFollowingModeElement, kTrajectoryFollowingMode); + } + const auto kTrajectoryRef = followTrajectoryActionWriter->GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + tinyxml2::XMLNode* trajectoryRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF.c_str()); + elementNode->InsertEndChild(trajectoryRefElement); + FillTrajectoryRefNode(document, trajectoryRefElement, kTrajectoryRef); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr gearWriter) + { + // Add Attributes (Parameters) + const auto kManualGear = gearWriter->GetWriterManualGear(); + if (kManualGear) + { + tinyxml2::XMLNode* manualGearElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MANUAL_GEAR.c_str()); + elementNode->InsertEndChild(manualGearElement); + FillManualGearNode(document, manualGearElement, kManualGear); + } + const auto kAutomaticGear = gearWriter->GetWriterAutomaticGear(); + if (kAutomaticGear) + { + tinyxml2::XMLNode* automaticGearElement = document->NewElement(OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR.c_str()); + elementNode->InsertEndChild(automaticGearElement); + FillAutomaticGearNode(document, automaticGearElement, kAutomaticGear); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillGeoPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr geoPositionWriter) + { + // Add Attributes (Parameters) + const auto kAltitude = geoPositionWriter->GetAltitude(); + if (!( kAltitude == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAltitude).c_str()); + } + else if (geoPositionWriter->IsAltitudeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE.c_str(), geoPositionWriter->GetParameterFromAltitude().c_str()); + } + const auto kHeight = geoPositionWriter->GetHeight(); + if (!( kHeight == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__HEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kHeight).c_str()); + } + else if (geoPositionWriter->IsHeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__HEIGHT.c_str(), geoPositionWriter->GetParameterFromHeight().c_str()); + } + const auto kLatitude = geoPositionWriter->GetLatitude(); + if (!( kLatitude == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATITUDE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLatitude).c_str()); + } + else if (geoPositionWriter->IsLatitudeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATITUDE.c_str(), geoPositionWriter->GetParameterFromLatitude().c_str()); + } + const auto kLatitudeDeg = geoPositionWriter->GetLatitudeDeg(); + if (!( kLatitudeDeg == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLatitudeDeg).c_str()); + } + else if (geoPositionWriter->IsLatitudeDegParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG.c_str(), geoPositionWriter->GetParameterFromLatitudeDeg().c_str()); + } + const auto kLongitude = geoPositionWriter->GetLongitude(); + if (!( kLongitude == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLongitude).c_str()); + } + else if (geoPositionWriter->IsLongitudeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE.c_str(), geoPositionWriter->GetParameterFromLongitude().c_str()); + } + const auto kLongitudeDeg = geoPositionWriter->GetLongitudeDeg(); + if (!( kLongitudeDeg == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLongitudeDeg).c_str()); + } + else if (geoPositionWriter->IsLongitudeDegParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG.c_str(), geoPositionWriter->GetParameterFromLongitudeDeg().c_str()); + } + const auto kVerticalRoadSelection = geoPositionWriter->GetVerticalRoadSelection(); + if (!( kVerticalRoadSelection == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION.c_str(), XmlExportHelper::ToXmlStringFromInt( kVerticalRoadSelection).c_str()); + } + else if (geoPositionWriter->IsVerticalRoadSelectionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION.c_str(), geoPositionWriter->GetParameterFromVerticalRoadSelection().c_str()); + } + const auto kOrientation = geoPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillGlobalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr globalActionWriter) + { + // Add Attributes (Parameters) + const auto kEnvironmentAction = globalActionWriter->GetWriterEnvironmentAction(); + if (kEnvironmentAction) + { + tinyxml2::XMLNode* environmentActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION.c_str()); + elementNode->InsertEndChild(environmentActionElement); + FillEnvironmentActionNode(document, environmentActionElement, kEnvironmentAction); + } + const auto kEntityAction = globalActionWriter->GetWriterEntityAction(); + if (kEntityAction) + { + tinyxml2::XMLNode* entityActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_ACTION.c_str()); + elementNode->InsertEndChild(entityActionElement); + FillEntityActionNode(document, entityActionElement, kEntityAction); + } + const auto kInfrastructureAction = globalActionWriter->GetWriterInfrastructureAction(); + if (kInfrastructureAction) + { + tinyxml2::XMLNode* infrastructureActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION.c_str()); + elementNode->InsertEndChild(infrastructureActionElement); + FillInfrastructureActionNode(document, infrastructureActionElement, kInfrastructureAction); + } + const auto kSetMonitorAction = globalActionWriter->GetWriterSetMonitorAction(); + if (kSetMonitorAction) + { + tinyxml2::XMLNode* setMonitorActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION.c_str()); + elementNode->InsertEndChild(setMonitorActionElement); + FillSetMonitorActionNode(document, setMonitorActionElement, kSetMonitorAction); + } + const auto kParameterAction = globalActionWriter->GetWriterParameterAction(); + if (kParameterAction) + { + tinyxml2::XMLNode* parameterActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION.c_str()); + elementNode->InsertEndChild(parameterActionElement); + FillParameterActionNode(document, parameterActionElement, kParameterAction); + } + const auto kTrafficAction = globalActionWriter->GetWriterTrafficAction(); + if (kTrafficAction) + { + tinyxml2::XMLNode* trafficActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION.c_str()); + elementNode->InsertEndChild(trafficActionElement); + FillTrafficActionNode(document, trafficActionElement, kTrafficAction); + } + const auto kVariableAction = globalActionWriter->GetWriterVariableAction(); + if (kVariableAction) + { + tinyxml2::XMLNode* variableActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION.c_str()); + elementNode->InsertEndChild(variableActionElement); + FillVariableActionNode(document, variableActionElement, kVariableAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillHistogramNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr histogramWriter) + { + // Add Attributes (Parameters) + const auto kBins = histogramWriter->GetWriterBins(); + if (!kBins.empty()) + { + for (auto binsWriterItem : kBins) + { + tinyxml2::XMLNode* binsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BIN.c_str()); + elementNode->InsertEndChild(binsElement); + FillHistogramBinNode(document, binsElement, binsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillHistogramBinNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr histogramBinWriter) + { + // Add Attributes (Parameters) + const auto kWeight = histogramBinWriter->GetWeight(); + if (histogramBinWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), histogramBinWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + const auto kRange = histogramBinWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillInRoutePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr inRoutePositionWriter) + { + // Add Attributes (Parameters) + const auto kFromCurrentEntity = inRoutePositionWriter->GetWriterFromCurrentEntity(); + if (kFromCurrentEntity) + { + tinyxml2::XMLNode* fromCurrentEntityElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY.c_str()); + elementNode->InsertEndChild(fromCurrentEntityElement); + FillPositionOfCurrentEntityNode(document, fromCurrentEntityElement, kFromCurrentEntity); + } + const auto kFromRoadCoordinates = inRoutePositionWriter->GetWriterFromRoadCoordinates(); + if (kFromRoadCoordinates) + { + tinyxml2::XMLNode* fromRoadCoordinatesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES.c_str()); + elementNode->InsertEndChild(fromRoadCoordinatesElement); + FillPositionInRoadCoordinatesNode(document, fromRoadCoordinatesElement, kFromRoadCoordinates); + } + const auto kFromLaneCoordinates = inRoutePositionWriter->GetWriterFromLaneCoordinates(); + if (kFromLaneCoordinates) + { + tinyxml2::XMLNode* fromLaneCoordinatesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES.c_str()); + elementNode->InsertEndChild(fromLaneCoordinatesElement); + FillPositionInLaneCoordinatesNode(document, fromLaneCoordinatesElement, kFromLaneCoordinates); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillInfrastructureActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr infrastructureActionWriter) + { + // Add Attributes (Parameters) + const auto kTrafficSignalAction = infrastructureActionWriter->GetWriterTrafficSignalAction(); + if (kTrafficSignalAction) + { + tinyxml2::XMLNode* trafficSignalActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_ACTION.c_str()); + elementNode->InsertEndChild(trafficSignalActionElement); + FillTrafficSignalActionNode(document, trafficSignalActionElement, kTrafficSignalAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillInitNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr initWriter) + { + // Add Attributes (Parameters) + const auto kActions = initWriter->GetWriterActions(); + if (kActions) + { + tinyxml2::XMLNode* actionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACTIONS.c_str()); + elementNode->InsertEndChild(actionsElement); + FillInitActionsNode(document, actionsElement, kActions); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillInitActionsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr initActionsWriter) + { + // Add Attributes (Parameters) + const auto kGlobalActions = initActionsWriter->GetWriterGlobalActions(); + if (!kGlobalActions.empty()) + { + for (auto globalActionsWriterItem : kGlobalActions) + { + tinyxml2::XMLNode* globalActionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION.c_str()); + elementNode->InsertEndChild(globalActionsElement); + FillGlobalActionNode(document, globalActionsElement, globalActionsWriterItem); + + } + } + const auto kUserDefinedActions = initActionsWriter->GetWriterUserDefinedActions(); + if (!kUserDefinedActions.empty()) + { + for (auto userDefinedActionsWriterItem : kUserDefinedActions) + { + tinyxml2::XMLNode* userDefinedActionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION.c_str()); + elementNode->InsertEndChild(userDefinedActionsElement); + FillUserDefinedActionNode(document, userDefinedActionsElement, userDefinedActionsWriterItem); + + } + } + const auto kPrivates = initActionsWriter->GetWriterPrivates(); + if (!kPrivates.empty()) + { + for (auto privatesWriterItem : kPrivates) + { + tinyxml2::XMLNode* privatesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PRIVATE.c_str()); + elementNode->InsertEndChild(privatesElement); + FillPrivateNode(document, privatesElement, privatesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillKnotNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr knotWriter) + { + // Add Attributes (Parameters) + const auto kValue = knotWriter->GetValue(); + if (knotWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), knotWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneWriter) + { + // Add Attributes (Parameters) + const auto kId = laneWriter->GetId(); + if (laneWriter->IsIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ID.c_str(), laneWriter->GetParameterFromId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ID.c_str(), XmlExportHelper::ToXmlStringFromInt( kId).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneChangeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneChangeActionWriter) + { + // Add Attributes (Parameters) + const auto kTargetLaneOffset = laneChangeActionWriter->GetTargetLaneOffset(); + if (!( kTargetLaneOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTargetLaneOffset).c_str()); + } + else if (laneChangeActionWriter->IsTargetLaneOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET.c_str(), laneChangeActionWriter->GetParameterFromTargetLaneOffset().c_str()); + } + const auto kLaneChangeActionDynamics = laneChangeActionWriter->GetWriterLaneChangeActionDynamics(); + if (kLaneChangeActionDynamics) + { + tinyxml2::XMLNode* laneChangeActionDynamicsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION_DYNAMICS.c_str()); + elementNode->InsertEndChild(laneChangeActionDynamicsElement); + FillTransitionDynamicsNode(document, laneChangeActionDynamicsElement, kLaneChangeActionDynamics); + } + const auto kLaneChangeTarget = laneChangeActionWriter->GetWriterLaneChangeTarget(); + if (kLaneChangeTarget) + { + tinyxml2::XMLNode* laneChangeTargetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_TARGET.c_str()); + elementNode->InsertEndChild(laneChangeTargetElement); + FillLaneChangeTargetNode(document, laneChangeTargetElement, kLaneChangeTarget); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneChangeTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneChangeTargetWriter) + { + // Add Attributes (Parameters) + const auto kRelativeTargetLane = laneChangeTargetWriter->GetWriterRelativeTargetLane(); + if (kRelativeTargetLane) + { + tinyxml2::XMLNode* relativeTargetLaneElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE.c_str()); + elementNode->InsertEndChild(relativeTargetLaneElement); + FillRelativeTargetLaneNode(document, relativeTargetLaneElement, kRelativeTargetLane); + } + const auto kAbsoluteTargetLane = laneChangeTargetWriter->GetWriterAbsoluteTargetLane(); + if (kAbsoluteTargetLane) + { + tinyxml2::XMLNode* absoluteTargetLaneElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE.c_str()); + elementNode->InsertEndChild(absoluteTargetLaneElement); + FillAbsoluteTargetLaneNode(document, absoluteTargetLaneElement, kAbsoluteTargetLane); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneOffsetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetActionWriter) + { + // Add Attributes (Parameters) + const auto kContinuous = laneOffsetActionWriter->GetContinuous(); + if (laneOffsetActionWriter->IsContinuousParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), laneOffsetActionWriter->GetParameterFromContinuous().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kContinuous).c_str()); + } + const auto kLaneOffsetActionDynamics = laneOffsetActionWriter->GetWriterLaneOffsetActionDynamics(); + if (kLaneOffsetActionDynamics) + { + tinyxml2::XMLNode* laneOffsetActionDynamicsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION_DYNAMICS.c_str()); + elementNode->InsertEndChild(laneOffsetActionDynamicsElement); + FillLaneOffsetActionDynamicsNode(document, laneOffsetActionDynamicsElement, kLaneOffsetActionDynamics); + } + const auto kLaneOffsetTarget = laneOffsetActionWriter->GetWriterLaneOffsetTarget(); + if (kLaneOffsetTarget) + { + tinyxml2::XMLNode* laneOffsetTargetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_TARGET.c_str()); + elementNode->InsertEndChild(laneOffsetTargetElement); + FillLaneOffsetTargetNode(document, laneOffsetTargetElement, kLaneOffsetTarget); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneOffsetActionDynamicsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetActionDynamicsWriter) + { + // Add Attributes (Parameters) + const auto kDynamicsShape = laneOffsetActionDynamicsWriter->GetDynamicsShape(); + if (laneOffsetActionDynamicsWriter->IsDynamicsShapeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE.c_str(), laneOffsetActionDynamicsWriter->GetParameterFromDynamicsShape().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE.c_str(), kDynamicsShape.GetLiteral().c_str()); + } + const auto kMaxLateralAcc = laneOffsetActionDynamicsWriter->GetMaxLateralAcc(); + if (!( kMaxLateralAcc == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxLateralAcc).c_str()); + } + else if (laneOffsetActionDynamicsWriter->IsMaxLateralAccParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC.c_str(), laneOffsetActionDynamicsWriter->GetParameterFromMaxLateralAcc().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLaneOffsetTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetTargetWriter) + { + // Add Attributes (Parameters) + const auto kRelativeTargetLaneOffset = laneOffsetTargetWriter->GetWriterRelativeTargetLaneOffset(); + if (kRelativeTargetLaneOffset) + { + tinyxml2::XMLNode* relativeTargetLaneOffsetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET.c_str()); + elementNode->InsertEndChild(relativeTargetLaneOffsetElement); + FillRelativeTargetLaneOffsetNode(document, relativeTargetLaneOffsetElement, kRelativeTargetLaneOffset); + } + const auto kAbsoluteTargetLaneOffset = laneOffsetTargetWriter->GetWriterAbsoluteTargetLaneOffset(); + if (kAbsoluteTargetLaneOffset) + { + tinyxml2::XMLNode* absoluteTargetLaneOffsetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET.c_str()); + elementNode->InsertEndChild(absoluteTargetLaneOffsetElement); + FillAbsoluteTargetLaneOffsetNode(document, absoluteTargetLaneOffsetElement, kAbsoluteTargetLaneOffset); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLanePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lanePositionWriter) + { + // Add Attributes (Parameters) + const auto kLaneId = lanePositionWriter->GetLaneId(); + if (lanePositionWriter->IsLaneIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_ID.c_str(), lanePositionWriter->GetParameterFromLaneId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kLaneId).c_str()); + } + const auto kOffset = lanePositionWriter->GetOffset(); + if (!( kOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kOffset).c_str()); + } + else if (lanePositionWriter->IsOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), lanePositionWriter->GetParameterFromOffset().c_str()); + } + const auto kRoadId = lanePositionWriter->GetRoadId(); + if (lanePositionWriter->IsRoadIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), lanePositionWriter->GetParameterFromRoadId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kRoadId).c_str()); + } + const auto kS = lanePositionWriter->GetS(); + if (lanePositionWriter->IsSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), lanePositionWriter->GetParameterFromS().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kS).c_str()); + } + const auto kOrientation = lanePositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLateralActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lateralActionWriter) + { + // Add Attributes (Parameters) + const auto kLaneChangeAction = lateralActionWriter->GetWriterLaneChangeAction(); + if (kLaneChangeAction) + { + tinyxml2::XMLNode* laneChangeActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION.c_str()); + elementNode->InsertEndChild(laneChangeActionElement); + FillLaneChangeActionNode(document, laneChangeActionElement, kLaneChangeAction); + } + const auto kLaneOffsetAction = lateralActionWriter->GetWriterLaneOffsetAction(); + if (kLaneOffsetAction) + { + tinyxml2::XMLNode* laneOffsetActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION.c_str()); + elementNode->InsertEndChild(laneOffsetActionElement); + FillLaneOffsetActionNode(document, laneOffsetActionElement, kLaneOffsetAction); + } + const auto kLateralDistanceAction = lateralActionWriter->GetWriterLateralDistanceAction(); + if (kLateralDistanceAction) + { + tinyxml2::XMLNode* lateralDistanceActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION.c_str()); + elementNode->InsertEndChild(lateralDistanceActionElement); + FillLateralDistanceActionNode(document, lateralDistanceActionElement, kLateralDistanceAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLateralDistanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lateralDistanceActionWriter) + { + // Add Attributes (Parameters) + const auto kContinuous = lateralDistanceActionWriter->GetContinuous(); + if (lateralDistanceActionWriter->IsContinuousParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), lateralDistanceActionWriter->GetParameterFromContinuous().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kContinuous).c_str()); + } + const auto kCoordinateSystem = lateralDistanceActionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (lateralDistanceActionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), lateralDistanceActionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kDisplacement = lateralDistanceActionWriter->GetDisplacement(); + if (!( kDisplacement == LateralDisplacement::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT.c_str(), kDisplacement.GetLiteral().c_str()); + } + else if (lateralDistanceActionWriter->IsDisplacementParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT.c_str(), lateralDistanceActionWriter->GetParameterFromDisplacement().c_str()); + } + const auto kDistance = lateralDistanceActionWriter->GetDistance(); + if (!( kDistance == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDistance).c_str()); + } + else if (lateralDistanceActionWriter->IsDistanceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), lateralDistanceActionWriter->GetParameterFromDistance().c_str()); + } + const auto kEntityRef = lateralDistanceActionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kFreespace = lateralDistanceActionWriter->GetFreespace(); + if (lateralDistanceActionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), lateralDistanceActionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kDynamicConstraints = lateralDistanceActionWriter->GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + tinyxml2::XMLNode* dynamicConstraintsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS.c_str()); + elementNode->InsertEndChild(dynamicConstraintsElement); + FillDynamicConstraintsNode(document, dynamicConstraintsElement, kDynamicConstraints); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLicenseNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr licenseWriter) + { + // Add Attributes (Parameters) + const auto kText = licenseWriter->GetText(); + if (!( kText.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TEXT.c_str(), XmlExportHelper::ToXmlStringFromString( kText).c_str()); + } + else if (licenseWriter->IsTextParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TEXT.c_str(), licenseWriter->GetParameterFromText().c_str()); + } + const auto kName = licenseWriter->GetName(); + if (licenseWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), licenseWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kResource = licenseWriter->GetResource(); + if (!( kResource.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RESOURCE.c_str(), XmlExportHelper::ToXmlStringFromString( kResource).c_str()); + } + else if (licenseWriter->IsResourceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RESOURCE.c_str(), licenseWriter->GetParameterFromResource().c_str()); + } + const auto kSpdxId = licenseWriter->GetSpdxId(); + if (!( kSpdxId.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kSpdxId).c_str()); + } + else if (licenseWriter->IsSpdxIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID.c_str(), licenseWriter->GetParameterFromSpdxId().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLightStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightStateWriter) + { + // Add Attributes (Parameters) + const auto kFlashingOffDuration = lightStateWriter->GetFlashingOffDuration(); + if (!( kFlashingOffDuration == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kFlashingOffDuration).c_str()); + } + else if (lightStateWriter->IsFlashingOffDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION.c_str(), lightStateWriter->GetParameterFromFlashingOffDuration().c_str()); + } + const auto kFlashingOnDuration = lightStateWriter->GetFlashingOnDuration(); + if (!( kFlashingOnDuration == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kFlashingOnDuration).c_str()); + } + else if (lightStateWriter->IsFlashingOnDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION.c_str(), lightStateWriter->GetParameterFromFlashingOnDuration().c_str()); + } + const auto kLuminousIntensity = lightStateWriter->GetLuminousIntensity(); + if (!( kLuminousIntensity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLuminousIntensity).c_str()); + } + else if (lightStateWriter->IsLuminousIntensityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY.c_str(), lightStateWriter->GetParameterFromLuminousIntensity().c_str()); + } + const auto kMode = lightStateWriter->GetMode(); + if (lightStateWriter->IsModeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODE.c_str(), lightStateWriter->GetParameterFromMode().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODE.c_str(), kMode.GetLiteral().c_str()); + } + const auto kColor = lightStateWriter->GetWriterColor(); + if (kColor) + { + tinyxml2::XMLNode* colorElement = document->NewElement(OSC_CONSTANTS::ELEMENT__COLOR.c_str()); + elementNode->InsertEndChild(colorElement); + FillColorNode(document, colorElement, kColor); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLightStateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightStateActionWriter) + { + // Add Attributes (Parameters) + const auto kTransitionTime = lightStateActionWriter->GetTransitionTime(); + if (!( kTransitionTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTransitionTime).c_str()); + } + else if (lightStateActionWriter->IsTransitionTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME.c_str(), lightStateActionWriter->GetParameterFromTransitionTime().c_str()); + } + const auto kLightType = lightStateActionWriter->GetWriterLightType(); + if (kLightType) + { + tinyxml2::XMLNode* lightTypeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LIGHT_TYPE.c_str()); + elementNode->InsertEndChild(lightTypeElement); + FillLightTypeNode(document, lightTypeElement, kLightType); + } + const auto kLightState = lightStateActionWriter->GetWriterLightState(); + if (kLightState) + { + tinyxml2::XMLNode* lightStateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LIGHT_STATE.c_str()); + elementNode->InsertEndChild(lightStateElement); + FillLightStateNode(document, lightStateElement, kLightState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLightTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightTypeWriter) + { + // Add Attributes (Parameters) + const auto kVehicleLight = lightTypeWriter->GetWriterVehicleLight(); + if (kVehicleLight) + { + tinyxml2::XMLNode* vehicleLightElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT.c_str()); + elementNode->InsertEndChild(vehicleLightElement); + FillVehicleLightNode(document, vehicleLightElement, kVehicleLight); + } + const auto kUserDefinedLight = lightTypeWriter->GetWriterUserDefinedLight(); + if (kUserDefinedLight) + { + tinyxml2::XMLNode* userDefinedLightElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT.c_str()); + elementNode->InsertEndChild(userDefinedLightElement); + FillUserDefinedLightNode(document, userDefinedLightElement, kUserDefinedLight); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLogNormalDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr logNormalDistributionWriter) + { + // Add Attributes (Parameters) + const auto kExpectedValue = logNormalDistributionWriter->GetExpectedValue(); + if (logNormalDistributionWriter->IsExpectedValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), logNormalDistributionWriter->GetParameterFromExpectedValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kExpectedValue).c_str()); + } + const auto kVariance = logNormalDistributionWriter->GetVariance(); + if (logNormalDistributionWriter->IsVarianceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIANCE.c_str(), logNormalDistributionWriter->GetParameterFromVariance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kVariance).c_str()); + } + const auto kRange = logNormalDistributionWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLongitudinalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr longitudinalActionWriter) + { + // Add Attributes (Parameters) + const auto kSpeedAction = longitudinalActionWriter->GetWriterSpeedAction(); + if (kSpeedAction) + { + tinyxml2::XMLNode* speedActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_ACTION.c_str()); + elementNode->InsertEndChild(speedActionElement); + FillSpeedActionNode(document, speedActionElement, kSpeedAction); + } + const auto kLongitudinalDistanceAction = longitudinalActionWriter->GetWriterLongitudinalDistanceAction(); + if (kLongitudinalDistanceAction) + { + tinyxml2::XMLNode* longitudinalDistanceActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION.c_str()); + elementNode->InsertEndChild(longitudinalDistanceActionElement); + FillLongitudinalDistanceActionNode(document, longitudinalDistanceActionElement, kLongitudinalDistanceAction); + } + const auto kSpeedProfileAction = longitudinalActionWriter->GetWriterSpeedProfileAction(); + if (kSpeedProfileAction) + { + tinyxml2::XMLNode* speedProfileActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION.c_str()); + elementNode->InsertEndChild(speedProfileActionElement); + FillSpeedProfileActionNode(document, speedProfileActionElement, kSpeedProfileAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillLongitudinalDistanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr longitudinalDistanceActionWriter) + { + // Add Attributes (Parameters) + const auto kContinuous = longitudinalDistanceActionWriter->GetContinuous(); + if (longitudinalDistanceActionWriter->IsContinuousParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), longitudinalDistanceActionWriter->GetParameterFromContinuous().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kContinuous).c_str()); + } + const auto kCoordinateSystem = longitudinalDistanceActionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (longitudinalDistanceActionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), longitudinalDistanceActionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kDisplacement = longitudinalDistanceActionWriter->GetDisplacement(); + if (!( kDisplacement == LongitudinalDisplacement::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT.c_str(), kDisplacement.GetLiteral().c_str()); + } + else if (longitudinalDistanceActionWriter->IsDisplacementParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT.c_str(), longitudinalDistanceActionWriter->GetParameterFromDisplacement().c_str()); + } + const auto kDistance = longitudinalDistanceActionWriter->GetDistance(); + if (!( kDistance == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDistance).c_str()); + } + else if (longitudinalDistanceActionWriter->IsDistanceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), longitudinalDistanceActionWriter->GetParameterFromDistance().c_str()); + } + const auto kEntityRef = longitudinalDistanceActionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kFreespace = longitudinalDistanceActionWriter->GetFreespace(); + if (longitudinalDistanceActionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), longitudinalDistanceActionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kTimeGap = longitudinalDistanceActionWriter->GetTimeGap(); + if (!( kTimeGap == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTimeGap).c_str()); + } + else if (longitudinalDistanceActionWriter->IsTimeGapParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP.c_str(), longitudinalDistanceActionWriter->GetParameterFromTimeGap().c_str()); + } + const auto kDynamicConstraints = longitudinalDistanceActionWriter->GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + tinyxml2::XMLNode* dynamicConstraintsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS.c_str()); + elementNode->InsertEndChild(dynamicConstraintsElement); + FillDynamicConstraintsNode(document, dynamicConstraintsElement, kDynamicConstraints); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillManeuverNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverWriter) + { + // Add Attributes (Parameters) + const auto kName = maneuverWriter->GetName(); + if (maneuverWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), maneuverWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = maneuverWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kEvents = maneuverWriter->GetWriterEvents(); + if (!kEvents.empty()) + { + for (auto eventsWriterItem : kEvents) + { + tinyxml2::XMLNode* eventsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__EVENT.c_str()); + elementNode->InsertEndChild(eventsElement); + FillEventNode(document, eventsElement, eventsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillManeuverCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = maneuverCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillManeuverGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverGroupWriter) + { + // Add Attributes (Parameters) + const auto kMaximumExecutionCount = maneuverGroupWriter->GetMaximumExecutionCount(); + if (maneuverGroupWriter->IsMaximumExecutionCountParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT.c_str(), maneuverGroupWriter->GetParameterFromMaximumExecutionCount().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kMaximumExecutionCount).c_str()); + } + const auto kName = maneuverGroupWriter->GetName(); + if (maneuverGroupWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), maneuverGroupWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kActors = maneuverGroupWriter->GetWriterActors(); + if (kActors) + { + tinyxml2::XMLNode* actorsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACTORS.c_str()); + elementNode->InsertEndChild(actorsElement); + FillActorsNode(document, actorsElement, kActors); + } + const auto kCatalogReferences = maneuverGroupWriter->GetWriterCatalogReferences(); + if (!kCatalogReferences.empty()) + { + for (auto catalogReferencesWriterItem : kCatalogReferences) + { + tinyxml2::XMLNode* catalogReferencesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferencesElement); + FillCatalogReferenceNode(document, catalogReferencesElement, catalogReferencesWriterItem); + + } + } + const auto kManeuvers = maneuverGroupWriter->GetWriterManeuvers(); + if (!kManeuvers.empty()) + { + for (auto maneuversWriterItem : kManeuvers) + { + tinyxml2::XMLNode* maneuversElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MANEUVER.c_str()); + elementNode->InsertEndChild(maneuversElement); + FillManeuverNode(document, maneuversElement, maneuversWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillManualGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr manualGearWriter) + { + // Add Attributes (Parameters) + const auto kNumber = manualGearWriter->GetNumber(); + if (manualGearWriter->IsNumberParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER.c_str(), manualGearWriter->GetParameterFromNumber().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER.c_str(), XmlExportHelper::ToXmlStringFromInt( kNumber).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillMiscObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr miscObjectWriter) + { + // Add Attributes (Parameters) + const auto kMass = miscObjectWriter->GetMass(); + if (miscObjectWriter->IsMassParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), miscObjectWriter->GetParameterFromMass().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMass).c_str()); + } + const auto kMiscObjectCategory = miscObjectWriter->GetMiscObjectCategory(); + if (miscObjectWriter->IsMiscObjectCategoryParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY.c_str(), miscObjectWriter->GetParameterFromMiscObjectCategory().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY.c_str(), kMiscObjectCategory.GetLiteral().c_str()); + } + const auto kModel3d = miscObjectWriter->GetModel3d(); + if (!( kModel3d.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), XmlExportHelper::ToXmlStringFromString( kModel3d).c_str()); + } + else if (miscObjectWriter->IsModel3dParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), miscObjectWriter->GetParameterFromModel3d().c_str()); + } + const auto kName = miscObjectWriter->GetName(); + if (miscObjectWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), miscObjectWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = miscObjectWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kBoundingBox = miscObjectWriter->GetWriterBoundingBox(); + if (kBoundingBox) + { + tinyxml2::XMLNode* boundingBoxElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX.c_str()); + elementNode->InsertEndChild(boundingBoxElement); + FillBoundingBoxNode(document, boundingBoxElement, kBoundingBox); + } + const auto kProperties = miscObjectWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillMiscObjectCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr miscObjectCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = miscObjectCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillModifyRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr modifyRuleWriter) + { + // Add Attributes (Parameters) + const auto kAddValue = modifyRuleWriter->GetWriterAddValue(); + if (kAddValue) + { + tinyxml2::XMLNode* addValueElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ADD_VALUE.c_str()); + elementNode->InsertEndChild(addValueElement); + FillParameterAddValueRuleNode(document, addValueElement, kAddValue); + } + const auto kMultiplyByValue = modifyRuleWriter->GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + tinyxml2::XMLNode* multiplyByValueElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE.c_str()); + elementNode->InsertEndChild(multiplyByValueElement); + FillParameterMultiplyByValueRuleNode(document, multiplyByValueElement, kMultiplyByValue); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillMonitorDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr monitorDeclarationWriter) + { + // Add Attributes (Parameters) + const auto kName = monitorDeclarationWriter->GetName(); + if (monitorDeclarationWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), monitorDeclarationWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kValue = monitorDeclarationWriter->GetValue(); + if (monitorDeclarationWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), monitorDeclarationWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillNoneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr noneWriter) + { + // Add Attributes (Parameters) + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillNormalDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr normalDistributionWriter) + { + // Add Attributes (Parameters) + const auto kExpectedValue = normalDistributionWriter->GetExpectedValue(); + if (normalDistributionWriter->IsExpectedValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), normalDistributionWriter->GetParameterFromExpectedValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kExpectedValue).c_str()); + } + const auto kVariance = normalDistributionWriter->GetVariance(); + if (normalDistributionWriter->IsVarianceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIANCE.c_str(), normalDistributionWriter->GetParameterFromVariance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kVariance).c_str()); + } + const auto kRange = normalDistributionWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillNurbsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr nurbsWriter) + { + // Add Attributes (Parameters) + const auto kOrder = nurbsWriter->GetOrder(); + if (nurbsWriter->IsOrderParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ORDER.c_str(), nurbsWriter->GetParameterFromOrder().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ORDER.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kOrder).c_str()); + } + const auto kControlPoints = nurbsWriter->GetWriterControlPoints(); + if (!kControlPoints.empty()) + { + for (auto controlPointsWriterItem : kControlPoints) + { + tinyxml2::XMLNode* controlPointsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROL_POINT.c_str()); + elementNode->InsertEndChild(controlPointsElement); + FillControlPointNode(document, controlPointsElement, controlPointsWriterItem); + + } + } + const auto kKnots = nurbsWriter->GetWriterKnots(); + if (!kKnots.empty()) + { + for (auto knotsWriterItem : kKnots) + { + tinyxml2::XMLNode* knotsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__KNOT.c_str()); + elementNode->InsertEndChild(knotsElement); + FillKnotNode(document, knotsElement, knotsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillObjectControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr objectControllerWriter) + { + // Add Attributes (Parameters) + const auto kName = objectControllerWriter->GetName(); + if (!( kName.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + else if (objectControllerWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), objectControllerWriter->GetParameterFromName().c_str()); + } + const auto kCatalogReference = objectControllerWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + const auto kController = objectControllerWriter->GetWriterController(); + if (kController) + { + tinyxml2::XMLNode* controllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER.c_str()); + elementNode->InsertEndChild(controllerElement); + FillControllerNode(document, controllerElement, kController); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOffroadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr offroadConditionWriter) + { + // Add Attributes (Parameters) + const auto kDuration = offroadConditionWriter->GetDuration(); + if (offroadConditionWriter->IsDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), offroadConditionWriter->GetParameterFromDuration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDuration).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOpenScenarioNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr openScenarioWriter) + { + // Add Attributes (Parameters) + const auto kFileHeader = openScenarioWriter->GetWriterFileHeader(); + if (kFileHeader) + { + tinyxml2::XMLNode* fileHeaderElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FILE_HEADER.c_str()); + elementNode->InsertEndChild(fileHeaderElement); + FillFileHeaderNode(document, fileHeaderElement, kFileHeader); + } + const auto kOpenScenarioCategory = openScenarioWriter->GetWriterOpenScenarioCategory(); + if (kOpenScenarioCategory) + { + FillOpenScenarioCategoryNode(document, elementNode, kOpenScenarioCategory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOpenScenarioCategoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr openScenarioCategoryWriter) + { + // Add Attributes (Parameters) + const auto kScenarioDefinition = openScenarioCategoryWriter->GetWriterScenarioDefinition(); + if (kScenarioDefinition) + { + FillScenarioDefinitionNode(document, elementNode, kScenarioDefinition); + } + const auto kCatalogDefinition = openScenarioCategoryWriter->GetWriterCatalogDefinition(); + if (kCatalogDefinition) + { + FillCatalogDefinitionNode(document, elementNode, kCatalogDefinition); + } + const auto kParameterValueDistributionDefinition = openScenarioCategoryWriter->GetWriterParameterValueDistributionDefinition(); + if (kParameterValueDistributionDefinition) + { + FillParameterValueDistributionDefinitionNode(document, elementNode, kParameterValueDistributionDefinition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOrientationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr orientationWriter) + { + // Add Attributes (Parameters) + const auto kH = orientationWriter->GetH(); + if (!( kH == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H.c_str(), XmlExportHelper::ToXmlStringFromDouble( kH).c_str()); + } + else if (orientationWriter->IsHParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H.c_str(), orientationWriter->GetParameterFromH().c_str()); + } + const auto kP = orientationWriter->GetP(); + if (!( kP == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__P.c_str(), XmlExportHelper::ToXmlStringFromDouble( kP).c_str()); + } + else if (orientationWriter->IsPParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__P.c_str(), orientationWriter->GetParameterFromP().c_str()); + } + const auto kR = orientationWriter->GetR(); + if (!( kR == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__R.c_str(), XmlExportHelper::ToXmlStringFromDouble( kR).c_str()); + } + else if (orientationWriter->IsRParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__R.c_str(), orientationWriter->GetParameterFromR().c_str()); + } + const auto kType = orientationWriter->GetType(); + if (!( kType == ReferenceContext::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), kType.GetLiteral().c_str()); + } + else if (orientationWriter->IsTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), orientationWriter->GetParameterFromType().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideBrakeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideBrakeActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideBrakeActionWriter->GetActive(); + if (overrideBrakeActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideBrakeActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kValue = overrideBrakeActionWriter->GetValue(); + if (!( kValue == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + else if (overrideBrakeActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), overrideBrakeActionWriter->GetParameterFromValue().c_str()); + } + const auto kBrakeInput = overrideBrakeActionWriter->GetWriterBrakeInput(); + if (kBrakeInput) + { + FillBrakeInputNode(document, elementNode, kBrakeInput); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideClutchActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideClutchActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideClutchActionWriter->GetActive(); + if (overrideClutchActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideClutchActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kMaxRate = overrideClutchActionWriter->GetMaxRate(); + if (!( kMaxRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxRate).c_str()); + } + else if (overrideClutchActionWriter->IsMaxRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), overrideClutchActionWriter->GetParameterFromMaxRate().c_str()); + } + const auto kValue = overrideClutchActionWriter->GetValue(); + if (overrideClutchActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), overrideClutchActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideControllerValueActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideControllerValueActionWriter) + { + // Add Attributes (Parameters) + const auto kThrottle = overrideControllerValueActionWriter->GetWriterThrottle(); + if (kThrottle) + { + tinyxml2::XMLNode* throttleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__THROTTLE.c_str()); + elementNode->InsertEndChild(throttleElement); + FillOverrideThrottleActionNode(document, throttleElement, kThrottle); + } + const auto kBrake = overrideControllerValueActionWriter->GetWriterBrake(); + if (kBrake) + { + tinyxml2::XMLNode* brakeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BRAKE.c_str()); + elementNode->InsertEndChild(brakeElement); + FillOverrideBrakeActionNode(document, brakeElement, kBrake); + } + const auto kClutch = overrideControllerValueActionWriter->GetWriterClutch(); + if (kClutch) + { + tinyxml2::XMLNode* clutchElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CLUTCH.c_str()); + elementNode->InsertEndChild(clutchElement); + FillOverrideClutchActionNode(document, clutchElement, kClutch); + } + const auto kParkingBrake = overrideControllerValueActionWriter->GetWriterParkingBrake(); + if (kParkingBrake) + { + tinyxml2::XMLNode* parkingBrakeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARKING_BRAKE.c_str()); + elementNode->InsertEndChild(parkingBrakeElement); + FillOverrideParkingBrakeActionNode(document, parkingBrakeElement, kParkingBrake); + } + const auto kSteeringWheel = overrideControllerValueActionWriter->GetWriterSteeringWheel(); + if (kSteeringWheel) + { + tinyxml2::XMLNode* steeringWheelElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STEERING_WHEEL.c_str()); + elementNode->InsertEndChild(steeringWheelElement); + FillOverrideSteeringWheelActionNode(document, steeringWheelElement, kSteeringWheel); + } + const auto kGear = overrideControllerValueActionWriter->GetWriterGear(); + if (kGear) + { + tinyxml2::XMLNode* gearElement = document->NewElement(OSC_CONSTANTS::ELEMENT__GEAR.c_str()); + elementNode->InsertEndChild(gearElement); + FillOverrideGearActionNode(document, gearElement, kGear); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideGearActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideGearActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideGearActionWriter->GetActive(); + if (overrideGearActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideGearActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kNumber = overrideGearActionWriter->GetNumber(); + if (!( kNumber == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER.c_str(), XmlExportHelper::ToXmlStringFromDouble( kNumber).c_str()); + } + else if (overrideGearActionWriter->IsNumberParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER.c_str(), overrideGearActionWriter->GetParameterFromNumber().c_str()); + } + const auto kGear = overrideGearActionWriter->GetWriterGear(); + if (kGear) + { + FillGearNode(document, elementNode, kGear); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideParkingBrakeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideParkingBrakeActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideParkingBrakeActionWriter->GetActive(); + if (overrideParkingBrakeActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideParkingBrakeActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kValue = overrideParkingBrakeActionWriter->GetValue(); + if (!( kValue == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + else if (overrideParkingBrakeActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), overrideParkingBrakeActionWriter->GetParameterFromValue().c_str()); + } + const auto kBrakeInput = overrideParkingBrakeActionWriter->GetWriterBrakeInput(); + if (kBrakeInput) + { + FillBrakeInputNode(document, elementNode, kBrakeInput); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideSteeringWheelActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideSteeringWheelActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideSteeringWheelActionWriter->GetActive(); + if (overrideSteeringWheelActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideSteeringWheelActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kMaxRate = overrideSteeringWheelActionWriter->GetMaxRate(); + if (!( kMaxRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxRate).c_str()); + } + else if (overrideSteeringWheelActionWriter->IsMaxRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), overrideSteeringWheelActionWriter->GetParameterFromMaxRate().c_str()); + } + const auto kMaxTorque = overrideSteeringWheelActionWriter->GetMaxTorque(); + if (!( kMaxTorque == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxTorque).c_str()); + } + else if (overrideSteeringWheelActionWriter->IsMaxTorqueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE.c_str(), overrideSteeringWheelActionWriter->GetParameterFromMaxTorque().c_str()); + } + const auto kValue = overrideSteeringWheelActionWriter->GetValue(); + if (overrideSteeringWheelActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), overrideSteeringWheelActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillOverrideThrottleActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideThrottleActionWriter) + { + // Add Attributes (Parameters) + const auto kActive = overrideThrottleActionWriter->GetActive(); + if (overrideThrottleActionWriter->IsActiveParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), overrideThrottleActionWriter->GetParameterFromActive().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ACTIVE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kActive).c_str()); + } + const auto kMaxRate = overrideThrottleActionWriter->GetMaxRate(); + if (!( kMaxRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxRate).c_str()); + } + else if (overrideThrottleActionWriter->IsMaxRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE.c_str(), overrideThrottleActionWriter->GetParameterFromMaxRate().c_str()); + } + const auto kValue = overrideThrottleActionWriter->GetValue(); + if (overrideThrottleActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), overrideThrottleActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterActionWriter) + { + // Add Attributes (Parameters) + const auto kParameterRef = parameterActionWriter->GetParameterRef(); + if (kParameterRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kParameterRef->GetNameRef()).c_str()); + } + const auto kSetAction = parameterActionWriter->GetWriterSetAction(); + if (kSetAction) + { + tinyxml2::XMLNode* setActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SET_ACTION.c_str()); + elementNode->InsertEndChild(setActionElement); + FillParameterSetActionNode(document, setActionElement, kSetAction); + } + const auto kModifyAction = parameterActionWriter->GetWriterModifyAction(); + if (kModifyAction) + { + tinyxml2::XMLNode* modifyActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION.c_str()); + elementNode->InsertEndChild(modifyActionElement); + FillParameterModifyActionNode(document, modifyActionElement, kModifyAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterAddValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterAddValueRuleWriter) + { + // Add Attributes (Parameters) + const auto kValue = parameterAddValueRuleWriter->GetValue(); + if (parameterAddValueRuleWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterAddValueRuleWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterAssignmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterAssignmentWriter) + { + // Add Attributes (Parameters) + const auto kParameterRef = parameterAssignmentWriter->GetParameterRef(); + if (kParameterRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kParameterRef->GetNameRef()).c_str()); + } + const auto kValue = parameterAssignmentWriter->GetValue(); + if (parameterAssignmentWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterAssignmentWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterConditionWriter) + { + // Add Attributes (Parameters) + const auto kParameterRef = parameterConditionWriter->GetParameterRef(); + if (kParameterRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kParameterRef->GetNameRef()).c_str()); + } + const auto kRule = parameterConditionWriter->GetRule(); + if (parameterConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), parameterConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = parameterConditionWriter->GetValue(); + if (parameterConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterDeclarationWriter) + { + // Add Attributes (Parameters) + const auto kName = parameterDeclarationWriter->GetName(); + if (!(kName.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString(kName).c_str()); + } + const auto kParameterType = parameterDeclarationWriter->GetParameterType(); + if (parameterDeclarationWriter->IsParameterTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE.c_str(), parameterDeclarationWriter->GetParameterFromParameterType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE.c_str(), kParameterType.GetLiteral().c_str()); + } + const auto kValue = parameterDeclarationWriter->GetValue(); + if (parameterDeclarationWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterDeclarationWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + const auto kConstraintGroups = parameterDeclarationWriter->GetWriterConstraintGroups(); + if (!kConstraintGroups.empty()) + { + for (auto constraintGroupsWriterItem : kConstraintGroups) + { + tinyxml2::XMLNode* constraintGroupsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONSTRAINT_GROUP.c_str()); + elementNode->InsertEndChild(constraintGroupsElement); + FillValueConstraintGroupNode(document, constraintGroupsElement, constraintGroupsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterModifyActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterModifyActionWriter) + { + // Add Attributes (Parameters) + const auto kRule = parameterModifyActionWriter->GetWriterRule(); + if (kRule) + { + tinyxml2::XMLNode* ruleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RULE.c_str()); + elementNode->InsertEndChild(ruleElement); + FillModifyRuleNode(document, ruleElement, kRule); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterMultiplyByValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterMultiplyByValueRuleWriter) + { + // Add Attributes (Parameters) + const auto kValue = parameterMultiplyByValueRuleWriter->GetValue(); + if (parameterMultiplyByValueRuleWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterMultiplyByValueRuleWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterSetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterSetActionWriter) + { + // Add Attributes (Parameters) + const auto kValue = parameterSetActionWriter->GetValue(); + if (parameterSetActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), parameterSetActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterValueDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueDistributionWriter) + { + // Add Attributes (Parameters) + const auto kScenarioFile = parameterValueDistributionWriter->GetWriterScenarioFile(); + if (kScenarioFile) + { + tinyxml2::XMLNode* scenarioFileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SCENARIO_FILE.c_str()); + elementNode->InsertEndChild(scenarioFileElement); + FillFileNode(document, scenarioFileElement, kScenarioFile); + } + const auto kDistributionDefinition = parameterValueDistributionWriter->GetWriterDistributionDefinition(); + if (kDistributionDefinition) + { + FillDistributionDefinitionNode(document, elementNode, kDistributionDefinition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterValueDistributionDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueDistributionDefinitionWriter) + { + // Add Attributes (Parameters) + const auto kParameterValueDistribution = parameterValueDistributionDefinitionWriter->GetWriterParameterValueDistribution(); + if (kParameterValueDistribution) + { + tinyxml2::XMLNode* parameterValueDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(parameterValueDistributionElement); + FillParameterValueDistributionNode(document, parameterValueDistributionElement, kParameterValueDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillParameterValueSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueSetWriter) + { + // Add Attributes (Parameters) + const auto kParameterAssignments = parameterValueSetWriter->GetWriterParameterAssignments(); + if (!kParameterAssignments.empty()) + { + for (auto parameterAssignmentsWriterItem : kParameterAssignments) + { + tinyxml2::XMLNode* parameterAssignmentsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT.c_str()); + elementNode->InsertEndChild(parameterAssignmentsElement); + FillParameterAssignmentNode(document, parameterAssignmentsElement, parameterAssignmentsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPedestrianNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianWriter) + { + // Add Attributes (Parameters) + const auto kMass = pedestrianWriter->GetMass(); + if (pedestrianWriter->IsMassParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), pedestrianWriter->GetParameterFromMass().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMass).c_str()); + } + const auto kModel = pedestrianWriter->GetModel(); + if (!( kModel.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL.c_str(), XmlExportHelper::ToXmlStringFromString( kModel).c_str()); + } + else if (pedestrianWriter->IsModelParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL.c_str(), pedestrianWriter->GetParameterFromModel().c_str()); + } + const auto kModel3d = pedestrianWriter->GetModel3d(); + if (!( kModel3d.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), XmlExportHelper::ToXmlStringFromString( kModel3d).c_str()); + } + else if (pedestrianWriter->IsModel3dParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), pedestrianWriter->GetParameterFromModel3d().c_str()); + } + const auto kName = pedestrianWriter->GetName(); + if (pedestrianWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), pedestrianWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kPedestrianCategory = pedestrianWriter->GetPedestrianCategory(); + if (pedestrianWriter->IsPedestrianCategoryParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY.c_str(), pedestrianWriter->GetParameterFromPedestrianCategory().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY.c_str(), kPedestrianCategory.GetLiteral().c_str()); + } + const auto kRole = pedestrianWriter->GetRole(); + if (!( kRole == Role::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), kRole.GetLiteral().c_str()); + } + else if (pedestrianWriter->IsRoleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), pedestrianWriter->GetParameterFromRole().c_str()); + } + const auto kParameterDeclarations = pedestrianWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kBoundingBox = pedestrianWriter->GetWriterBoundingBox(); + if (kBoundingBox) + { + tinyxml2::XMLNode* boundingBoxElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX.c_str()); + elementNode->InsertEndChild(boundingBoxElement); + FillBoundingBoxNode(document, boundingBoxElement, kBoundingBox); + } + const auto kProperties = pedestrianWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPedestrianAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianAnimationWriter) + { + // Add Attributes (Parameters) + const auto kMotion = pedestrianAnimationWriter->GetMotion(); + if (!( kMotion == PedestrianMotionType::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MOTION.c_str(), kMotion.GetLiteral().c_str()); + } + else if (pedestrianAnimationWriter->IsMotionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MOTION.c_str(), pedestrianAnimationWriter->GetParameterFromMotion().c_str()); + } + const auto kUserDefinedPedestrianAnimation = pedestrianAnimationWriter->GetUserDefinedPedestrianAnimation(); + if (!( kUserDefinedPedestrianAnimation.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION.c_str(), XmlExportHelper::ToXmlStringFromString( kUserDefinedPedestrianAnimation).c_str()); + } + else if (pedestrianAnimationWriter->IsUserDefinedPedestrianAnimationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION.c_str(), pedestrianAnimationWriter->GetParameterFromUserDefinedPedestrianAnimation().c_str()); + } + const auto kGestures = pedestrianAnimationWriter->GetWriterGestures(); + if (!kGestures.empty()) + { + for (auto gesturesWriterItem : kGestures) + { + tinyxml2::XMLNode* gesturesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PEDESTRIAN_GESTURE.c_str()); + elementNode->InsertEndChild(gesturesElement); + FillPedestrianGestureNode(document, gesturesElement, gesturesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPedestrianCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = pedestrianCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPedestrianGestureNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianGestureWriter) + { + // Add Attributes (Parameters) + const auto kGesture = pedestrianGestureWriter->GetGesture(); + if (pedestrianGestureWriter->IsGestureParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GESTURE.c_str(), pedestrianGestureWriter->GetParameterFromGesture().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GESTURE.c_str(), kGesture.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPerformanceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr performanceWriter) + { + // Add Attributes (Parameters) + const auto kMaxAcceleration = performanceWriter->GetMaxAcceleration(); + if (performanceWriter->IsMaxAccelerationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION.c_str(), performanceWriter->GetParameterFromMaxAcceleration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxAcceleration).c_str()); + } + const auto kMaxAccelerationRate = performanceWriter->GetMaxAccelerationRate(); + if (!( kMaxAccelerationRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxAccelerationRate).c_str()); + } + else if (performanceWriter->IsMaxAccelerationRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE.c_str(), performanceWriter->GetParameterFromMaxAccelerationRate().c_str()); + } + const auto kMaxDeceleration = performanceWriter->GetMaxDeceleration(); + if (performanceWriter->IsMaxDecelerationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION.c_str(), performanceWriter->GetParameterFromMaxDeceleration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxDeceleration).c_str()); + } + const auto kMaxDecelerationRate = performanceWriter->GetMaxDecelerationRate(); + if (!( kMaxDecelerationRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxDecelerationRate).c_str()); + } + else if (performanceWriter->IsMaxDecelerationRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE.c_str(), performanceWriter->GetParameterFromMaxDecelerationRate().c_str()); + } + const auto kMaxSpeed = performanceWriter->GetMaxSpeed(); + if (performanceWriter->IsMaxSpeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED.c_str(), performanceWriter->GetParameterFromMaxSpeed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMaxSpeed).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPhaseNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr phaseWriter) + { + // Add Attributes (Parameters) + const auto kDuration = phaseWriter->GetDuration(); + if (phaseWriter->IsDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), phaseWriter->GetParameterFromDuration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDuration).c_str()); + } + const auto kName = phaseWriter->GetName(); + if (phaseWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), phaseWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kTrafficSignalStates = phaseWriter->GetWriterTrafficSignalStates(); + if (!kTrafficSignalStates.empty()) + { + for (auto trafficSignalStatesWriterItem : kTrafficSignalStates) + { + tinyxml2::XMLNode* trafficSignalStatesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE.c_str()); + elementNode->InsertEndChild(trafficSignalStatesElement); + FillTrafficSignalStateNode(document, trafficSignalStatesElement, trafficSignalStatesWriterItem); + + } + } + const auto kTrafficSignalGroupState = phaseWriter->GetWriterTrafficSignalGroupState(); + if (kTrafficSignalGroupState) + { + tinyxml2::XMLNode* trafficSignalGroupStateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_GROUP_STATE.c_str()); + elementNode->InsertEndChild(trafficSignalGroupStateElement); + FillTrafficSignalGroupStateNode(document, trafficSignalGroupStateElement, kTrafficSignalGroupState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPoissonDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr poissonDistributionWriter) + { + // Add Attributes (Parameters) + const auto kExpectedValue = poissonDistributionWriter->GetExpectedValue(); + if (poissonDistributionWriter->IsExpectedValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), poissonDistributionWriter->GetParameterFromExpectedValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kExpectedValue).c_str()); + } + const auto kRange = poissonDistributionWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPolygonNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr polygonWriter) + { + // Add Attributes (Parameters) + const auto kPositions = polygonWriter->GetWriterPositions(); + if (!kPositions.empty()) + { + for (auto positionsWriterItem : kPositions) + { + tinyxml2::XMLNode* positionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionsElement); + FillPositionNode(document, positionsElement, positionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPolylineNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr polylineWriter) + { + // Add Attributes (Parameters) + const auto kVertices = polylineWriter->GetWriterVertices(); + if (!kVertices.empty()) + { + for (auto verticesWriterItem : kVertices) + { + tinyxml2::XMLNode* verticesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VERTEX.c_str()); + elementNode->InsertEndChild(verticesElement); + FillVertexNode(document, verticesElement, verticesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionWriter) + { + // Add Attributes (Parameters) + const auto kWorldPosition = positionWriter->GetWriterWorldPosition(); + if (kWorldPosition) + { + tinyxml2::XMLNode* worldPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__WORLD_POSITION.c_str()); + elementNode->InsertEndChild(worldPositionElement); + FillWorldPositionNode(document, worldPositionElement, kWorldPosition); + } + const auto kRelativeWorldPosition = positionWriter->GetWriterRelativeWorldPosition(); + if (kRelativeWorldPosition) + { + tinyxml2::XMLNode* relativeWorldPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION.c_str()); + elementNode->InsertEndChild(relativeWorldPositionElement); + FillRelativeWorldPositionNode(document, relativeWorldPositionElement, kRelativeWorldPosition); + } + const auto kRelativeObjectPosition = positionWriter->GetWriterRelativeObjectPosition(); + if (kRelativeObjectPosition) + { + tinyxml2::XMLNode* relativeObjectPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION.c_str()); + elementNode->InsertEndChild(relativeObjectPositionElement); + FillRelativeObjectPositionNode(document, relativeObjectPositionElement, kRelativeObjectPosition); + } + const auto kRoadPosition = positionWriter->GetWriterRoadPosition(); + if (kRoadPosition) + { + tinyxml2::XMLNode* roadPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROAD_POSITION.c_str()); + elementNode->InsertEndChild(roadPositionElement); + FillRoadPositionNode(document, roadPositionElement, kRoadPosition); + } + const auto kRelativeRoadPosition = positionWriter->GetWriterRelativeRoadPosition(); + if (kRelativeRoadPosition) + { + tinyxml2::XMLNode* relativeRoadPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION.c_str()); + elementNode->InsertEndChild(relativeRoadPositionElement); + FillRelativeRoadPositionNode(document, relativeRoadPositionElement, kRelativeRoadPosition); + } + const auto kLanePosition = positionWriter->GetWriterLanePosition(); + if (kLanePosition) + { + tinyxml2::XMLNode* lanePositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE_POSITION.c_str()); + elementNode->InsertEndChild(lanePositionElement); + FillLanePositionNode(document, lanePositionElement, kLanePosition); + } + const auto kRelativeLanePosition = positionWriter->GetWriterRelativeLanePosition(); + if (kRelativeLanePosition) + { + tinyxml2::XMLNode* relativeLanePositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION.c_str()); + elementNode->InsertEndChild(relativeLanePositionElement); + FillRelativeLanePositionNode(document, relativeLanePositionElement, kRelativeLanePosition); + } + const auto kRoutePosition = positionWriter->GetWriterRoutePosition(); + if (kRoutePosition) + { + tinyxml2::XMLNode* routePositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE_POSITION.c_str()); + elementNode->InsertEndChild(routePositionElement); + FillRoutePositionNode(document, routePositionElement, kRoutePosition); + } + const auto kGeoPosition = positionWriter->GetWriterGeoPosition(); + if (kGeoPosition) + { + tinyxml2::XMLNode* geoPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__GEO_POSITION.c_str()); + elementNode->InsertEndChild(geoPositionElement); + FillGeoPositionNode(document, geoPositionElement, kGeoPosition); + } + const auto kTrajectoryPosition = positionWriter->GetWriterTrajectoryPosition(); + if (kTrajectoryPosition) + { + tinyxml2::XMLNode* trajectoryPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION.c_str()); + elementNode->InsertEndChild(trajectoryPositionElement); + FillTrajectoryPositionNode(document, trajectoryPositionElement, kTrajectoryPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPositionInLaneCoordinatesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionInLaneCoordinatesWriter) + { + // Add Attributes (Parameters) + const auto kLaneId = positionInLaneCoordinatesWriter->GetLaneId(); + if (positionInLaneCoordinatesWriter->IsLaneIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_ID.c_str(), positionInLaneCoordinatesWriter->GetParameterFromLaneId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kLaneId).c_str()); + } + const auto kLaneOffset = positionInLaneCoordinatesWriter->GetLaneOffset(); + if (!( kLaneOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLaneOffset).c_str()); + } + else if (positionInLaneCoordinatesWriter->IsLaneOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET.c_str(), positionInLaneCoordinatesWriter->GetParameterFromLaneOffset().c_str()); + } + const auto kPathS = positionInLaneCoordinatesWriter->GetPathS(); + if (positionInLaneCoordinatesWriter->IsPathSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH_S.c_str(), positionInLaneCoordinatesWriter->GetParameterFromPathS().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH_S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kPathS).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPositionInRoadCoordinatesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionInRoadCoordinatesWriter) + { + // Add Attributes (Parameters) + const auto kPathS = positionInRoadCoordinatesWriter->GetPathS(); + if (positionInRoadCoordinatesWriter->IsPathSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH_S.c_str(), positionInRoadCoordinatesWriter->GetParameterFromPathS().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PATH_S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kPathS).c_str()); + } + const auto kT = positionInRoadCoordinatesWriter->GetT(); + if (positionInRoadCoordinatesWriter->IsTParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), positionInRoadCoordinatesWriter->GetParameterFromT().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), XmlExportHelper::ToXmlStringFromDouble( kT).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPositionOfCurrentEntityNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionOfCurrentEntityWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = positionOfCurrentEntityWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPrecipitationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr precipitationWriter) + { + // Add Attributes (Parameters) + const auto kIntensity = precipitationWriter->GetIntensity(); + if (!( kIntensity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INTENSITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kIntensity).c_str()); + } + else if (precipitationWriter->IsIntensityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INTENSITY.c_str(), precipitationWriter->GetParameterFromIntensity().c_str()); + } + const auto kPrecipitationIntensity = precipitationWriter->GetPrecipitationIntensity(); + if (!( kPrecipitationIntensity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kPrecipitationIntensity).c_str()); + } + else if (precipitationWriter->IsPrecipitationIntensityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY.c_str(), precipitationWriter->GetParameterFromPrecipitationIntensity().c_str()); + } + const auto kPrecipitationType = precipitationWriter->GetPrecipitationType(); + if (precipitationWriter->IsPrecipitationTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE.c_str(), precipitationWriter->GetParameterFromPrecipitationType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE.c_str(), kPrecipitationType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPrivateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr privateWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = privateWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kPrivateActions = privateWriter->GetWriterPrivateActions(); + if (!kPrivateActions.empty()) + { + for (auto privateActionsWriterItem : kPrivateActions) + { + tinyxml2::XMLNode* privateActionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION.c_str()); + elementNode->InsertEndChild(privateActionsElement); + FillPrivateActionNode(document, privateActionsElement, privateActionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPrivateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr privateActionWriter) + { + // Add Attributes (Parameters) + const auto kLongitudinalAction = privateActionWriter->GetWriterLongitudinalAction(); + if (kLongitudinalAction) + { + tinyxml2::XMLNode* longitudinalActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION.c_str()); + elementNode->InsertEndChild(longitudinalActionElement); + FillLongitudinalActionNode(document, longitudinalActionElement, kLongitudinalAction); + } + const auto kLateralAction = privateActionWriter->GetWriterLateralAction(); + if (kLateralAction) + { + tinyxml2::XMLNode* lateralActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LATERAL_ACTION.c_str()); + elementNode->InsertEndChild(lateralActionElement); + FillLateralActionNode(document, lateralActionElement, kLateralAction); + } + const auto kVisibilityAction = privateActionWriter->GetWriterVisibilityAction(); + if (kVisibilityAction) + { + tinyxml2::XMLNode* visibilityActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION.c_str()); + elementNode->InsertEndChild(visibilityActionElement); + FillVisibilityActionNode(document, visibilityActionElement, kVisibilityAction); + } + const auto kSynchronizeAction = privateActionWriter->GetWriterSynchronizeAction(); + if (kSynchronizeAction) + { + tinyxml2::XMLNode* synchronizeActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION.c_str()); + elementNode->InsertEndChild(synchronizeActionElement); + FillSynchronizeActionNode(document, synchronizeActionElement, kSynchronizeAction); + } + const auto kActivateControllerAction = privateActionWriter->GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + tinyxml2::XMLNode* activateControllerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION.c_str()); + elementNode->InsertEndChild(activateControllerActionElement); + FillActivateControllerActionNode(document, activateControllerActionElement, kActivateControllerAction); + } + const auto kControllerAction = privateActionWriter->GetWriterControllerAction(); + if (kControllerAction) + { + tinyxml2::XMLNode* controllerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION.c_str()); + elementNode->InsertEndChild(controllerActionElement); + FillControllerActionNode(document, controllerActionElement, kControllerAction); + } + const auto kTeleportAction = privateActionWriter->GetWriterTeleportAction(); + if (kTeleportAction) + { + tinyxml2::XMLNode* teleportActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION.c_str()); + elementNode->InsertEndChild(teleportActionElement); + FillTeleportActionNode(document, teleportActionElement, kTeleportAction); + } + const auto kRoutingAction = privateActionWriter->GetWriterRoutingAction(); + if (kRoutingAction) + { + tinyxml2::XMLNode* routingActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTING_ACTION.c_str()); + elementNode->InsertEndChild(routingActionElement); + FillRoutingActionNode(document, routingActionElement, kRoutingAction); + } + const auto kAppearanceAction = privateActionWriter->GetWriterAppearanceAction(); + if (kAppearanceAction) + { + tinyxml2::XMLNode* appearanceActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION.c_str()); + elementNode->InsertEndChild(appearanceActionElement); + FillAppearanceActionNode(document, appearanceActionElement, kAppearanceAction); + } + const auto kTrailerAction = privateActionWriter->GetWriterTrailerAction(); + if (kTrailerAction) + { + tinyxml2::XMLNode* trailerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER_ACTION.c_str()); + elementNode->InsertEndChild(trailerActionElement); + FillTrailerActionNode(document, trailerActionElement, kTrailerAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillProbabilityDistributionSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr probabilityDistributionSetWriter) + { + // Add Attributes (Parameters) + const auto kElements = probabilityDistributionSetWriter->GetWriterElements(); + if (!kElements.empty()) + { + for (auto elementsWriterItem : kElements) + { + tinyxml2::XMLNode* elementsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ELEMENT.c_str()); + elementNode->InsertEndChild(elementsElement); + FillProbabilityDistributionSetElementNode(document, elementsElement, elementsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillProbabilityDistributionSetElementNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr probabilityDistributionSetElementWriter) + { + // Add Attributes (Parameters) + const auto kValue = probabilityDistributionSetElementWriter->GetValue(); + if (probabilityDistributionSetElementWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), probabilityDistributionSetElementWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + const auto kWeight = probabilityDistributionSetElementWriter->GetWeight(); + if (probabilityDistributionSetElementWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), probabilityDistributionSetElementWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPropertiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr propertiesWriter) + { + // Add Attributes (Parameters) + const auto kProperties = propertiesWriter->GetWriterProperties(); + if (!kProperties.empty()) + { + for (auto propertiesWriterItem : kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTY.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertyNode(document, propertiesElement, propertiesWriterItem); + + } + } + const auto kFiles = propertiesWriter->GetWriterFiles(); + if (!kFiles.empty()) + { + for (auto filesWriterItem : kFiles) + { + tinyxml2::XMLNode* filesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FILE.c_str()); + elementNode->InsertEndChild(filesElement); + FillFileNode(document, filesElement, filesWriterItem); + + } + } + const auto kCustomContent = propertiesWriter->GetWriterCustomContent(); + if (!kCustomContent.empty()) + { + for (auto customContentWriterItem : kCustomContent) + { + tinyxml2::XMLNode* customContentElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CUSTOM_CONTENT.c_str()); + elementNode->InsertEndChild(customContentElement); + FillCustomContentNode(document, customContentElement, customContentWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillPropertyNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr propertyWriter) + { + // Add Attributes (Parameters) + const auto kName = propertyWriter->GetName(); + if (propertyWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), propertyWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kValue = propertyWriter->GetValue(); + if (propertyWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), propertyWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRandomRouteActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr randomRouteActionWriter) + { + // Add Attributes (Parameters) + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr rangeWriter) + { + // Add Attributes (Parameters) + const auto kLowerLimit = rangeWriter->GetLowerLimit(); + if (rangeWriter->IsLowerLimitParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT.c_str(), rangeWriter->GetParameterFromLowerLimit().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLowerLimit).c_str()); + } + const auto kUpperLimit = rangeWriter->GetUpperLimit(); + if (rangeWriter->IsUpperLimitParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT.c_str(), rangeWriter->GetParameterFromUpperLimit().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kUpperLimit).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillReachPositionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr reachPositionConditionWriter) + { + // Add Attributes (Parameters) + const auto kTolerance = reachPositionConditionWriter->GetTolerance(); + if (reachPositionConditionWriter->IsToleranceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE.c_str(), reachPositionConditionWriter->GetParameterFromTolerance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTolerance).c_str()); + } + const auto kPosition = reachPositionConditionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeAngleConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeAngleConditionWriter) + { + // Add Attributes (Parameters) + const auto kAngle = relativeAngleConditionWriter->GetAngle(); + if (relativeAngleConditionWriter->IsAngleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE.c_str(), relativeAngleConditionWriter->GetParameterFromAngle().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAngle).c_str()); + } + const auto kAngleTolerance = relativeAngleConditionWriter->GetAngleTolerance(); + if (relativeAngleConditionWriter->IsAngleToleranceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE.c_str(), relativeAngleConditionWriter->GetParameterFromAngleTolerance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAngleTolerance).c_str()); + } + const auto kAngleType = relativeAngleConditionWriter->GetAngleType(); + if (relativeAngleConditionWriter->IsAngleTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE.c_str(), relativeAngleConditionWriter->GetParameterFromAngleType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE.c_str(), kAngleType.GetLiteral().c_str()); + } + const auto kCoordinateSystem = relativeAngleConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (relativeAngleConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), relativeAngleConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kEntityRef = relativeAngleConditionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeClearanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeClearanceConditionWriter) + { + // Add Attributes (Parameters) + const auto kDistanceBackward = relativeClearanceConditionWriter->GetDistanceBackward(); + if (!( kDistanceBackward == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDistanceBackward).c_str()); + } + else if (relativeClearanceConditionWriter->IsDistanceBackwardParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD.c_str(), relativeClearanceConditionWriter->GetParameterFromDistanceBackward().c_str()); + } + const auto kDistanceForward = relativeClearanceConditionWriter->GetDistanceForward(); + if (!( kDistanceForward == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDistanceForward).c_str()); + } + else if (relativeClearanceConditionWriter->IsDistanceForwardParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD.c_str(), relativeClearanceConditionWriter->GetParameterFromDistanceForward().c_str()); + } + const auto kFreeSpace = relativeClearanceConditionWriter->GetFreeSpace(); + if (relativeClearanceConditionWriter->IsFreeSpaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE.c_str(), relativeClearanceConditionWriter->GetParameterFromFreeSpace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreeSpace).c_str()); + } + const auto kOppositeLanes = relativeClearanceConditionWriter->GetOppositeLanes(); + if (relativeClearanceConditionWriter->IsOppositeLanesParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES.c_str(), relativeClearanceConditionWriter->GetParameterFromOppositeLanes().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kOppositeLanes).c_str()); + } + const auto kRelativeLaneRange = relativeClearanceConditionWriter->GetWriterRelativeLaneRange(); + if (!kRelativeLaneRange.empty()) + { + for (auto relativeLaneRangeWriterItem : kRelativeLaneRange) + { + tinyxml2::XMLNode* relativeLaneRangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_RANGE.c_str()); + elementNode->InsertEndChild(relativeLaneRangeElement); + FillRelativeLaneRangeNode(document, relativeLaneRangeElement, relativeLaneRangeWriterItem); + + } + } + const auto kEntityRef = relativeClearanceConditionWriter->GetWriterEntityRef(); + if (!kEntityRef.empty()) + { + for (auto entityRefWriterItem : kEntityRef) + { + tinyxml2::XMLNode* entityRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefElement); + FillEntityRefNode(document, entityRefElement, entityRefWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeDistanceConditionWriter) + { + // Add Attributes (Parameters) + const auto kCoordinateSystem = relativeDistanceConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (relativeDistanceConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), relativeDistanceConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kEntityRef = relativeDistanceConditionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kFreespace = relativeDistanceConditionWriter->GetFreespace(); + if (relativeDistanceConditionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), relativeDistanceConditionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kRelativeDistanceType = relativeDistanceConditionWriter->GetRelativeDistanceType(); + if (relativeDistanceConditionWriter->IsRelativeDistanceTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), relativeDistanceConditionWriter->GetParameterFromRelativeDistanceType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), kRelativeDistanceType.GetLiteral().c_str()); + } + const auto kRoutingAlgorithm = relativeDistanceConditionWriter->GetRoutingAlgorithm(); + if (!( kRoutingAlgorithm == RoutingAlgorithm::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), kRoutingAlgorithm.GetLiteral().c_str()); + } + else if (relativeDistanceConditionWriter->IsRoutingAlgorithmParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), relativeDistanceConditionWriter->GetParameterFromRoutingAlgorithm().c_str()); + } + const auto kRule = relativeDistanceConditionWriter->GetRule(); + if (relativeDistanceConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), relativeDistanceConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = relativeDistanceConditionWriter->GetValue(); + if (relativeDistanceConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeDistanceConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeLanePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeLanePositionWriter) + { + // Add Attributes (Parameters) + const auto kDLane = relativeLanePositionWriter->GetDLane(); + if (relativeLanePositionWriter->IsDLaneParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__D_LANE.c_str(), relativeLanePositionWriter->GetParameterFromDLane().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__D_LANE.c_str(), XmlExportHelper::ToXmlStringFromInt( kDLane).c_str()); + } + const auto kDs = relativeLanePositionWriter->GetDs(); + if (!( kDs == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDs).c_str()); + } + else if (relativeLanePositionWriter->IsDsParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS.c_str(), relativeLanePositionWriter->GetParameterFromDs().c_str()); + } + const auto kDsLane = relativeLanePositionWriter->GetDsLane(); + if (!( kDsLane == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS_LANE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDsLane).c_str()); + } + else if (relativeLanePositionWriter->IsDsLaneParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS_LANE.c_str(), relativeLanePositionWriter->GetParameterFromDsLane().c_str()); + } + const auto kEntityRef = relativeLanePositionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kOffset = relativeLanePositionWriter->GetOffset(); + if (!( kOffset == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kOffset).c_str()); + } + else if (relativeLanePositionWriter->IsOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), relativeLanePositionWriter->GetParameterFromOffset().c_str()); + } + const auto kOrientation = relativeLanePositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeLaneRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeLaneRangeWriter) + { + // Add Attributes (Parameters) + const auto kFrom = relativeLaneRangeWriter->GetFrom(); + if (!( kFrom == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FROM.c_str(), XmlExportHelper::ToXmlStringFromInt( kFrom).c_str()); + } + else if (relativeLaneRangeWriter->IsFromParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FROM.c_str(), relativeLaneRangeWriter->GetParameterFromFrom().c_str()); + } + const auto kTo = relativeLaneRangeWriter->GetTo(); + if (!( kTo == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TO.c_str(), XmlExportHelper::ToXmlStringFromInt( kTo).c_str()); + } + else if (relativeLaneRangeWriter->IsToParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TO.c_str(), relativeLaneRangeWriter->GetParameterFromTo().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeObjectPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeObjectPositionWriter) + { + // Add Attributes (Parameters) + const auto kDx = relativeObjectPositionWriter->GetDx(); + if (relativeObjectPositionWriter->IsDxParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), relativeObjectPositionWriter->GetParameterFromDx().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDx).c_str()); + } + const auto kDy = relativeObjectPositionWriter->GetDy(); + if (relativeObjectPositionWriter->IsDyParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DY.c_str(), relativeObjectPositionWriter->GetParameterFromDy().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDy).c_str()); + } + const auto kDz = relativeObjectPositionWriter->GetDz(); + if (!( kDz == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDz).c_str()); + } + else if (relativeObjectPositionWriter->IsDzParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), relativeObjectPositionWriter->GetParameterFromDz().c_str()); + } + const auto kEntityRef = relativeObjectPositionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kOrientation = relativeObjectPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeRoadPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeRoadPositionWriter) + { + // Add Attributes (Parameters) + const auto kDs = relativeRoadPositionWriter->GetDs(); + if (relativeRoadPositionWriter->IsDsParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS.c_str(), relativeRoadPositionWriter->GetParameterFromDs().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDs).c_str()); + } + const auto kDt = relativeRoadPositionWriter->GetDt(); + if (relativeRoadPositionWriter->IsDtParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DT.c_str(), relativeRoadPositionWriter->GetParameterFromDt().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDt).c_str()); + } + const auto kEntityRef = relativeRoadPositionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kOrientation = relativeRoadPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeSpeedConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeSpeedConditionWriter) + { + // Add Attributes (Parameters) + const auto kDirection = relativeSpeedConditionWriter->GetDirection(); + if (!( kDirection == DirectionalDimension::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), kDirection.GetLiteral().c_str()); + } + else if (relativeSpeedConditionWriter->IsDirectionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), relativeSpeedConditionWriter->GetParameterFromDirection().c_str()); + } + const auto kEntityRef = relativeSpeedConditionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kRule = relativeSpeedConditionWriter->GetRule(); + if (relativeSpeedConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), relativeSpeedConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = relativeSpeedConditionWriter->GetValue(); + if (relativeSpeedConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeSpeedConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeSpeedToMasterNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeSpeedToMasterWriter) + { + // Add Attributes (Parameters) + const auto kSpeedTargetValueType = relativeSpeedToMasterWriter->GetSpeedTargetValueType(); + if (relativeSpeedToMasterWriter->IsSpeedTargetValueTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE.c_str(), relativeSpeedToMasterWriter->GetParameterFromSpeedTargetValueType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE.c_str(), kSpeedTargetValueType.GetLiteral().c_str()); + } + const auto kValue = relativeSpeedToMasterWriter->GetValue(); + if (relativeSpeedToMasterWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeSpeedToMasterWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + const auto kSteadyState = relativeSpeedToMasterWriter->GetWriterSteadyState(); + if (kSteadyState) + { + FillSteadyStateNode(document, elementNode, kSteadyState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeTargetLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetLaneWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = relativeTargetLaneWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kValue = relativeTargetLaneWriter->GetValue(); + if (relativeTargetLaneWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeTargetLaneWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromInt( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeTargetLaneOffsetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetLaneOffsetWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = relativeTargetLaneOffsetWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kValue = relativeTargetLaneOffsetWriter->GetValue(); + if (relativeTargetLaneOffsetWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeTargetLaneOffsetWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeTargetSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetSpeedWriter) + { + // Add Attributes (Parameters) + const auto kContinuous = relativeTargetSpeedWriter->GetContinuous(); + if (relativeTargetSpeedWriter->IsContinuousParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), relativeTargetSpeedWriter->GetParameterFromContinuous().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kContinuous).c_str()); + } + const auto kEntityRef = relativeTargetSpeedWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kSpeedTargetValueType = relativeTargetSpeedWriter->GetSpeedTargetValueType(); + if (relativeTargetSpeedWriter->IsSpeedTargetValueTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE.c_str(), relativeTargetSpeedWriter->GetParameterFromSpeedTargetValueType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE.c_str(), kSpeedTargetValueType.GetLiteral().c_str()); + } + const auto kValue = relativeTargetSpeedWriter->GetValue(); + if (relativeTargetSpeedWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), relativeTargetSpeedWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRelativeWorldPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeWorldPositionWriter) + { + // Add Attributes (Parameters) + const auto kDx = relativeWorldPositionWriter->GetDx(); + if (relativeWorldPositionWriter->IsDxParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), relativeWorldPositionWriter->GetParameterFromDx().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDx).c_str()); + } + const auto kDy = relativeWorldPositionWriter->GetDy(); + if (relativeWorldPositionWriter->IsDyParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DY.c_str(), relativeWorldPositionWriter->GetParameterFromDy().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDy).c_str()); + } + const auto kDz = relativeWorldPositionWriter->GetDz(); + if (!( kDz == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDz).c_str()); + } + else if (relativeWorldPositionWriter->IsDzParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), relativeWorldPositionWriter->GetParameterFromDz().c_str()); + } + const auto kEntityRef = relativeWorldPositionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kOrientation = relativeWorldPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadConditionWriter) + { + // Add Attributes (Parameters) + const auto kFrictionScaleFactor = roadConditionWriter->GetFrictionScaleFactor(); + if (roadConditionWriter->IsFrictionScaleFactorParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR.c_str(), roadConditionWriter->GetParameterFromFrictionScaleFactor().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR.c_str(), XmlExportHelper::ToXmlStringFromDouble( kFrictionScaleFactor).c_str()); + } + const auto kWetness = roadConditionWriter->GetWetness(); + if (!( kWetness == Wetness::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WETNESS.c_str(), kWetness.GetLiteral().c_str()); + } + else if (roadConditionWriter->IsWetnessParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WETNESS.c_str(), roadConditionWriter->GetParameterFromWetness().c_str()); + } + const auto kProperties = roadConditionWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoadCursorNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadCursorWriter) + { + // Add Attributes (Parameters) + const auto kRoadId = roadCursorWriter->GetRoadId(); + if (roadCursorWriter->IsRoadIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), roadCursorWriter->GetParameterFromRoadId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kRoadId).c_str()); + } + const auto kS = roadCursorWriter->GetS(); + if (!( kS == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kS).c_str()); + } + else if (roadCursorWriter->IsSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), roadCursorWriter->GetParameterFromS().c_str()); + } + const auto kLane = roadCursorWriter->GetWriterLane(); + if (!kLane.empty()) + { + for (auto laneWriterItem : kLane) + { + tinyxml2::XMLNode* laneElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LANE.c_str()); + elementNode->InsertEndChild(laneElement); + FillLaneNode(document, laneElement, laneWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoadNetworkNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadNetworkWriter) + { + // Add Attributes (Parameters) + const auto kLogicFile = roadNetworkWriter->GetWriterLogicFile(); + if (kLogicFile) + { + tinyxml2::XMLNode* logicFileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LOGIC_FILE.c_str()); + elementNode->InsertEndChild(logicFileElement); + FillFileNode(document, logicFileElement, kLogicFile); + } + const auto kSceneGraphFile = roadNetworkWriter->GetWriterSceneGraphFile(); + if (kSceneGraphFile) + { + tinyxml2::XMLNode* sceneGraphFileElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SCENE_GRAPH_FILE.c_str()); + elementNode->InsertEndChild(sceneGraphFileElement); + FillFileNode(document, sceneGraphFileElement, kSceneGraphFile); + } + const auto kTrafficSignals = roadNetworkWriter->GetWriterTrafficSignals(); + if (!kTrafficSignals.empty()) + { + tinyxml2::XMLNode* trafficSignalsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER.c_str()); + elementNode->InsertEndChild(trafficSignalsWrapperElement); + for (auto trafficSignalsWriterItem : kTrafficSignals) + { + tinyxml2::XMLNode* trafficSignalsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNALS.c_str()); + trafficSignalsWrapperElement->InsertEndChild(trafficSignalsElement); + FillTrafficSignalControllerNode(document, trafficSignalsElement, trafficSignalsWriterItem); + } + } + const auto kUsedArea = roadNetworkWriter->GetWriterUsedArea(); + if (kUsedArea) + { + tinyxml2::XMLNode* usedAreaElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USED_AREA.c_str()); + elementNode->InsertEndChild(usedAreaElement); + FillUsedAreaNode(document, usedAreaElement, kUsedArea); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoadPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadPositionWriter) + { + // Add Attributes (Parameters) + const auto kRoadId = roadPositionWriter->GetRoadId(); + if (roadPositionWriter->IsRoadIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), roadPositionWriter->GetParameterFromRoadId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kRoadId).c_str()); + } + const auto kS = roadPositionWriter->GetS(); + if (roadPositionWriter->IsSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), roadPositionWriter->GetParameterFromS().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kS).c_str()); + } + const auto kT = roadPositionWriter->GetT(); + if (roadPositionWriter->IsTParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), roadPositionWriter->GetParameterFromT().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), XmlExportHelper::ToXmlStringFromDouble( kT).c_str()); + } + const auto kOrientation = roadPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoadRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadRangeWriter) + { + // Add Attributes (Parameters) + const auto kLength = roadRangeWriter->GetLength(); + if (!( kLength == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kLength).c_str()); + } + else if (roadRangeWriter->IsLengthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__LENGTH.c_str(), roadRangeWriter->GetParameterFromLength().c_str()); + } + const auto kRoadCursor = roadRangeWriter->GetWriterRoadCursor(); + if (!kRoadCursor.empty()) + { + for (auto roadCursorWriterItem : kRoadCursor) + { + tinyxml2::XMLNode* roadCursorElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROAD_CURSOR.c_str()); + elementNode->InsertEndChild(roadCursorElement); + FillRoadCursorNode(document, roadCursorElement, roadCursorWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRouteNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeWriter) + { + // Add Attributes (Parameters) + const auto kClosed = routeWriter->GetClosed(); + if (routeWriter->IsClosedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOSED.c_str(), routeWriter->GetParameterFromClosed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOSED.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kClosed).c_str()); + } + const auto kName = routeWriter->GetName(); + if (routeWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), routeWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = routeWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kWaypoints = routeWriter->GetWriterWaypoints(); + if (!kWaypoints.empty()) + { + for (auto waypointsWriterItem : kWaypoints) + { + tinyxml2::XMLNode* waypointsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__WAYPOINT.c_str()); + elementNode->InsertEndChild(waypointsElement); + FillWaypointNode(document, waypointsElement, waypointsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRouteCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = routeCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoutePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routePositionWriter) + { + // Add Attributes (Parameters) + const auto kRouteRef = routePositionWriter->GetWriterRouteRef(); + if (kRouteRef) + { + tinyxml2::XMLNode* routeRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE_REF.c_str()); + elementNode->InsertEndChild(routeRefElement); + FillRouteRefNode(document, routeRefElement, kRouteRef); + } + const auto kOrientation = routePositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + const auto kInRoutePosition = routePositionWriter->GetWriterInRoutePosition(); + if (kInRoutePosition) + { + tinyxml2::XMLNode* inRoutePositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__IN_ROUTE_POSITION.c_str()); + elementNode->InsertEndChild(inRoutePositionElement); + FillInRoutePositionNode(document, inRoutePositionElement, kInRoutePosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRouteRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeRefWriter) + { + // Add Attributes (Parameters) + const auto kRoute = routeRefWriter->GetWriterRoute(); + if (kRoute) + { + tinyxml2::XMLNode* routeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROUTE.c_str()); + elementNode->InsertEndChild(routeElement); + FillRouteNode(document, routeElement, kRoute); + } + const auto kCatalogReference = routeRefWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillRoutingActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routingActionWriter) + { + // Add Attributes (Parameters) + const auto kAssignRouteAction = routingActionWriter->GetWriterAssignRouteAction(); + if (kAssignRouteAction) + { + tinyxml2::XMLNode* assignRouteActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION.c_str()); + elementNode->InsertEndChild(assignRouteActionElement); + FillAssignRouteActionNode(document, assignRouteActionElement, kAssignRouteAction); + } + const auto kFollowTrajectoryAction = routingActionWriter->GetWriterFollowTrajectoryAction(); + if (kFollowTrajectoryAction) + { + tinyxml2::XMLNode* followTrajectoryActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION.c_str()); + elementNode->InsertEndChild(followTrajectoryActionElement); + FillFollowTrajectoryActionNode(document, followTrajectoryActionElement, kFollowTrajectoryAction); + } + const auto kAcquirePositionAction = routingActionWriter->GetWriterAcquirePositionAction(); + if (kAcquirePositionAction) + { + tinyxml2::XMLNode* acquirePositionActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION.c_str()); + elementNode->InsertEndChild(acquirePositionActionElement); + FillAcquirePositionActionNode(document, acquirePositionActionElement, kAcquirePositionAction); + } + const auto kRandomRouteAction = routingActionWriter->GetWriterRandomRouteAction(); + if (kRandomRouteAction) + { + tinyxml2::XMLNode* randomRouteActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION.c_str()); + elementNode->InsertEndChild(randomRouteActionElement); + FillRandomRouteActionNode(document, randomRouteActionElement, kRandomRouteAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillScenarioDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioDefinitionWriter) + { + // Add Attributes (Parameters) + const auto kParameterDeclarations = scenarioDefinitionWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kVariableDeclarations = scenarioDefinitionWriter->GetWriterVariableDeclarations(); + if (!kVariableDeclarations.empty()) + { + tinyxml2::XMLNode* variableDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATION.c_str()); + elementNode->InsertEndChild(variableDeclarationsWrapperElement); + for (auto variableDeclarationsWriterItem : kVariableDeclarations) + { + tinyxml2::XMLNode* variableDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS.c_str()); + variableDeclarationsWrapperElement->InsertEndChild(variableDeclarationsElement); + FillVariableDeclarationNode(document, variableDeclarationsElement, variableDeclarationsWriterItem); + } + } + const auto kMonitorDeclarations = scenarioDefinitionWriter->GetWriterMonitorDeclarations(); + if (!kMonitorDeclarations.empty()) + { + tinyxml2::XMLNode* monitorDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATION.c_str()); + elementNode->InsertEndChild(monitorDeclarationsWrapperElement); + for (auto monitorDeclarationsWriterItem : kMonitorDeclarations) + { + tinyxml2::XMLNode* monitorDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS.c_str()); + monitorDeclarationsWrapperElement->InsertEndChild(monitorDeclarationsElement); + FillMonitorDeclarationNode(document, monitorDeclarationsElement, monitorDeclarationsWriterItem); + } + } + const auto kCatalogLocations = scenarioDefinitionWriter->GetWriterCatalogLocations(); + if (kCatalogLocations) + { + tinyxml2::XMLNode* catalogLocationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS.c_str()); + elementNode->InsertEndChild(catalogLocationsElement); + FillCatalogLocationsNode(document, catalogLocationsElement, kCatalogLocations); + } + const auto kRoadNetwork = scenarioDefinitionWriter->GetWriterRoadNetwork(); + if (kRoadNetwork) + { + tinyxml2::XMLNode* roadNetworkElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROAD_NETWORK.c_str()); + elementNode->InsertEndChild(roadNetworkElement); + FillRoadNetworkNode(document, roadNetworkElement, kRoadNetwork); + } + const auto kEntities = scenarioDefinitionWriter->GetWriterEntities(); + if (kEntities) + { + tinyxml2::XMLNode* entitiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITIES.c_str()); + elementNode->InsertEndChild(entitiesElement); + FillEntitiesNode(document, entitiesElement, kEntities); + } + const auto kStoryboard = scenarioDefinitionWriter->GetWriterStoryboard(); + if (kStoryboard) + { + tinyxml2::XMLNode* storyboardElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STORYBOARD.c_str()); + elementNode->InsertEndChild(storyboardElement); + FillStoryboardNode(document, storyboardElement, kStoryboard); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillScenarioObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioObjectWriter) + { + // Add Attributes (Parameters) + const auto kName = scenarioObjectWriter->GetName(); + if (scenarioObjectWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), scenarioObjectWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kEntityObject = scenarioObjectWriter->GetWriterEntityObject(); + if (kEntityObject) + { + FillEntityObjectNode(document, elementNode, kEntityObject); + } + const auto kObjectController = scenarioObjectWriter->GetWriterObjectController(); + if (!kObjectController.empty()) + { + for (auto objectControllerWriterItem : kObjectController) + { + tinyxml2::XMLNode* objectControllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER.c_str()); + elementNode->InsertEndChild(objectControllerElement); + FillObjectControllerNode(document, objectControllerElement, objectControllerWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillScenarioObjectTemplateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioObjectTemplateWriter) + { + // Add Attributes (Parameters) + const auto kEntitiyObject = scenarioObjectTemplateWriter->GetWriterEntitiyObject(); + if (kEntitiyObject) + { + FillEntityObjectNode(document, elementNode, kEntitiyObject); + } + const auto kObjectController = scenarioObjectTemplateWriter->GetWriterObjectController(); + if (!kObjectController.empty()) + { + for (auto objectControllerWriterItem : kObjectController) + { + tinyxml2::XMLNode* objectControllerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER.c_str()); + elementNode->InsertEndChild(objectControllerElement); + FillObjectControllerNode(document, objectControllerElement, objectControllerWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSelectedEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr selectedEntitiesWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = selectedEntitiesWriter->GetWriterEntityRef(); + if (!kEntityRef.empty()) + { + for (auto entityRefWriterItem : kEntityRef) + { + tinyxml2::XMLNode* entityRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefElement); + FillEntityRefNode(document, entityRefElement, entityRefWriterItem); + + } + } + const auto kByType = selectedEntitiesWriter->GetWriterByType(); + if (!kByType.empty()) + { + for (auto byTypeWriterItem : kByType) + { + tinyxml2::XMLNode* byTypeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BY_TYPE.c_str()); + elementNode->InsertEndChild(byTypeElement); + FillByTypeNode(document, byTypeElement, byTypeWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSensorReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sensorReferenceWriter) + { + // Add Attributes (Parameters) + const auto kName = sensorReferenceWriter->GetName(); + if (sensorReferenceWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), sensorReferenceWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSensorReferenceSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sensorReferenceSetWriter) + { + // Add Attributes (Parameters) + const auto kSensorReferences = sensorReferenceSetWriter->GetWriterSensorReferences(); + if (!kSensorReferences.empty()) + { + for (auto sensorReferencesWriterItem : kSensorReferences) + { + tinyxml2::XMLNode* sensorReferencesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE.c_str()); + elementNode->InsertEndChild(sensorReferencesElement); + FillSensorReferenceNode(document, sensorReferencesElement, sensorReferencesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSetMonitorActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr setMonitorActionWriter) + { + // Add Attributes (Parameters) + const auto kMonitorRef = setMonitorActionWriter->GetMonitorRef(); + if (kMonitorRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kMonitorRef->GetNameRef()).c_str()); + } + const auto kValue = setMonitorActionWriter->GetValue(); + if (setMonitorActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), setMonitorActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillShapeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr shapeWriter) + { + // Add Attributes (Parameters) + const auto kPolyline = shapeWriter->GetWriterPolyline(); + if (kPolyline) + { + tinyxml2::XMLNode* polylineElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POLYLINE.c_str()); + elementNode->InsertEndChild(polylineElement); + FillPolylineNode(document, polylineElement, kPolyline); + } + const auto kClothoid = shapeWriter->GetWriterClothoid(); + if (kClothoid) + { + tinyxml2::XMLNode* clothoidElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CLOTHOID.c_str()); + elementNode->InsertEndChild(clothoidElement); + FillClothoidNode(document, clothoidElement, kClothoid); + } + const auto kClothoidSpline = shapeWriter->GetWriterClothoidSpline(); + if (kClothoidSpline) + { + tinyxml2::XMLNode* clothoidSplineElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE.c_str()); + elementNode->InsertEndChild(clothoidSplineElement); + FillClothoidSplineNode(document, clothoidSplineElement, kClothoidSpline); + } + const auto kNurbs = shapeWriter->GetWriterNurbs(); + if (kNurbs) + { + tinyxml2::XMLNode* nurbsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__NURBS.c_str()); + elementNode->InsertEndChild(nurbsElement); + FillNurbsNode(document, nurbsElement, kNurbs); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSimulationTimeConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr simulationTimeConditionWriter) + { + // Add Attributes (Parameters) + const auto kRule = simulationTimeConditionWriter->GetRule(); + if (simulationTimeConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), simulationTimeConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = simulationTimeConditionWriter->GetValue(); + if (simulationTimeConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), simulationTimeConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSpeedActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedActionWriter) + { + // Add Attributes (Parameters) + const auto kSpeedActionDynamics = speedActionWriter->GetWriterSpeedActionDynamics(); + if (kSpeedActionDynamics) + { + tinyxml2::XMLNode* speedActionDynamicsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_ACTION_DYNAMICS.c_str()); + elementNode->InsertEndChild(speedActionDynamicsElement); + FillTransitionDynamicsNode(document, speedActionDynamicsElement, kSpeedActionDynamics); + } + const auto kSpeedActionTarget = speedActionWriter->GetWriterSpeedActionTarget(); + if (kSpeedActionTarget) + { + tinyxml2::XMLNode* speedActionTargetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_ACTION_TARGET.c_str()); + elementNode->InsertEndChild(speedActionTargetElement); + FillSpeedActionTargetNode(document, speedActionTargetElement, kSpeedActionTarget); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSpeedActionTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedActionTargetWriter) + { + // Add Attributes (Parameters) + const auto kRelativeTargetSpeed = speedActionTargetWriter->GetWriterRelativeTargetSpeed(); + if (kRelativeTargetSpeed) + { + tinyxml2::XMLNode* relativeTargetSpeedElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED.c_str()); + elementNode->InsertEndChild(relativeTargetSpeedElement); + FillRelativeTargetSpeedNode(document, relativeTargetSpeedElement, kRelativeTargetSpeed); + } + const auto kAbsoluteTargetSpeed = speedActionTargetWriter->GetWriterAbsoluteTargetSpeed(); + if (kAbsoluteTargetSpeed) + { + tinyxml2::XMLNode* absoluteTargetSpeedElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED.c_str()); + elementNode->InsertEndChild(absoluteTargetSpeedElement); + FillAbsoluteTargetSpeedNode(document, absoluteTargetSpeedElement, kAbsoluteTargetSpeed); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSpeedConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedConditionWriter) + { + // Add Attributes (Parameters) + const auto kDirection = speedConditionWriter->GetDirection(); + if (!( kDirection == DirectionalDimension::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), kDirection.GetLiteral().c_str()); + } + else if (speedConditionWriter->IsDirectionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), speedConditionWriter->GetParameterFromDirection().c_str()); + } + const auto kRule = speedConditionWriter->GetRule(); + if (speedConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), speedConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = speedConditionWriter->GetValue(); + if (speedConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), speedConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSpeedProfileActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedProfileActionWriter) + { + // Add Attributes (Parameters) + const auto kEntityRef = speedProfileActionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kFollowingMode = speedProfileActionWriter->GetFollowingMode(); + if (speedProfileActionWriter->IsFollowingModeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), speedProfileActionWriter->GetParameterFromFollowingMode().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), kFollowingMode.GetLiteral().c_str()); + } + const auto kDynamicConstraints = speedProfileActionWriter->GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + tinyxml2::XMLNode* dynamicConstraintsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS.c_str()); + elementNode->InsertEndChild(dynamicConstraintsElement); + FillDynamicConstraintsNode(document, dynamicConstraintsElement, kDynamicConstraints); + } + const auto kSpeedProfileEntry = speedProfileActionWriter->GetWriterSpeedProfileEntry(); + if (!kSpeedProfileEntry.empty()) + { + for (auto speedProfileEntryWriterItem : kSpeedProfileEntry) + { + tinyxml2::XMLNode* speedProfileEntryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ENTRY.c_str()); + elementNode->InsertEndChild(speedProfileEntryElement); + FillSpeedProfileEntryNode(document, speedProfileEntryElement, speedProfileEntryWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSpeedProfileEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedProfileEntryWriter) + { + // Add Attributes (Parameters) + const auto kSpeed = speedProfileEntryWriter->GetSpeed(); + if (speedProfileEntryWriter->IsSpeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), speedProfileEntryWriter->GetParameterFromSpeed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSpeed).c_str()); + } + const auto kTime = speedProfileEntryWriter->GetTime(); + if (!( kTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTime).c_str()); + } + else if (speedProfileEntryWriter->IsTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), speedProfileEntryWriter->GetParameterFromTime().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStandStillConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr standStillConditionWriter) + { + // Add Attributes (Parameters) + const auto kDuration = standStillConditionWriter->GetDuration(); + if (standStillConditionWriter->IsDurationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), standStillConditionWriter->GetParameterFromDuration().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DURATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDuration).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr steadyStateWriter) + { + // Add Attributes (Parameters) + const auto kTargetDistanceSteadyState = steadyStateWriter->GetWriterTargetDistanceSteadyState(); + if (kTargetDistanceSteadyState) + { + tinyxml2::XMLNode* targetDistanceSteadyStateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE.c_str()); + elementNode->InsertEndChild(targetDistanceSteadyStateElement); + FillTargetDistanceSteadyStateNode(document, targetDistanceSteadyStateElement, kTargetDistanceSteadyState); + } + const auto kTargetTimeSteadyState = steadyStateWriter->GetWriterTargetTimeSteadyState(); + if (kTargetTimeSteadyState) + { + tinyxml2::XMLNode* targetTimeSteadyStateElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE.c_str()); + elementNode->InsertEndChild(targetTimeSteadyStateElement); + FillTargetTimeSteadyStateNode(document, targetTimeSteadyStateElement, kTargetTimeSteadyState); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStochasticNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticWriter) + { + // Add Attributes (Parameters) + const auto kNumberOfTestRuns = stochasticWriter->GetNumberOfTestRuns(); + if (stochasticWriter->IsNumberOfTestRunsParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS.c_str(), stochasticWriter->GetParameterFromNumberOfTestRuns().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kNumberOfTestRuns).c_str()); + } + const auto kRandomSeed = stochasticWriter->GetRandomSeed(); + if (!( kRandomSeed == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRandomSeed).c_str()); + } + else if (stochasticWriter->IsRandomSeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED.c_str(), stochasticWriter->GetParameterFromRandomSeed().c_str()); + } + const auto kStochasticDistributions = stochasticWriter->GetWriterStochasticDistributions(); + if (!kStochasticDistributions.empty()) + { + for (auto stochasticDistributionsWriterItem : kStochasticDistributions) + { + tinyxml2::XMLNode* stochasticDistributionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(stochasticDistributionsElement); + FillStochasticDistributionNode(document, stochasticDistributionsElement, stochasticDistributionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStochasticDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticDistributionWriter) + { + // Add Attributes (Parameters) + const auto kParameterName = stochasticDistributionWriter->GetParameterName(); + if (stochasticDistributionWriter->IsParameterNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME.c_str(), stochasticDistributionWriter->GetParameterFromParameterName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kParameterName).c_str()); + } + const auto kStochasticDistributionType = stochasticDistributionWriter->GetWriterStochasticDistributionType(); + if (kStochasticDistributionType) + { + FillStochasticDistributionTypeNode(document, elementNode, kStochasticDistributionType); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStochasticDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticDistributionTypeWriter) + { + // Add Attributes (Parameters) + const auto kProbabilityDistributionSet = stochasticDistributionTypeWriter->GetWriterProbabilityDistributionSet(); + if (kProbabilityDistributionSet) + { + tinyxml2::XMLNode* probabilityDistributionSetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET.c_str()); + elementNode->InsertEndChild(probabilityDistributionSetElement); + FillProbabilityDistributionSetNode(document, probabilityDistributionSetElement, kProbabilityDistributionSet); + } + const auto kNormalDistribution = stochasticDistributionTypeWriter->GetWriterNormalDistribution(); + if (kNormalDistribution) + { + tinyxml2::XMLNode* normalDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(normalDistributionElement); + FillNormalDistributionNode(document, normalDistributionElement, kNormalDistribution); + } + const auto kLogNormalDistribution = stochasticDistributionTypeWriter->GetWriterLogNormalDistribution(); + if (kLogNormalDistribution) + { + tinyxml2::XMLNode* logNormalDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(logNormalDistributionElement); + FillLogNormalDistributionNode(document, logNormalDistributionElement, kLogNormalDistribution); + } + const auto kUniformDistribution = stochasticDistributionTypeWriter->GetWriterUniformDistribution(); + if (kUniformDistribution) + { + tinyxml2::XMLNode* uniformDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(uniformDistributionElement); + FillUniformDistributionNode(document, uniformDistributionElement, kUniformDistribution); + } + const auto kPoissonDistribution = stochasticDistributionTypeWriter->GetWriterPoissonDistribution(); + if (kPoissonDistribution) + { + tinyxml2::XMLNode* poissonDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(poissonDistributionElement); + FillPoissonDistributionNode(document, poissonDistributionElement, kPoissonDistribution); + } + const auto kHistogram = stochasticDistributionTypeWriter->GetWriterHistogram(); + if (kHistogram) + { + tinyxml2::XMLNode* histogramElement = document->NewElement(OSC_CONSTANTS::ELEMENT__HISTOGRAM.c_str()); + elementNode->InsertEndChild(histogramElement); + FillHistogramNode(document, histogramElement, kHistogram); + } + const auto kUserDefinedDistribution = stochasticDistributionTypeWriter->GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + tinyxml2::XMLNode* userDefinedDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(userDefinedDistributionElement); + FillUserDefinedDistributionNode(document, userDefinedDistributionElement, kUserDefinedDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyWriter) + { + // Add Attributes (Parameters) + const auto kName = storyWriter->GetName(); + if (storyWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), storyWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = storyWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kActs = storyWriter->GetWriterActs(); + if (!kActs.empty()) + { + for (auto actsWriterItem : kActs) + { + tinyxml2::XMLNode* actsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ACT.c_str()); + elementNode->InsertEndChild(actsElement); + FillActNode(document, actsElement, actsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStoryboardNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyboardWriter) + { + // Add Attributes (Parameters) + const auto kInit = storyboardWriter->GetWriterInit(); + if (kInit) + { + tinyxml2::XMLNode* initElement = document->NewElement(OSC_CONSTANTS::ELEMENT__INIT.c_str()); + elementNode->InsertEndChild(initElement); + FillInitNode(document, initElement, kInit); + } + const auto kStories = storyboardWriter->GetWriterStories(); + if (!kStories.empty()) + { + for (auto storiesWriterItem : kStories) + { + tinyxml2::XMLNode* storiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STORY.c_str()); + elementNode->InsertEndChild(storiesElement); + FillStoryNode(document, storiesElement, storiesWriterItem); + + } + } + const auto kStopTrigger = storyboardWriter->GetWriterStopTrigger(); + if (kStopTrigger) + { + tinyxml2::XMLNode* stopTriggerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__STOP_TRIGGER.c_str()); + elementNode->InsertEndChild(stopTriggerElement); + FillTriggerNode(document, stopTriggerElement, kStopTrigger); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillStoryboardElementStateConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyboardElementStateConditionWriter) + { + // Add Attributes (Parameters) + const auto kState = storyboardElementStateConditionWriter->GetState(); + if (storyboardElementStateConditionWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), storyboardElementStateConditionWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), kState.GetLiteral().c_str()); + } + const auto kStoryboardElementRef = storyboardElementStateConditionWriter->GetStoryboardElementRef(); + if (kStoryboardElementRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kStoryboardElementRef->GetNameRef()).c_str()); + } + const auto kStoryboardElementType = storyboardElementStateConditionWriter->GetStoryboardElementType(); + if (storyboardElementStateConditionWriter->IsStoryboardElementTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE.c_str(), storyboardElementStateConditionWriter->GetParameterFromStoryboardElementType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE.c_str(), kStoryboardElementType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSunNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sunWriter) + { + // Add Attributes (Parameters) + const auto kAzimuth = sunWriter->GetAzimuth(); + if (sunWriter->IsAzimuthParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH.c_str(), sunWriter->GetParameterFromAzimuth().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAzimuth).c_str()); + } + const auto kElevation = sunWriter->GetElevation(); + if (sunWriter->IsElevationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ELEVATION.c_str(), sunWriter->GetParameterFromElevation().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ELEVATION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kElevation).c_str()); + } + const auto kIlluminance = sunWriter->GetIlluminance(); + if (!( kIlluminance == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kIlluminance).c_str()); + } + else if (sunWriter->IsIlluminanceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE.c_str(), sunWriter->GetParameterFromIlluminance().c_str()); + } + const auto kIntensity = sunWriter->GetIntensity(); + if (!( kIntensity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INTENSITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kIntensity).c_str()); + } + else if (sunWriter->IsIntensityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INTENSITY.c_str(), sunWriter->GetParameterFromIntensity().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillSynchronizeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr synchronizeActionWriter) + { + // Add Attributes (Parameters) + const auto kMasterEntityRef = synchronizeActionWriter->GetMasterEntityRef(); + if (kMasterEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kMasterEntityRef->GetNameRef()).c_str()); + } + const auto kTargetTolerance = synchronizeActionWriter->GetTargetTolerance(); + if (!( kTargetTolerance == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTargetTolerance).c_str()); + } + else if (synchronizeActionWriter->IsTargetToleranceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE.c_str(), synchronizeActionWriter->GetParameterFromTargetTolerance().c_str()); + } + const auto kTargetToleranceMaster = synchronizeActionWriter->GetTargetToleranceMaster(); + if (!( kTargetToleranceMaster == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTargetToleranceMaster).c_str()); + } + else if (synchronizeActionWriter->IsTargetToleranceMasterParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER.c_str(), synchronizeActionWriter->GetParameterFromTargetToleranceMaster().c_str()); + } + const auto kTargetPositionMaster = synchronizeActionWriter->GetWriterTargetPositionMaster(); + if (kTargetPositionMaster) + { + tinyxml2::XMLNode* targetPositionMasterElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TARGET_POSITION_MASTER.c_str()); + elementNode->InsertEndChild(targetPositionMasterElement); + FillPositionNode(document, targetPositionMasterElement, kTargetPositionMaster); + } + const auto kTargetPosition = synchronizeActionWriter->GetWriterTargetPosition(); + if (kTargetPosition) + { + tinyxml2::XMLNode* targetPositionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TARGET_POSITION.c_str()); + elementNode->InsertEndChild(targetPositionElement); + FillPositionNode(document, targetPositionElement, kTargetPosition); + } + const auto kFinalSpeed = synchronizeActionWriter->GetWriterFinalSpeed(); + if (kFinalSpeed) + { + tinyxml2::XMLNode* finalSpeedElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FINAL_SPEED.c_str()); + elementNode->InsertEndChild(finalSpeedElement); + FillFinalSpeedNode(document, finalSpeedElement, kFinalSpeed); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTargetDistanceSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr targetDistanceSteadyStateWriter) + { + // Add Attributes (Parameters) + const auto kDistance = targetDistanceSteadyStateWriter->GetDistance(); + if (targetDistanceSteadyStateWriter->IsDistanceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), targetDistanceSteadyStateWriter->GetParameterFromDistance().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DISTANCE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDistance).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTargetTimeSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr targetTimeSteadyStateWriter) + { + // Add Attributes (Parameters) + const auto kTime = targetTimeSteadyStateWriter->GetTime(); + if (targetTimeSteadyStateWriter->IsTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), targetTimeSteadyStateWriter->GetParameterFromTime().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTime).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTeleportActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr teleportActionWriter) + { + // Add Attributes (Parameters) + const auto kPosition = teleportActionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeHeadwayConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeHeadwayConditionWriter) + { + // Add Attributes (Parameters) + const auto kAlongRoute = timeHeadwayConditionWriter->GetAlongRoute(); + if (!( kAlongRoute == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kAlongRoute).c_str()); + } + else if (timeHeadwayConditionWriter->IsAlongRouteParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), timeHeadwayConditionWriter->GetParameterFromAlongRoute().c_str()); + } + const auto kCoordinateSystem = timeHeadwayConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (timeHeadwayConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), timeHeadwayConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kEntityRef = timeHeadwayConditionWriter->GetEntityRef(); + if (kEntityRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kEntityRef->GetNameRef()).c_str()); + } + const auto kFreespace = timeHeadwayConditionWriter->GetFreespace(); + if (timeHeadwayConditionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), timeHeadwayConditionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kRelativeDistanceType = timeHeadwayConditionWriter->GetRelativeDistanceType(); + if (!( kRelativeDistanceType == RelativeDistanceType::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), kRelativeDistanceType.GetLiteral().c_str()); + } + else if (timeHeadwayConditionWriter->IsRelativeDistanceTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), timeHeadwayConditionWriter->GetParameterFromRelativeDistanceType().c_str()); + } + const auto kRoutingAlgorithm = timeHeadwayConditionWriter->GetRoutingAlgorithm(); + if (!( kRoutingAlgorithm == RoutingAlgorithm::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), kRoutingAlgorithm.GetLiteral().c_str()); + } + else if (timeHeadwayConditionWriter->IsRoutingAlgorithmParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), timeHeadwayConditionWriter->GetParameterFromRoutingAlgorithm().c_str()); + } + const auto kRule = timeHeadwayConditionWriter->GetRule(); + if (timeHeadwayConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), timeHeadwayConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = timeHeadwayConditionWriter->GetValue(); + if (timeHeadwayConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), timeHeadwayConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeOfDayNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeOfDayWriter) + { + // Add Attributes (Parameters) + const auto kAnimation = timeOfDayWriter->GetAnimation(); + if (timeOfDayWriter->IsAnimationParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION.c_str(), timeOfDayWriter->GetParameterFromAnimation().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ANIMATION.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kAnimation).c_str()); + } + const auto kDateTime = timeOfDayWriter->GetDateTime(); + if (timeOfDayWriter->IsDateTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME.c_str(), timeOfDayWriter->GetParameterFromDateTime().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME.c_str(), XmlExportHelper::ToXmlStringFromDateTime( kDateTime).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeOfDayConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeOfDayConditionWriter) + { + // Add Attributes (Parameters) + const auto kDateTime = timeOfDayConditionWriter->GetDateTime(); + if (timeOfDayConditionWriter->IsDateTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME.c_str(), timeOfDayConditionWriter->GetParameterFromDateTime().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME.c_str(), XmlExportHelper::ToXmlStringFromDateTime( kDateTime).c_str()); + } + const auto kRule = timeOfDayConditionWriter->GetRule(); + if (timeOfDayConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), timeOfDayConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeReferenceWriter) + { + // Add Attributes (Parameters) + const auto kNone = timeReferenceWriter->GetWriterNone(); + if (kNone) + { + tinyxml2::XMLNode* noneElement = document->NewElement(OSC_CONSTANTS::ELEMENT__NONE.c_str()); + elementNode->InsertEndChild(noneElement); + FillNoneNode(document, noneElement, kNone); + } + const auto kTiming = timeReferenceWriter->GetWriterTiming(); + if (kTiming) + { + tinyxml2::XMLNode* timingElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIMING.c_str()); + elementNode->InsertEndChild(timingElement); + FillTimingNode(document, timingElement, kTiming); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeToCollisionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeToCollisionConditionWriter) + { + // Add Attributes (Parameters) + const auto kAlongRoute = timeToCollisionConditionWriter->GetAlongRoute(); + if (!( kAlongRoute == false)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kAlongRoute).c_str()); + } + else if (timeToCollisionConditionWriter->IsAlongRouteParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE.c_str(), timeToCollisionConditionWriter->GetParameterFromAlongRoute().c_str()); + } + const auto kCoordinateSystem = timeToCollisionConditionWriter->GetCoordinateSystem(); + if (!( kCoordinateSystem == CoordinateSystem::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), kCoordinateSystem.GetLiteral().c_str()); + } + else if (timeToCollisionConditionWriter->IsCoordinateSystemParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM.c_str(), timeToCollisionConditionWriter->GetParameterFromCoordinateSystem().c_str()); + } + const auto kFreespace = timeToCollisionConditionWriter->GetFreespace(); + if (timeToCollisionConditionWriter->IsFreespaceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), timeToCollisionConditionWriter->GetParameterFromFreespace().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FREESPACE.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kFreespace).c_str()); + } + const auto kRelativeDistanceType = timeToCollisionConditionWriter->GetRelativeDistanceType(); + if (!( kRelativeDistanceType == RelativeDistanceType::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), kRelativeDistanceType.GetLiteral().c_str()); + } + else if (timeToCollisionConditionWriter->IsRelativeDistanceTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE.c_str(), timeToCollisionConditionWriter->GetParameterFromRelativeDistanceType().c_str()); + } + const auto kRoutingAlgorithm = timeToCollisionConditionWriter->GetRoutingAlgorithm(); + if (!( kRoutingAlgorithm == RoutingAlgorithm::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), kRoutingAlgorithm.GetLiteral().c_str()); + } + else if (timeToCollisionConditionWriter->IsRoutingAlgorithmParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM.c_str(), timeToCollisionConditionWriter->GetParameterFromRoutingAlgorithm().c_str()); + } + const auto kRule = timeToCollisionConditionWriter->GetRule(); + if (timeToCollisionConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), timeToCollisionConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = timeToCollisionConditionWriter->GetValue(); + if (timeToCollisionConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), timeToCollisionConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + const auto kTimeToCollisionConditionTarget = timeToCollisionConditionWriter->GetWriterTimeToCollisionConditionTarget(); + if (kTimeToCollisionConditionTarget) + { + tinyxml2::XMLNode* timeToCollisionConditionTargetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET.c_str()); + elementNode->InsertEndChild(timeToCollisionConditionTargetElement); + FillTimeToCollisionConditionTargetNode(document, timeToCollisionConditionTargetElement, kTimeToCollisionConditionTarget); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimeToCollisionConditionTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeToCollisionConditionTargetWriter) + { + // Add Attributes (Parameters) + const auto kPosition = timeToCollisionConditionTargetWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + const auto kEntityRef = timeToCollisionConditionTargetWriter->GetWriterEntityRef(); + if (kEntityRef) + { + tinyxml2::XMLNode* entityRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefElement); + FillEntityRefNode(document, entityRefElement, kEntityRef); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTimingNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timingWriter) + { + // Add Attributes (Parameters) + const auto kDomainAbsoluteRelative = timingWriter->GetDomainAbsoluteRelative(); + if (timingWriter->IsDomainAbsoluteRelativeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE.c_str(), timingWriter->GetParameterFromDomainAbsoluteRelative().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE.c_str(), kDomainAbsoluteRelative.GetLiteral().c_str()); + } + const auto kOffset = timingWriter->GetOffset(); + if (timingWriter->IsOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), timingWriter->GetParameterFromOffset().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kOffset).c_str()); + } + const auto kScale = timingWriter->GetScale(); + if (timingWriter->IsScaleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SCALE.c_str(), timingWriter->GetParameterFromScale().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SCALE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kScale).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficActionWriter) + { + // Add Attributes (Parameters) + const auto kTrafficName = trafficActionWriter->GetTrafficName(); + if (!( kTrafficName.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kTrafficName).c_str()); + } + else if (trafficActionWriter->IsTrafficNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME.c_str(), trafficActionWriter->GetParameterFromTrafficName().c_str()); + } + const auto kTrafficSourceAction = trafficActionWriter->GetWriterTrafficSourceAction(); + if (kTrafficSourceAction) + { + tinyxml2::XMLNode* trafficSourceActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION.c_str()); + elementNode->InsertEndChild(trafficSourceActionElement); + FillTrafficSourceActionNode(document, trafficSourceActionElement, kTrafficSourceAction); + } + const auto kTrafficSinkAction = trafficActionWriter->GetWriterTrafficSinkAction(); + if (kTrafficSinkAction) + { + tinyxml2::XMLNode* trafficSinkActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION.c_str()); + elementNode->InsertEndChild(trafficSinkActionElement); + FillTrafficSinkActionNode(document, trafficSinkActionElement, kTrafficSinkAction); + } + const auto kTrafficSwarmAction = trafficActionWriter->GetWriterTrafficSwarmAction(); + if (kTrafficSwarmAction) + { + tinyxml2::XMLNode* trafficSwarmActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION.c_str()); + elementNode->InsertEndChild(trafficSwarmActionElement); + FillTrafficSwarmActionNode(document, trafficSwarmActionElement, kTrafficSwarmAction); + } + const auto kTrafficAreaAction = trafficActionWriter->GetWriterTrafficAreaAction(); + if (kTrafficAreaAction) + { + tinyxml2::XMLNode* trafficAreaActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION.c_str()); + elementNode->InsertEndChild(trafficAreaActionElement); + FillTrafficAreaActionNode(document, trafficAreaActionElement, kTrafficAreaAction); + } + const auto kTrafficStopAction = trafficActionWriter->GetWriterTrafficStopAction(); + if (kTrafficStopAction) + { + tinyxml2::XMLNode* trafficStopActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION.c_str()); + elementNode->InsertEndChild(trafficStopActionElement); + FillTrafficStopActionNode(document, trafficStopActionElement, kTrafficStopAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficAreaNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficAreaWriter) + { + // Add Attributes (Parameters) + const auto kPolygon = trafficAreaWriter->GetWriterPolygon(); + if (kPolygon) + { + tinyxml2::XMLNode* polygonElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POLYGON.c_str()); + elementNode->InsertEndChild(polygonElement); + FillPolygonNode(document, polygonElement, kPolygon); + } + const auto kRoadRange = trafficAreaWriter->GetWriterRoadRange(); + if (!kRoadRange.empty()) + { + for (auto roadRangeWriterItem : kRoadRange) + { + tinyxml2::XMLNode* roadRangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ROAD_RANGE.c_str()); + elementNode->InsertEndChild(roadRangeElement); + FillRoadRangeNode(document, roadRangeElement, roadRangeWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficAreaActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficAreaActionWriter) + { + // Add Attributes (Parameters) + const auto kContinuous = trafficAreaActionWriter->GetContinuous(); + if (trafficAreaActionWriter->IsContinuousParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), trafficAreaActionWriter->GetParameterFromContinuous().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kContinuous).c_str()); + } + const auto kNumberOfEntities = trafficAreaActionWriter->GetNumberOfEntities(); + if (trafficAreaActionWriter->IsNumberOfEntitiesParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES.c_str(), trafficAreaActionWriter->GetParameterFromNumberOfEntities().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kNumberOfEntities).c_str()); + } + const auto kTrafficDistribution = trafficAreaActionWriter->GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + tinyxml2::XMLNode* trafficDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(trafficDistributionElement); + FillTrafficDistributionNode(document, trafficDistributionElement, kTrafficDistribution); + } + const auto kTrafficArea = trafficAreaActionWriter->GetWriterTrafficArea(); + if (kTrafficArea) + { + tinyxml2::XMLNode* trafficAreaElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA.c_str()); + elementNode->InsertEndChild(trafficAreaElement); + FillTrafficAreaNode(document, trafficAreaElement, kTrafficArea); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDefinitionWriter) + { + // Add Attributes (Parameters) + const auto kName = trafficDefinitionWriter->GetName(); + if (trafficDefinitionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), trafficDefinitionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kVehicleCategoryDistribution = trafficDefinitionWriter->GetWriterVehicleCategoryDistribution(); + if (kVehicleCategoryDistribution) + { + tinyxml2::XMLNode* vehicleCategoryDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(vehicleCategoryDistributionElement); + FillVehicleCategoryDistributionNode(document, vehicleCategoryDistributionElement, kVehicleCategoryDistribution); + } + const auto kVehicleRoleDistribution = trafficDefinitionWriter->GetWriterVehicleRoleDistribution(); + if (kVehicleRoleDistribution) + { + tinyxml2::XMLNode* vehicleRoleDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(vehicleRoleDistributionElement); + FillVehicleRoleDistributionNode(document, vehicleRoleDistributionElement, kVehicleRoleDistribution); + } + const auto kControllerDistribution = trafficDefinitionWriter->GetWriterControllerDistribution(); + if (kControllerDistribution) + { + tinyxml2::XMLNode* controllerDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(controllerDistributionElement); + FillControllerDistributionNode(document, controllerDistributionElement, kControllerDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDistributionWriter) + { + // Add Attributes (Parameters) + const auto kTrafficDistributionEntry = trafficDistributionWriter->GetWriterTrafficDistributionEntry(); + if (!kTrafficDistributionEntry.empty()) + { + for (auto trafficDistributionEntryWriterItem : kTrafficDistributionEntry) + { + tinyxml2::XMLNode* trafficDistributionEntryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY.c_str()); + elementNode->InsertEndChild(trafficDistributionEntryElement); + FillTrafficDistributionEntryNode(document, trafficDistributionEntryElement, trafficDistributionEntryWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDistributionEntryWriter) + { + // Add Attributes (Parameters) + const auto kWeight = trafficDistributionEntryWriter->GetWeight(); + if (trafficDistributionEntryWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), trafficDistributionEntryWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + const auto kEntityDistribution = trafficDistributionEntryWriter->GetWriterEntityDistribution(); + if (kEntityDistribution) + { + tinyxml2::XMLNode* entityDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(entityDistributionElement); + FillEntityDistributionNode(document, entityDistributionElement, kEntityDistribution); + } + const auto kProperties = trafficDistributionEntryWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalActionWriter) + { + // Add Attributes (Parameters) + const auto kTrafficSignalControllerAction = trafficSignalActionWriter->GetWriterTrafficSignalControllerAction(); + if (kTrafficSignalControllerAction) + { + tinyxml2::XMLNode* trafficSignalControllerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION.c_str()); + elementNode->InsertEndChild(trafficSignalControllerActionElement); + FillTrafficSignalControllerActionNode(document, trafficSignalControllerActionElement, kTrafficSignalControllerAction); + } + const auto kTrafficSignalStateAction = trafficSignalActionWriter->GetWriterTrafficSignalStateAction(); + if (kTrafficSignalStateAction) + { + tinyxml2::XMLNode* trafficSignalStateActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION.c_str()); + elementNode->InsertEndChild(trafficSignalStateActionElement); + FillTrafficSignalStateActionNode(document, trafficSignalStateActionElement, kTrafficSignalStateAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalConditionWriter) + { + // Add Attributes (Parameters) + const auto kName = trafficSignalConditionWriter->GetName(); + if (trafficSignalConditionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), trafficSignalConditionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kState = trafficSignalConditionWriter->GetState(); + if (trafficSignalConditionWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), trafficSignalConditionWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), XmlExportHelper::ToXmlStringFromString( kState).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerWriter) + { + // Add Attributes (Parameters) + const auto kDelay = trafficSignalControllerWriter->GetDelay(); + if (!( kDelay == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DELAY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDelay).c_str()); + } + else if (trafficSignalControllerWriter->IsDelayParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DELAY.c_str(), trafficSignalControllerWriter->GetParameterFromDelay().c_str()); + } + const auto kName = trafficSignalControllerWriter->GetName(); + if (trafficSignalControllerWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), trafficSignalControllerWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kReference = trafficSignalControllerWriter->GetReference(); + if (!( kReference.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REFERENCE.c_str(), XmlExportHelper::ToXmlStringFromString( kReference).c_str()); + } + else if (trafficSignalControllerWriter->IsReferenceParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__REFERENCE.c_str(), trafficSignalControllerWriter->GetParameterFromReference().c_str()); + } + const auto kPhases = trafficSignalControllerWriter->GetWriterPhases(); + if (!kPhases.empty()) + { + for (auto phasesWriterItem : kPhases) + { + tinyxml2::XMLNode* phasesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PHASE.c_str()); + elementNode->InsertEndChild(phasesElement); + FillPhaseNode(document, phasesElement, phasesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerActionWriter) + { + // Add Attributes (Parameters) + const auto kPhase = trafficSignalControllerActionWriter->GetPhase(); + if (trafficSignalControllerActionWriter->IsPhaseParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PHASE.c_str(), trafficSignalControllerActionWriter->GetParameterFromPhase().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PHASE.c_str(), XmlExportHelper::ToXmlStringFromString( kPhase).c_str()); + } + const auto kTrafficSignalControllerRef = trafficSignalControllerActionWriter->GetTrafficSignalControllerRef(); + if (kTrafficSignalControllerRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kTrafficSignalControllerRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalControllerConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerConditionWriter) + { + // Add Attributes (Parameters) + const auto kPhase = trafficSignalControllerConditionWriter->GetPhase(); + if (trafficSignalControllerConditionWriter->IsPhaseParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PHASE.c_str(), trafficSignalControllerConditionWriter->GetParameterFromPhase().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__PHASE.c_str(), XmlExportHelper::ToXmlStringFromString( kPhase).c_str()); + } + const auto kTrafficSignalControllerRef = trafficSignalControllerConditionWriter->GetTrafficSignalControllerRef(); + if (kTrafficSignalControllerRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kTrafficSignalControllerRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalGroupStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalGroupStateWriter) + { + // Add Attributes (Parameters) + const auto kState = trafficSignalGroupStateWriter->GetState(); + if (trafficSignalGroupStateWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), trafficSignalGroupStateWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), XmlExportHelper::ToXmlStringFromString( kState).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalStateWriter) + { + // Add Attributes (Parameters) + const auto kState = trafficSignalStateWriter->GetState(); + if (trafficSignalStateWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), trafficSignalStateWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), XmlExportHelper::ToXmlStringFromString( kState).c_str()); + } + const auto kTrafficSignalId = trafficSignalStateWriter->GetTrafficSignalId(); + if (trafficSignalStateWriter->IsTrafficSignalIdParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID.c_str(), trafficSignalStateWriter->GetParameterFromTrafficSignalId().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID.c_str(), XmlExportHelper::ToXmlStringFromString( kTrafficSignalId).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSignalStateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalStateActionWriter) + { + // Add Attributes (Parameters) + const auto kName = trafficSignalStateActionWriter->GetName(); + if (trafficSignalStateActionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), trafficSignalStateActionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kState = trafficSignalStateActionWriter->GetState(); + if (trafficSignalStateActionWriter->IsStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), trafficSignalStateActionWriter->GetParameterFromState().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__STATE.c_str(), XmlExportHelper::ToXmlStringFromString( kState).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSinkActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSinkActionWriter) + { + // Add Attributes (Parameters) + const auto kRadius = trafficSinkActionWriter->GetRadius(); + if (trafficSinkActionWriter->IsRadiusParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RADIUS.c_str(), trafficSinkActionWriter->GetParameterFromRadius().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RADIUS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRadius).c_str()); + } + const auto kRate = trafficSinkActionWriter->GetRate(); + if (!( kRate == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRate).c_str()); + } + else if (trafficSinkActionWriter->IsRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RATE.c_str(), trafficSinkActionWriter->GetParameterFromRate().c_str()); + } + const auto kPosition = trafficSinkActionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + const auto kTrafficDefinition = trafficSinkActionWriter->GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + tinyxml2::XMLNode* trafficDefinitionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION.c_str()); + elementNode->InsertEndChild(trafficDefinitionElement); + FillTrafficDefinitionNode(document, trafficDefinitionElement, kTrafficDefinition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSourceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSourceActionWriter) + { + // Add Attributes (Parameters) + const auto kRadius = trafficSourceActionWriter->GetRadius(); + if (trafficSourceActionWriter->IsRadiusParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RADIUS.c_str(), trafficSourceActionWriter->GetParameterFromRadius().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RADIUS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRadius).c_str()); + } + const auto kRate = trafficSourceActionWriter->GetRate(); + if (trafficSourceActionWriter->IsRateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RATE.c_str(), trafficSourceActionWriter->GetParameterFromRate().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RATE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kRate).c_str()); + } + const auto kSpeed = trafficSourceActionWriter->GetSpeed(); + if (!( kSpeed == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSpeed).c_str()); + } + else if (trafficSourceActionWriter->IsSpeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), trafficSourceActionWriter->GetParameterFromSpeed().c_str()); + } + const auto kVelocity = trafficSourceActionWriter->GetVelocity(); + if (!( kVelocity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VELOCITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kVelocity).c_str()); + } + else if (trafficSourceActionWriter->IsVelocityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VELOCITY.c_str(), trafficSourceActionWriter->GetParameterFromVelocity().c_str()); + } + const auto kPosition = trafficSourceActionWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + const auto kTrafficDefinition = trafficSourceActionWriter->GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + tinyxml2::XMLNode* trafficDefinitionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION.c_str()); + elementNode->InsertEndChild(trafficDefinitionElement); + FillTrafficDefinitionNode(document, trafficDefinitionElement, kTrafficDefinition); + } + const auto kTrafficDistribution = trafficSourceActionWriter->GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + tinyxml2::XMLNode* trafficDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(trafficDistributionElement); + FillTrafficDistributionNode(document, trafficDistributionElement, kTrafficDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficStopActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficStopActionWriter) + { + // Add Attributes (Parameters) + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrafficSwarmActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSwarmActionWriter) + { + // Add Attributes (Parameters) + const auto kInnerRadius = trafficSwarmActionWriter->GetInnerRadius(); + if (trafficSwarmActionWriter->IsInnerRadiusParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS.c_str(), trafficSwarmActionWriter->GetParameterFromInnerRadius().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kInnerRadius).c_str()); + } + const auto kNumberOfVehicles = trafficSwarmActionWriter->GetNumberOfVehicles(); + if (trafficSwarmActionWriter->IsNumberOfVehiclesParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES.c_str(), trafficSwarmActionWriter->GetParameterFromNumberOfVehicles().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES.c_str(), XmlExportHelper::ToXmlStringFromUnsignedInt( kNumberOfVehicles).c_str()); + } + const auto kOffset = trafficSwarmActionWriter->GetOffset(); + if (trafficSwarmActionWriter->IsOffsetParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), trafficSwarmActionWriter->GetParameterFromOffset().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__OFFSET.c_str(), XmlExportHelper::ToXmlStringFromDouble( kOffset).c_str()); + } + const auto kSemiMajorAxis = trafficSwarmActionWriter->GetSemiMajorAxis(); + if (trafficSwarmActionWriter->IsSemiMajorAxisParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS.c_str(), trafficSwarmActionWriter->GetParameterFromSemiMajorAxis().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSemiMajorAxis).c_str()); + } + const auto kSemiMinorAxis = trafficSwarmActionWriter->GetSemiMinorAxis(); + if (trafficSwarmActionWriter->IsSemiMinorAxisParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS.c_str(), trafficSwarmActionWriter->GetParameterFromSemiMinorAxis().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSemiMinorAxis).c_str()); + } + const auto kVelocity = trafficSwarmActionWriter->GetVelocity(); + if (!( kVelocity == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VELOCITY.c_str(), XmlExportHelper::ToXmlStringFromDouble( kVelocity).c_str()); + } + else if (trafficSwarmActionWriter->IsVelocityParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VELOCITY.c_str(), trafficSwarmActionWriter->GetParameterFromVelocity().c_str()); + } + const auto kCentralObject = trafficSwarmActionWriter->GetWriterCentralObject(); + if (kCentralObject) + { + tinyxml2::XMLNode* centralObjectElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CENTRAL_OBJECT.c_str()); + elementNode->InsertEndChild(centralObjectElement); + FillCentralSwarmObjectNode(document, centralObjectElement, kCentralObject); + } + const auto kTrafficDefinition = trafficSwarmActionWriter->GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + tinyxml2::XMLNode* trafficDefinitionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION.c_str()); + elementNode->InsertEndChild(trafficDefinitionElement); + FillTrafficDefinitionNode(document, trafficDefinitionElement, kTrafficDefinition); + } + const auto kTrafficDistribution = trafficSwarmActionWriter->GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + tinyxml2::XMLNode* trafficDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(trafficDistributionElement); + FillTrafficDistributionNode(document, trafficDistributionElement, kTrafficDistribution); + } + const auto kInitialSpeedRange = trafficSwarmActionWriter->GetWriterInitialSpeedRange(); + if (kInitialSpeedRange) + { + tinyxml2::XMLNode* initialSpeedRangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__INITIAL_SPEED_RANGE.c_str()); + elementNode->InsertEndChild(initialSpeedRangeElement); + FillRangeNode(document, initialSpeedRangeElement, kInitialSpeedRange); + } + const auto kDirectionOfTravelDistribution = trafficSwarmActionWriter->GetWriterDirectionOfTravelDistribution(); + if (kDirectionOfTravelDistribution) + { + tinyxml2::XMLNode* directionOfTravelDistributionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTION_OF_TRAVEL_DISTRIBUTION.c_str()); + elementNode->InsertEndChild(directionOfTravelDistributionElement); + FillDirectionOfTravelDistributionNode(document, directionOfTravelDistributionElement, kDirectionOfTravelDistribution); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrailerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerWriter) + { + // Add Attributes (Parameters) + const auto kTrailer = trailerWriter->GetWriterTrailer(); + if (kTrailer) + { + tinyxml2::XMLNode* trailerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER.c_str()); + elementNode->InsertEndChild(trailerElement); + FillScenarioObjectNode(document, trailerElement, kTrailer); + } + const auto kTrailerRef = trailerWriter->GetWriterTrailerRef(); + if (kTrailerRef) + { + tinyxml2::XMLNode* trailerRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER_REF.c_str()); + elementNode->InsertEndChild(trailerRefElement); + FillEntityRefNode(document, trailerRefElement, kTrailerRef); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerActionWriter) + { + // Add Attributes (Parameters) + const auto kConnectTrailerAction = trailerActionWriter->GetWriterConnectTrailerAction(); + if (kConnectTrailerAction) + { + tinyxml2::XMLNode* connectTrailerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONNECT_TRAILER_ACTION.c_str()); + elementNode->InsertEndChild(connectTrailerActionElement); + FillConnectTrailerActionNode(document, connectTrailerActionElement, kConnectTrailerAction); + } + const auto kDisconnectTrailerAction = trailerActionWriter->GetWriterDisconnectTrailerAction(); + if (kDisconnectTrailerAction) + { + tinyxml2::XMLNode* disconnectTrailerActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DISCONNECT_TRAILER_ACTION.c_str()); + elementNode->InsertEndChild(disconnectTrailerActionElement); + FillDisconnectTrailerActionNode(document, disconnectTrailerActionElement, kDisconnectTrailerAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrailerCouplerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerCouplerWriter) + { + // Add Attributes (Parameters) + const auto kDx = trailerCouplerWriter->GetDx(); + if (trailerCouplerWriter->IsDxParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), trailerCouplerWriter->GetParameterFromDx().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDx).c_str()); + } + const auto kDz = trailerCouplerWriter->GetDz(); + if (!( kDz == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDz).c_str()); + } + else if (trailerCouplerWriter->IsDzParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), trailerCouplerWriter->GetParameterFromDz().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrailerHitchNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerHitchWriter) + { + // Add Attributes (Parameters) + const auto kDx = trailerHitchWriter->GetDx(); + if (trailerHitchWriter->IsDxParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), trailerHitchWriter->GetParameterFromDx().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DX.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDx).c_str()); + } + const auto kDz = trailerHitchWriter->GetDz(); + if (!( kDz == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDz).c_str()); + } + else if (trailerHitchWriter->IsDzParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DZ.c_str(), trailerHitchWriter->GetParameterFromDz().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrajectoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryWriter) + { + // Add Attributes (Parameters) + const auto kClosed = trajectoryWriter->GetClosed(); + if (trajectoryWriter->IsClosedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOSED.c_str(), trajectoryWriter->GetParameterFromClosed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOSED.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kClosed).c_str()); + } + const auto kName = trajectoryWriter->GetName(); + if (trajectoryWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), trajectoryWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kParameterDeclarations = trajectoryWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kShape = trajectoryWriter->GetWriterShape(); + if (kShape) + { + tinyxml2::XMLNode* shapeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SHAPE.c_str()); + elementNode->InsertEndChild(shapeElement); + FillShapeNode(document, shapeElement, kShape); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrajectoryCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = trajectoryCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrajectoryFollowingModeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryFollowingModeWriter) + { + // Add Attributes (Parameters) + const auto kFollowingMode = trajectoryFollowingModeWriter->GetFollowingMode(); + if (trajectoryFollowingModeWriter->IsFollowingModeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), trajectoryFollowingModeWriter->GetParameterFromFollowingMode().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), kFollowingMode.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrajectoryPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryPositionWriter) + { + // Add Attributes (Parameters) + const auto kS = trajectoryPositionWriter->GetS(); + if (trajectoryPositionWriter->IsSParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), trajectoryPositionWriter->GetParameterFromS().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__S.c_str(), XmlExportHelper::ToXmlStringFromDouble( kS).c_str()); + } + const auto kT = trajectoryPositionWriter->GetT(); + if (!( kT == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), XmlExportHelper::ToXmlStringFromDouble( kT).c_str()); + } + else if (trajectoryPositionWriter->IsTParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__T.c_str(), trajectoryPositionWriter->GetParameterFromT().c_str()); + } + const auto kOrientation = trajectoryPositionWriter->GetWriterOrientation(); + if (kOrientation) + { + tinyxml2::XMLNode* orientationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ORIENTATION.c_str()); + elementNode->InsertEndChild(orientationElement); + FillOrientationNode(document, orientationElement, kOrientation); + } + const auto kTrajectoryRef = trajectoryPositionWriter->GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + tinyxml2::XMLNode* trajectoryRefElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF.c_str()); + elementNode->InsertEndChild(trajectoryRefElement); + FillTrajectoryRefNode(document, trajectoryRefElement, kTrajectoryRef); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTrajectoryRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryRefWriter) + { + // Add Attributes (Parameters) + const auto kTrajectory = trajectoryRefWriter->GetWriterTrajectory(); + if (kTrajectory) + { + tinyxml2::XMLNode* trajectoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAJECTORY.c_str()); + elementNode->InsertEndChild(trajectoryElement); + FillTrajectoryNode(document, trajectoryElement, kTrajectory); + } + const auto kCatalogReference = trajectoryRefWriter->GetWriterCatalogReference(); + if (kCatalogReference) + { + tinyxml2::XMLNode* catalogReferenceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE.c_str()); + elementNode->InsertEndChild(catalogReferenceElement); + FillCatalogReferenceNode(document, catalogReferenceElement, kCatalogReference); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTransitionDynamicsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr transitionDynamicsWriter) + { + // Add Attributes (Parameters) + const auto kDynamicsDimension = transitionDynamicsWriter->GetDynamicsDimension(); + if (transitionDynamicsWriter->IsDynamicsDimensionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION.c_str(), transitionDynamicsWriter->GetParameterFromDynamicsDimension().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION.c_str(), kDynamicsDimension.GetLiteral().c_str()); + } + const auto kDynamicsShape = transitionDynamicsWriter->GetDynamicsShape(); + if (transitionDynamicsWriter->IsDynamicsShapeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE.c_str(), transitionDynamicsWriter->GetParameterFromDynamicsShape().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE.c_str(), kDynamicsShape.GetLiteral().c_str()); + } + const auto kFollowingMode = transitionDynamicsWriter->GetFollowingMode(); + if (!( kFollowingMode == FollowingMode::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), kFollowingMode.GetLiteral().c_str()); + } + else if (transitionDynamicsWriter->IsFollowingModeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE.c_str(), transitionDynamicsWriter->GetParameterFromFollowingMode().c_str()); + } + const auto kValue = transitionDynamicsWriter->GetValue(); + if (transitionDynamicsWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), transitionDynamicsWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTraveledDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr traveledDistanceConditionWriter) + { + // Add Attributes (Parameters) + const auto kValue = traveledDistanceConditionWriter->GetValue(); + if (traveledDistanceConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), traveledDistanceConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTriggerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr triggerWriter) + { + // Add Attributes (Parameters) + const auto kConditionGroups = triggerWriter->GetWriterConditionGroups(); + if (!kConditionGroups.empty()) + { + for (auto conditionGroupsWriterItem : kConditionGroups) + { + tinyxml2::XMLNode* conditionGroupsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CONDITION_GROUP.c_str()); + elementNode->InsertEndChild(conditionGroupsElement); + FillConditionGroupNode(document, conditionGroupsElement, conditionGroupsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillTriggeringEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr triggeringEntitiesWriter) + { + // Add Attributes (Parameters) + const auto kTriggeringEntitiesRule = triggeringEntitiesWriter->GetTriggeringEntitiesRule(); + if (triggeringEntitiesWriter->IsTriggeringEntitiesRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE.c_str(), triggeringEntitiesWriter->GetParameterFromTriggeringEntitiesRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE.c_str(), kTriggeringEntitiesRule.GetLiteral().c_str()); + } + const auto kEntityRefs = triggeringEntitiesWriter->GetWriterEntityRefs(); + if (!kEntityRefs.empty()) + { + for (auto entityRefsWriterItem : kEntityRefs) + { + tinyxml2::XMLNode* entityRefsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ENTITY_REF.c_str()); + elementNode->InsertEndChild(entityRefsElement); + FillEntityRefNode(document, entityRefsElement, entityRefsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUniformDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr uniformDistributionWriter) + { + // Add Attributes (Parameters) + const auto kRange = uniformDistributionWriter->GetWriterRange(); + if (kRange) + { + tinyxml2::XMLNode* rangeElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RANGE.c_str()); + elementNode->InsertEndChild(rangeElement); + FillRangeNode(document, rangeElement, kRange); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUsedAreaNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr usedAreaWriter) + { + // Add Attributes (Parameters) + const auto kPositions = usedAreaWriter->GetWriterPositions(); + if (!kPositions.empty()) + { + for (auto positionsWriterItem : kPositions) + { + tinyxml2::XMLNode* positionsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionsElement); + FillPositionNode(document, positionsElement, positionsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedActionWriter) + { + // Add Attributes (Parameters) + const auto kCustomCommandAction = userDefinedActionWriter->GetWriterCustomCommandAction(); + if (kCustomCommandAction) + { + tinyxml2::XMLNode* customCommandActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__CUSTOM_COMMAND_ACTION.c_str()); + elementNode->InsertEndChild(customCommandActionElement); + FillCustomCommandActionNode(document, customCommandActionElement, kCustomCommandAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedAnimationWriter) + { + // Add Attributes (Parameters) + const auto kUserDefinedAnimationType = userDefinedAnimationWriter->GetUserDefinedAnimationType(); + if (userDefinedAnimationWriter->IsUserDefinedAnimationTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE.c_str(), userDefinedAnimationWriter->GetParameterFromUserDefinedAnimationType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE.c_str(), XmlExportHelper::ToXmlStringFromString( kUserDefinedAnimationType).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedComponentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedComponentWriter) + { + // Add Attributes (Parameters) + const auto kUserDefinedComponentType = userDefinedComponentWriter->GetUserDefinedComponentType(); + if (userDefinedComponentWriter->IsUserDefinedComponentTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE.c_str(), userDefinedComponentWriter->GetParameterFromUserDefinedComponentType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE.c_str(), XmlExportHelper::ToXmlStringFromString( kUserDefinedComponentType).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedDistributionWriter) + { + // Add Attributes (Parameters) + const auto kContent = userDefinedDistributionWriter->GetContent(); + if (userDefinedDistributionWriter->IsContentParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), userDefinedDistributionWriter->GetParameterFromContent().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CONTENT.c_str(), XmlExportHelper::ToXmlStringFromString( kContent).c_str()); + } + const auto kType = userDefinedDistributionWriter->GetType(); + if (userDefinedDistributionWriter->IsTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), userDefinedDistributionWriter->GetParameterFromType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TYPE.c_str(), XmlExportHelper::ToXmlStringFromString( kType).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedLightNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedLightWriter) + { + // Add Attributes (Parameters) + const auto kUserDefinedLightType = userDefinedLightWriter->GetUserDefinedLightType(); + if (userDefinedLightWriter->IsUserDefinedLightTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE.c_str(), userDefinedLightWriter->GetParameterFromUserDefinedLightType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE.c_str(), XmlExportHelper::ToXmlStringFromString( kUserDefinedLightType).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillUserDefinedValueConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedValueConditionWriter) + { + // Add Attributes (Parameters) + const auto kName = userDefinedValueConditionWriter->GetName(); + if (userDefinedValueConditionWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), userDefinedValueConditionWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kRule = userDefinedValueConditionWriter->GetRule(); + if (userDefinedValueConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), userDefinedValueConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = userDefinedValueConditionWriter->GetValue(); + if (userDefinedValueConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), userDefinedValueConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillValueConstraintNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueConstraintWriter) + { + // Add Attributes (Parameters) + const auto kRule = valueConstraintWriter->GetRule(); + if (valueConstraintWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), valueConstraintWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = valueConstraintWriter->GetValue(); + if (valueConstraintWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), valueConstraintWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillValueConstraintGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueConstraintGroupWriter) + { + // Add Attributes (Parameters) + const auto kConstraints = valueConstraintGroupWriter->GetWriterConstraints(); + if (!kConstraints.empty()) + { + for (auto constraintsWriterItem : kConstraints) + { + tinyxml2::XMLNode* constraintsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VALUE_CONSTRAINT.c_str()); + elementNode->InsertEndChild(constraintsElement); + FillValueConstraintNode(document, constraintsElement, constraintsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillValueSetDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueSetDistributionWriter) + { + // Add Attributes (Parameters) + const auto kParameterValueSets = valueSetDistributionWriter->GetWriterParameterValueSets(); + if (!kParameterValueSets.empty()) + { + for (auto parameterValueSetsWriterItem : kParameterValueSets) + { + tinyxml2::XMLNode* parameterValueSetsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_SET.c_str()); + elementNode->InsertEndChild(parameterValueSetsElement); + FillParameterValueSetNode(document, parameterValueSetsElement, parameterValueSetsWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableActionWriter) + { + // Add Attributes (Parameters) + const auto kVariableRef = variableActionWriter->GetVariableRef(); + if (kVariableRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kVariableRef->GetNameRef()).c_str()); + } + const auto kSetAction = variableActionWriter->GetWriterSetAction(); + if (kSetAction) + { + tinyxml2::XMLNode* setActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SET_ACTION.c_str()); + elementNode->InsertEndChild(setActionElement); + FillVariableSetActionNode(document, setActionElement, kSetAction); + } + const auto kModifyAction = variableActionWriter->GetWriterModifyAction(); + if (kModifyAction) + { + tinyxml2::XMLNode* modifyActionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MODIFY_ACTION.c_str()); + elementNode->InsertEndChild(modifyActionElement); + FillVariableModifyActionNode(document, modifyActionElement, kModifyAction); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableAddValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableAddValueRuleWriter) + { + // Add Attributes (Parameters) + const auto kValue = variableAddValueRuleWriter->GetValue(); + if (variableAddValueRuleWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), variableAddValueRuleWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableConditionWriter) + { + // Add Attributes (Parameters) + const auto kRule = variableConditionWriter->GetRule(); + if (variableConditionWriter->IsRuleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), variableConditionWriter->GetParameterFromRule().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__RULE.c_str(), kRule.GetLiteral().c_str()); + } + const auto kValue = variableConditionWriter->GetValue(); + if (variableConditionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), variableConditionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + const auto kVariableRef = variableConditionWriter->GetVariableRef(); + if (kVariableRef) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF.c_str(), XmlExportHelper::ToXmlStringFromString(kVariableRef->GetNameRef()).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableDeclarationWriter) + { + // Add Attributes (Parameters) + const auto kName = variableDeclarationWriter->GetName(); + if (variableDeclarationWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), variableDeclarationWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kValue = variableDeclarationWriter->GetValue(); + if (variableDeclarationWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), variableDeclarationWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + const auto kVariableType = variableDeclarationWriter->GetVariableType(); + if (variableDeclarationWriter->IsVariableTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE.c_str(), variableDeclarationWriter->GetParameterFromVariableType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE.c_str(), kVariableType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableModifyActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableModifyActionWriter) + { + // Add Attributes (Parameters) + const auto kRule = variableModifyActionWriter->GetWriterRule(); + if (kRule) + { + tinyxml2::XMLNode* ruleElement = document->NewElement(OSC_CONSTANTS::ELEMENT__RULE.c_str()); + elementNode->InsertEndChild(ruleElement); + FillVariableModifyRuleNode(document, ruleElement, kRule); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableModifyRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableModifyRuleWriter) + { + // Add Attributes (Parameters) + const auto kAddValue = variableModifyRuleWriter->GetWriterAddValue(); + if (kAddValue) + { + tinyxml2::XMLNode* addValueElement = document->NewElement(OSC_CONSTANTS::ELEMENT__ADD_VALUE.c_str()); + elementNode->InsertEndChild(addValueElement); + FillVariableAddValueRuleNode(document, addValueElement, kAddValue); + } + const auto kMultiplyByValue = variableModifyRuleWriter->GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + tinyxml2::XMLNode* multiplyByValueElement = document->NewElement(OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE.c_str()); + elementNode->InsertEndChild(multiplyByValueElement); + FillVariableMultiplyByValueRuleNode(document, multiplyByValueElement, kMultiplyByValue); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableMultiplyByValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableMultiplyByValueRuleWriter) + { + // Add Attributes (Parameters) + const auto kValue = variableMultiplyByValueRuleWriter->GetValue(); + if (variableMultiplyByValueRuleWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), variableMultiplyByValueRuleWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVariableSetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableSetActionWriter) + { + // Add Attributes (Parameters) + const auto kValue = variableSetActionWriter->GetValue(); + if (variableSetActionWriter->IsValueParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), variableSetActionWriter->GetParameterFromValue().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VALUE.c_str(), XmlExportHelper::ToXmlStringFromString( kValue).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleWriter) + { + // Add Attributes (Parameters) + const auto kMass = vehicleWriter->GetMass(); + if (!( kMass == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), XmlExportHelper::ToXmlStringFromDouble( kMass).c_str()); + } + else if (vehicleWriter->IsMassParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MASS.c_str(), vehicleWriter->GetParameterFromMass().c_str()); + } + const auto kModel3d = vehicleWriter->GetModel3d(); + if (!( kModel3d.empty())) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), XmlExportHelper::ToXmlStringFromString( kModel3d).c_str()); + } + else if (vehicleWriter->IsModel3dParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__MODEL3D.c_str(), vehicleWriter->GetParameterFromModel3d().c_str()); + } + const auto kName = vehicleWriter->GetName(); + if (vehicleWriter->IsNameParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), vehicleWriter->GetParameterFromName().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__NAME.c_str(), XmlExportHelper::ToXmlStringFromString( kName).c_str()); + } + const auto kRole = vehicleWriter->GetRole(); + if (!( kRole == Role::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), kRole.GetLiteral().c_str()); + } + else if (vehicleWriter->IsRoleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), vehicleWriter->GetParameterFromRole().c_str()); + } + const auto kVehicleCategory = vehicleWriter->GetVehicleCategory(); + if (vehicleWriter->IsVehicleCategoryParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY.c_str(), vehicleWriter->GetParameterFromVehicleCategory().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY.c_str(), kVehicleCategory.GetLiteral().c_str()); + } + const auto kParameterDeclarations = vehicleWriter->GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + tinyxml2::XMLNode* parameterDeclarationsWrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION.c_str()); + elementNode->InsertEndChild(parameterDeclarationsWrapperElement); + for (auto parameterDeclarationsWriterItem : kParameterDeclarations) + { + tinyxml2::XMLNode* parameterDeclarationsElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS.c_str()); + parameterDeclarationsWrapperElement->InsertEndChild(parameterDeclarationsElement); + FillParameterDeclarationNode(document, parameterDeclarationsElement, parameterDeclarationsWriterItem); + } + } + const auto kBoundingBox = vehicleWriter->GetWriterBoundingBox(); + if (kBoundingBox) + { + tinyxml2::XMLNode* boundingBoxElement = document->NewElement(OSC_CONSTANTS::ELEMENT__BOUNDING_BOX.c_str()); + elementNode->InsertEndChild(boundingBoxElement); + FillBoundingBoxNode(document, boundingBoxElement, kBoundingBox); + } + const auto kPerformance = vehicleWriter->GetWriterPerformance(); + if (kPerformance) + { + tinyxml2::XMLNode* performanceElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PERFORMANCE.c_str()); + elementNode->InsertEndChild(performanceElement); + FillPerformanceNode(document, performanceElement, kPerformance); + } + const auto kAxles = vehicleWriter->GetWriterAxles(); + if (kAxles) + { + tinyxml2::XMLNode* axlesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__AXLES.c_str()); + elementNode->InsertEndChild(axlesElement); + FillAxlesNode(document, axlesElement, kAxles); + } + const auto kProperties = vehicleWriter->GetWriterProperties(); + if (kProperties) + { + tinyxml2::XMLNode* propertiesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PROPERTIES.c_str()); + elementNode->InsertEndChild(propertiesElement); + FillPropertiesNode(document, propertiesElement, kProperties); + } + const auto kTrailerHitch = vehicleWriter->GetWriterTrailerHitch(); + if (kTrailerHitch) + { + tinyxml2::XMLNode* trailerHitchElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER_HITCH.c_str()); + elementNode->InsertEndChild(trailerHitchElement); + FillTrailerHitchNode(document, trailerHitchElement, kTrailerHitch); + } + const auto kTrailerCoupler = vehicleWriter->GetWriterTrailerCoupler(); + if (kTrailerCoupler) + { + tinyxml2::XMLNode* trailerCouplerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER_COUPLER.c_str()); + elementNode->InsertEndChild(trailerCouplerElement); + FillTrailerCouplerNode(document, trailerCouplerElement, kTrailerCoupler); + } + const auto kTrailer = vehicleWriter->GetWriterTrailer(); + if (kTrailer) + { + tinyxml2::XMLNode* trailerElement = document->NewElement(OSC_CONSTANTS::ELEMENT__TRAILER.c_str()); + elementNode->InsertEndChild(trailerElement); + FillTrailerNode(document, trailerElement, kTrailer); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCatalogLocationWriter) + { + // Add Attributes (Parameters) + const auto kDirectory = vehicleCatalogLocationWriter->GetWriterDirectory(); + if (kDirectory) + { + tinyxml2::XMLNode* directoryElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DIRECTORY.c_str()); + elementNode->InsertEndChild(directoryElement); + FillDirectoryNode(document, directoryElement, kDirectory); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleCategoryDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCategoryDistributionWriter) + { + // Add Attributes (Parameters) + const auto kVehicleCategoryDistributionEntries = vehicleCategoryDistributionWriter->GetWriterVehicleCategoryDistributionEntries(); + if (!kVehicleCategoryDistributionEntries.empty()) + { + for (auto vehicleCategoryDistributionEntriesWriterItem : kVehicleCategoryDistributionEntries) + { + tinyxml2::XMLNode* vehicleCategoryDistributionEntriesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY.c_str()); + elementNode->InsertEndChild(vehicleCategoryDistributionEntriesElement); + FillVehicleCategoryDistributionEntryNode(document, vehicleCategoryDistributionEntriesElement, vehicleCategoryDistributionEntriesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleCategoryDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCategoryDistributionEntryWriter) + { + // Add Attributes (Parameters) + const auto kCategory = vehicleCategoryDistributionEntryWriter->GetCategory(); + if (vehicleCategoryDistributionEntryWriter->IsCategoryParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CATEGORY.c_str(), vehicleCategoryDistributionEntryWriter->GetParameterFromCategory().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CATEGORY.c_str(), kCategory.GetLiteral().c_str()); + } + const auto kWeight = vehicleCategoryDistributionEntryWriter->GetWeight(); + if (vehicleCategoryDistributionEntryWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), vehicleCategoryDistributionEntryWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleComponentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleComponentWriter) + { + // Add Attributes (Parameters) + const auto kVehicleComponentType = vehicleComponentWriter->GetVehicleComponentType(); + if (vehicleComponentWriter->IsVehicleComponentTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE.c_str(), vehicleComponentWriter->GetParameterFromVehicleComponentType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE.c_str(), kVehicleComponentType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleLightNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleLightWriter) + { + // Add Attributes (Parameters) + const auto kVehicleLightType = vehicleLightWriter->GetVehicleLightType(); + if (vehicleLightWriter->IsVehicleLightTypeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE.c_str(), vehicleLightWriter->GetParameterFromVehicleLightType().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE.c_str(), kVehicleLightType.GetLiteral().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleRoleDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleRoleDistributionWriter) + { + // Add Attributes (Parameters) + const auto kVehicleRoleDistributionEntries = vehicleRoleDistributionWriter->GetWriterVehicleRoleDistributionEntries(); + if (!kVehicleRoleDistributionEntries.empty()) + { + for (auto vehicleRoleDistributionEntriesWriterItem : kVehicleRoleDistributionEntries) + { + tinyxml2::XMLNode* vehicleRoleDistributionEntriesElement = document->NewElement(OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY.c_str()); + elementNode->InsertEndChild(vehicleRoleDistributionEntriesElement); + FillVehicleRoleDistributionEntryNode(document, vehicleRoleDistributionEntriesElement, vehicleRoleDistributionEntriesWriterItem); + + } + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVehicleRoleDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleRoleDistributionEntryWriter) + { + // Add Attributes (Parameters) + const auto kRole = vehicleRoleDistributionEntryWriter->GetRole(); + if (vehicleRoleDistributionEntryWriter->IsRoleParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), vehicleRoleDistributionEntryWriter->GetParameterFromRole().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROLE.c_str(), kRole.GetLiteral().c_str()); + } + const auto kWeight = vehicleRoleDistributionEntryWriter->GetWeight(); + if (vehicleRoleDistributionEntryWriter->IsWeightParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), vehicleRoleDistributionEntryWriter->GetParameterFromWeight().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__WEIGHT.c_str(), XmlExportHelper::ToXmlStringFromDouble( kWeight).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVertexNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vertexWriter) + { + // Add Attributes (Parameters) + const auto kTime = vertexWriter->GetTime(); + if (!( kTime == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTime).c_str()); + } + else if (vertexWriter->IsTimeParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TIME.c_str(), vertexWriter->GetParameterFromTime().c_str()); + } + const auto kPosition = vertexWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillVisibilityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr visibilityActionWriter) + { + // Add Attributes (Parameters) + const auto kGraphics = visibilityActionWriter->GetGraphics(); + if (visibilityActionWriter->IsGraphicsParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS.c_str(), visibilityActionWriter->GetParameterFromGraphics().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kGraphics).c_str()); + } + const auto kSensors = visibilityActionWriter->GetSensors(); + if (visibilityActionWriter->IsSensorsParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SENSORS.c_str(), visibilityActionWriter->GetParameterFromSensors().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SENSORS.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kSensors).c_str()); + } + const auto kTraffic = visibilityActionWriter->GetTraffic(); + if (visibilityActionWriter->IsTrafficParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC.c_str(), visibilityActionWriter->GetParameterFromTraffic().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC.c_str(), XmlExportHelper::ToXmlStringFromBoolean( kTraffic).c_str()); + } + const auto kSensorReferenceSet = visibilityActionWriter->GetWriterSensorReferenceSet(); + if (kSensorReferenceSet) + { + tinyxml2::XMLNode* sensorReferenceSetElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE_SET.c_str()); + elementNode->InsertEndChild(sensorReferenceSetElement); + FillSensorReferenceSetNode(document, sensorReferenceSetElement, kSensorReferenceSet); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillWaypointNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr waypointWriter) + { + // Add Attributes (Parameters) + const auto kRouteStrategy = waypointWriter->GetRouteStrategy(); + if (waypointWriter->IsRouteStrategyParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY.c_str(), waypointWriter->GetParameterFromRouteStrategy().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY.c_str(), kRouteStrategy.GetLiteral().c_str()); + } + const auto kPosition = waypointWriter->GetWriterPosition(); + if (kPosition) + { + tinyxml2::XMLNode* positionElement = document->NewElement(OSC_CONSTANTS::ELEMENT__POSITION.c_str()); + elementNode->InsertEndChild(positionElement); + FillPositionNode(document, positionElement, kPosition); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillWeatherNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr weatherWriter) + { + // Add Attributes (Parameters) + const auto kAtmosphericPressure = weatherWriter->GetAtmosphericPressure(); + if (!( kAtmosphericPressure == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kAtmosphericPressure).c_str()); + } + else if (weatherWriter->IsAtmosphericPressureParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE.c_str(), weatherWriter->GetParameterFromAtmosphericPressure().c_str()); + } + const auto kCloudState = weatherWriter->GetCloudState(); + if (!( kCloudState == CloudState::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE.c_str(), kCloudState.GetLiteral().c_str()); + } + else if (weatherWriter->IsCloudStateParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE.c_str(), weatherWriter->GetParameterFromCloudState().c_str()); + } + const auto kFractionalCloudCover = weatherWriter->GetFractionalCloudCover(); + if (!( kFractionalCloudCover == FractionalCloudCover::UNKNOWN)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER.c_str(), kFractionalCloudCover.GetLiteral().c_str()); + } + else if (weatherWriter->IsFractionalCloudCoverParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER.c_str(), weatherWriter->GetParameterFromFractionalCloudCover().c_str()); + } + const auto kTemperature = weatherWriter->GetTemperature(); + if (!( kTemperature == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE.c_str(), XmlExportHelper::ToXmlStringFromDouble( kTemperature).c_str()); + } + else if (weatherWriter->IsTemperatureParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE.c_str(), weatherWriter->GetParameterFromTemperature().c_str()); + } + const auto kSun = weatherWriter->GetWriterSun(); + if (kSun) + { + tinyxml2::XMLNode* sunElement = document->NewElement(OSC_CONSTANTS::ELEMENT__SUN.c_str()); + elementNode->InsertEndChild(sunElement); + FillSunNode(document, sunElement, kSun); + } + const auto kFog = weatherWriter->GetWriterFog(); + if (kFog) + { + tinyxml2::XMLNode* fogElement = document->NewElement(OSC_CONSTANTS::ELEMENT__FOG.c_str()); + elementNode->InsertEndChild(fogElement); + FillFogNode(document, fogElement, kFog); + } + const auto kPrecipitation = weatherWriter->GetWriterPrecipitation(); + if (kPrecipitation) + { + tinyxml2::XMLNode* precipitationElement = document->NewElement(OSC_CONSTANTS::ELEMENT__PRECIPITATION.c_str()); + elementNode->InsertEndChild(precipitationElement); + FillPrecipitationNode(document, precipitationElement, kPrecipitation); + } + const auto kWind = weatherWriter->GetWriterWind(); + if (kWind) + { + tinyxml2::XMLNode* windElement = document->NewElement(OSC_CONSTANTS::ELEMENT__WIND.c_str()); + elementNode->InsertEndChild(windElement); + FillWindNode(document, windElement, kWind); + } + const auto kDomeImage = weatherWriter->GetWriterDomeImage(); + if (kDomeImage) + { + tinyxml2::XMLNode* domeImageElement = document->NewElement(OSC_CONSTANTS::ELEMENT__DOME_IMAGE.c_str()); + elementNode->InsertEndChild(domeImageElement); + FillDomeImageNode(document, domeImageElement, kDomeImage); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillWindNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr windWriter) + { + // Add Attributes (Parameters) + const auto kDirection = windWriter->GetDirection(); + if (windWriter->IsDirectionParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), windWriter->GetParameterFromDirection().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__DIRECTION.c_str(), XmlExportHelper::ToXmlStringFromDouble( kDirection).c_str()); + } + const auto kSpeed = windWriter->GetSpeed(); + if (windWriter->IsSpeedParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), windWriter->GetParameterFromSpeed().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__SPEED.c_str(), XmlExportHelper::ToXmlStringFromDouble( kSpeed).c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + void OpenScenarioXmlExporter::FillWorldPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr worldPositionWriter) + { + // Add Attributes (Parameters) + const auto kH = worldPositionWriter->GetH(); + if (!( kH == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H.c_str(), XmlExportHelper::ToXmlStringFromDouble( kH).c_str()); + } + else if (worldPositionWriter->IsHParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__H.c_str(), worldPositionWriter->GetParameterFromH().c_str()); + } + const auto kP = worldPositionWriter->GetP(); + if (!( kP == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__P.c_str(), XmlExportHelper::ToXmlStringFromDouble( kP).c_str()); + } + else if (worldPositionWriter->IsPParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__P.c_str(), worldPositionWriter->GetParameterFromP().c_str()); + } + const auto kR = worldPositionWriter->GetR(); + if (!( kR == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__R.c_str(), XmlExportHelper::ToXmlStringFromDouble( kR).c_str()); + } + else if (worldPositionWriter->IsRParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__R.c_str(), worldPositionWriter->GetParameterFromR().c_str()); + } + const auto kX = worldPositionWriter->GetX(); + if (worldPositionWriter->IsXParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__X.c_str(), worldPositionWriter->GetParameterFromX().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__X.c_str(), XmlExportHelper::ToXmlStringFromDouble( kX).c_str()); + } + const auto kY = worldPositionWriter->GetY(); + if (worldPositionWriter->IsYParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Y.c_str(), worldPositionWriter->GetParameterFromY().c_str()); + } + else + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Y.c_str(), XmlExportHelper::ToXmlStringFromDouble( kY).c_str()); + } + const auto kZ = worldPositionWriter->GetZ(); + if (!( kZ == 0)) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Z.c_str(), XmlExportHelper::ToXmlStringFromDouble( kZ).c_str()); + } + else if (worldPositionWriter->IsZParameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__Z.c_str(), worldPositionWriter->GetParameterFromZ().c_str()); + } + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } + + } +} + diff --git a/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.h b/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.h new file mode 100644 index 00000000..43e9e45a --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.h @@ -0,0 +1,2405 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "ApiClassWriterInterfacesV1_3.h" +#include "MemLeakDetection.h" +#include "tinyxml2.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Exporting an XML document form a scenario tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + + class OpenScenarioXmlExporter + { + + public: + OPENSCENARIOLIB_EXP std::shared_ptr CreateXmlDocument(std::shared_ptr openScenarioWriter); + private: + + /** + * Fills a dom element of type AbsoluteSpeed + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param absoluteSpeedWriter the writer the element is filled from. + */ + void FillAbsoluteSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteSpeedWriter); + + /** + * Fills a dom element of type AbsoluteTargetLane + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param absoluteTargetLaneWriter the writer the element is filled from. + */ + void FillAbsoluteTargetLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetLaneWriter); + + /** + * Fills a dom element of type AbsoluteTargetLaneOffset + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param absoluteTargetLaneOffsetWriter the writer the element is filled from. + */ + void FillAbsoluteTargetLaneOffsetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetLaneOffsetWriter); + + /** + * Fills a dom element of type AbsoluteTargetSpeed + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param absoluteTargetSpeedWriter the writer the element is filled from. + */ + void FillAbsoluteTargetSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr absoluteTargetSpeedWriter); + + /** + * Fills a dom element of type AccelerationCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param accelerationConditionWriter the writer the element is filled from. + */ + void FillAccelerationConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr accelerationConditionWriter); + + /** + * Fills a dom element of type AcquirePositionAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param acquirePositionActionWriter the writer the element is filled from. + */ + void FillAcquirePositionActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr acquirePositionActionWriter); + + /** + * Fills a dom element of type Act + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param actWriter the writer the element is filled from. + */ + void FillActNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actWriter); + + /** + * Fills a dom element of type Action + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param actionWriter the writer the element is filled from. + */ + void FillActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actionWriter); + + /** + * Fills a dom element of type ActivateControllerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param activateControllerActionWriter the writer the element is filled from. + */ + void FillActivateControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr activateControllerActionWriter); + + /** + * Fills a dom element of type Actors + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param actorsWriter the writer the element is filled from. + */ + void FillActorsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr actorsWriter); + + /** + * Fills a dom element of type AddEntityAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param addEntityActionWriter the writer the element is filled from. + */ + void FillAddEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr addEntityActionWriter); + + /** + * Fills a dom element of type AngleCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param angleConditionWriter the writer the element is filled from. + */ + void FillAngleConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr angleConditionWriter); + + /** + * Fills a dom element of type AnimationAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param animationActionWriter the writer the element is filled from. + */ + void FillAnimationActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationActionWriter); + + /** + * Fills a dom element of type AnimationFile + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param animationFileWriter the writer the element is filled from. + */ + void FillAnimationFileNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationFileWriter); + + /** + * Fills a dom element of type AnimationState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param animationStateWriter the writer the element is filled from. + */ + void FillAnimationStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationStateWriter); + + /** + * Fills a dom element of type AnimationType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param animationTypeWriter the writer the element is filled from. + */ + void FillAnimationTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr animationTypeWriter); + + /** + * Fills a dom element of type AppearanceAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param appearanceActionWriter the writer the element is filled from. + */ + void FillAppearanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr appearanceActionWriter); + + /** + * Fills a dom element of type AssignControllerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param assignControllerActionWriter the writer the element is filled from. + */ + void FillAssignControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr assignControllerActionWriter); + + /** + * Fills a dom element of type AssignRouteAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param assignRouteActionWriter the writer the element is filled from. + */ + void FillAssignRouteActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr assignRouteActionWriter); + + /** + * Fills a dom element of type AutomaticGear + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param automaticGearWriter the writer the element is filled from. + */ + void FillAutomaticGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr automaticGearWriter); + + /** + * Fills a dom element of type Axle + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param axleWriter the writer the element is filled from. + */ + void FillAxleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr axleWriter); + + /** + * Fills a dom element of type Axles + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param axlesWriter the writer the element is filled from. + */ + void FillAxlesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr axlesWriter); + + /** + * Fills a dom element of type BoundingBox + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param boundingBoxWriter the writer the element is filled from. + */ + void FillBoundingBoxNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr boundingBoxWriter); + + /** + * Fills a dom element of type Brake + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param brakeWriter the writer the element is filled from. + */ + void FillBrakeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr brakeWriter); + + /** + * Fills a dom element of type BrakeInput + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param brakeInputWriter the writer the element is filled from. + */ + void FillBrakeInputNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr brakeInputWriter); + + /** + * Fills a dom element of type ByEntityCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param byEntityConditionWriter the writer the element is filled from. + */ + void FillByEntityConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byEntityConditionWriter); + + /** + * Fills a dom element of type ByObjectType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param byObjectTypeWriter the writer the element is filled from. + */ + void FillByObjectTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byObjectTypeWriter); + + /** + * Fills a dom element of type ByType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param byTypeWriter the writer the element is filled from. + */ + void FillByTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byTypeWriter); + + /** + * Fills a dom element of type ByValueCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param byValueConditionWriter the writer the element is filled from. + */ + void FillByValueConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr byValueConditionWriter); + + /** + * Fills a dom element of type Catalog + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param catalogWriter the writer the element is filled from. + */ + void FillCatalogNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogWriter); + + /** + * Fills a dom element of type CatalogDefinition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param catalogDefinitionWriter the writer the element is filled from. + */ + void FillCatalogDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogDefinitionWriter); + + /** + * Fills a dom element of type CatalogLocations + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param catalogLocationsWriter the writer the element is filled from. + */ + void FillCatalogLocationsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogLocationsWriter); + + /** + * Fills a dom element of type CatalogReference + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param catalogReferenceWriter the writer the element is filled from. + */ + void FillCatalogReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr catalogReferenceWriter); + + /** + * Fills a dom element of type Center + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param centerWriter the writer the element is filled from. + */ + void FillCenterNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr centerWriter); + + /** + * Fills a dom element of type CentralSwarmObject + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param centralSwarmObjectWriter the writer the element is filled from. + */ + void FillCentralSwarmObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr centralSwarmObjectWriter); + + /** + * Fills a dom element of type Clothoid + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param clothoidWriter the writer the element is filled from. + */ + void FillClothoidNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidWriter); + + /** + * Fills a dom element of type ClothoidSpline + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param clothoidSplineWriter the writer the element is filled from. + */ + void FillClothoidSplineNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidSplineWriter); + + /** + * Fills a dom element of type ClothoidSplineSegment + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param clothoidSplineSegmentWriter the writer the element is filled from. + */ + void FillClothoidSplineSegmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr clothoidSplineSegmentWriter); + + /** + * Fills a dom element of type CollisionCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param collisionConditionWriter the writer the element is filled from. + */ + void FillCollisionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr collisionConditionWriter); + + /** + * Fills a dom element of type Color + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param colorWriter the writer the element is filled from. + */ + void FillColorNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorWriter); + + /** + * Fills a dom element of type ColorCmyk + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param colorCmykWriter the writer the element is filled from. + */ + void FillColorCmykNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorCmykWriter); + + /** + * Fills a dom element of type ColorRgb + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param colorRgbWriter the writer the element is filled from. + */ + void FillColorRgbNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr colorRgbWriter); + + /** + * Fills a dom element of type ComponentAnimation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param componentAnimationWriter the writer the element is filled from. + */ + void FillComponentAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr componentAnimationWriter); + + /** + * Fills a dom element of type Condition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param conditionWriter the writer the element is filled from. + */ + void FillConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr conditionWriter); + + /** + * Fills a dom element of type ConditionGroup + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param conditionGroupWriter the writer the element is filled from. + */ + void FillConditionGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr conditionGroupWriter); + + /** + * Fills a dom element of type ConnectTrailerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param connectTrailerActionWriter the writer the element is filled from. + */ + void FillConnectTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr connectTrailerActionWriter); + + /** + * Fills a dom element of type ControlPoint + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controlPointWriter the writer the element is filled from. + */ + void FillControlPointNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controlPointWriter); + + /** + * Fills a dom element of type Controller + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controllerWriter the writer the element is filled from. + */ + void FillControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerWriter); + + /** + * Fills a dom element of type ControllerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controllerActionWriter the writer the element is filled from. + */ + void FillControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerActionWriter); + + /** + * Fills a dom element of type ControllerCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controllerCatalogLocationWriter the writer the element is filled from. + */ + void FillControllerCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerCatalogLocationWriter); + + /** + * Fills a dom element of type ControllerDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controllerDistributionWriter the writer the element is filled from. + */ + void FillControllerDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerDistributionWriter); + + /** + * Fills a dom element of type ControllerDistributionEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param controllerDistributionEntryWriter the writer the element is filled from. + */ + void FillControllerDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr controllerDistributionEntryWriter); + + /** + * Fills a dom element of type CustomCommandAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param customCommandActionWriter the writer the element is filled from. + */ + void FillCustomCommandActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr customCommandActionWriter); + + /** + * Fills a dom element of type CustomContent + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param customContentWriter the writer the element is filled from. + */ + void FillCustomContentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr customContentWriter); + + /** + * Fills a dom element of type DeleteEntityAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deleteEntityActionWriter the writer the element is filled from. + */ + void FillDeleteEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deleteEntityActionWriter); + + /** + * Fills a dom element of type Deterministic + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicWriter the writer the element is filled from. + */ + void FillDeterministicNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicWriter); + + /** + * Fills a dom element of type DeterministicMultiParameterDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicMultiParameterDistributionWriter the writer the element is filled from. + */ + void FillDeterministicMultiParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicMultiParameterDistributionWriter); + + /** + * Fills a dom element of type DeterministicMultiParameterDistributionType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicMultiParameterDistributionTypeWriter the writer the element is filled from. + */ + void FillDeterministicMultiParameterDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicMultiParameterDistributionTypeWriter); + + /** + * Fills a dom element of type DeterministicParameterDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicParameterDistributionWriter the writer the element is filled from. + */ + void FillDeterministicParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicParameterDistributionWriter); + + /** + * Fills a dom element of type DeterministicSingleParameterDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicSingleParameterDistributionWriter the writer the element is filled from. + */ + void FillDeterministicSingleParameterDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicSingleParameterDistributionWriter); + + /** + * Fills a dom element of type DeterministicSingleParameterDistributionType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param deterministicSingleParameterDistributionTypeWriter the writer the element is filled from. + */ + void FillDeterministicSingleParameterDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr deterministicSingleParameterDistributionTypeWriter); + + /** + * Fills a dom element of type Dimensions + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param dimensionsWriter the writer the element is filled from. + */ + void FillDimensionsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr dimensionsWriter); + + /** + * Fills a dom element of type DirectionOfTravelDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param directionOfTravelDistributionWriter the writer the element is filled from. + */ + void FillDirectionOfTravelDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr directionOfTravelDistributionWriter); + + /** + * Fills a dom element of type Directory + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param directoryWriter the writer the element is filled from. + */ + void FillDirectoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr directoryWriter); + + /** + * Fills a dom element of type DisconnectTrailerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param disconnectTrailerActionWriter the writer the element is filled from. + */ + void FillDisconnectTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr disconnectTrailerActionWriter); + + /** + * Fills a dom element of type DistanceCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param distanceConditionWriter the writer the element is filled from. + */ + void FillDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distanceConditionWriter); + + /** + * Fills a dom element of type DistributionDefinition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param distributionDefinitionWriter the writer the element is filled from. + */ + void FillDistributionDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionDefinitionWriter); + + /** + * Fills a dom element of type DistributionRange + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param distributionRangeWriter the writer the element is filled from. + */ + void FillDistributionRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionRangeWriter); + + /** + * Fills a dom element of type DistributionSet + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param distributionSetWriter the writer the element is filled from. + */ + void FillDistributionSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionSetWriter); + + /** + * Fills a dom element of type DistributionSetElement + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param distributionSetElementWriter the writer the element is filled from. + */ + void FillDistributionSetElementNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr distributionSetElementWriter); + + /** + * Fills a dom element of type DomeImage + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param domeImageWriter the writer the element is filled from. + */ + void FillDomeImageNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr domeImageWriter); + + /** + * Fills a dom element of type DynamicConstraints + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param dynamicConstraintsWriter the writer the element is filled from. + */ + void FillDynamicConstraintsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr dynamicConstraintsWriter); + + /** + * Fills a dom element of type EndOfRoadCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param endOfRoadConditionWriter the writer the element is filled from. + */ + void FillEndOfRoadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr endOfRoadConditionWriter); + + /** + * Fills a dom element of type Entities + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entitiesWriter the writer the element is filled from. + */ + void FillEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entitiesWriter); + + /** + * Fills a dom element of type EntityAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityActionWriter the writer the element is filled from. + */ + void FillEntityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityActionWriter); + + /** + * Fills a dom element of type EntityCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityConditionWriter the writer the element is filled from. + */ + void FillEntityConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityConditionWriter); + + /** + * Fills a dom element of type EntityDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityDistributionWriter the writer the element is filled from. + */ + void FillEntityDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityDistributionWriter); + + /** + * Fills a dom element of type EntityDistributionEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityDistributionEntryWriter the writer the element is filled from. + */ + void FillEntityDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityDistributionEntryWriter); + + /** + * Fills a dom element of type EntityObject + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityObjectWriter the writer the element is filled from. + */ + void FillEntityObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityObjectWriter); + + /** + * Fills a dom element of type EntityRef + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entityRefWriter the writer the element is filled from. + */ + void FillEntityRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entityRefWriter); + + /** + * Fills a dom element of type EntitySelection + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param entitySelectionWriter the writer the element is filled from. + */ + void FillEntitySelectionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr entitySelectionWriter); + + /** + * Fills a dom element of type Environment + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param environmentWriter the writer the element is filled from. + */ + void FillEnvironmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentWriter); + + /** + * Fills a dom element of type EnvironmentAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param environmentActionWriter the writer the element is filled from. + */ + void FillEnvironmentActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentActionWriter); + + /** + * Fills a dom element of type EnvironmentCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param environmentCatalogLocationWriter the writer the element is filled from. + */ + void FillEnvironmentCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr environmentCatalogLocationWriter); + + /** + * Fills a dom element of type Event + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param eventWriter the writer the element is filled from. + */ + void FillEventNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr eventWriter); + + /** + * Fills a dom element of type ExternalObjectReference + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param externalObjectReferenceWriter the writer the element is filled from. + */ + void FillExternalObjectReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr externalObjectReferenceWriter); + + /** + * Fills a dom element of type File + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param fileWriter the writer the element is filled from. + */ + void FillFileNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fileWriter); + + /** + * Fills a dom element of type FileHeader + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param fileHeaderWriter the writer the element is filled from. + */ + void FillFileHeaderNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fileHeaderWriter); + + /** + * Fills a dom element of type FinalSpeed + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param finalSpeedWriter the writer the element is filled from. + */ + void FillFinalSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr finalSpeedWriter); + + /** + * Fills a dom element of type Fog + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param fogWriter the writer the element is filled from. + */ + void FillFogNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr fogWriter); + + /** + * Fills a dom element of type FollowTrajectoryAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param followTrajectoryActionWriter the writer the element is filled from. + */ + void FillFollowTrajectoryActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr followTrajectoryActionWriter); + + /** + * Fills a dom element of type Gear + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param gearWriter the writer the element is filled from. + */ + void FillGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr gearWriter); + + /** + * Fills a dom element of type GeoPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param geoPositionWriter the writer the element is filled from. + */ + void FillGeoPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr geoPositionWriter); + + /** + * Fills a dom element of type GlobalAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param globalActionWriter the writer the element is filled from. + */ + void FillGlobalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr globalActionWriter); + + /** + * Fills a dom element of type Histogram + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param histogramWriter the writer the element is filled from. + */ + void FillHistogramNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr histogramWriter); + + /** + * Fills a dom element of type HistogramBin + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param histogramBinWriter the writer the element is filled from. + */ + void FillHistogramBinNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr histogramBinWriter); + + /** + * Fills a dom element of type InRoutePosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param inRoutePositionWriter the writer the element is filled from. + */ + void FillInRoutePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr inRoutePositionWriter); + + /** + * Fills a dom element of type InfrastructureAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param infrastructureActionWriter the writer the element is filled from. + */ + void FillInfrastructureActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr infrastructureActionWriter); + + /** + * Fills a dom element of type Init + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param initWriter the writer the element is filled from. + */ + void FillInitNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr initWriter); + + /** + * Fills a dom element of type InitActions + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param initActionsWriter the writer the element is filled from. + */ + void FillInitActionsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr initActionsWriter); + + /** + * Fills a dom element of type Knot + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param knotWriter the writer the element is filled from. + */ + void FillKnotNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr knotWriter); + + /** + * Fills a dom element of type Lane + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneWriter the writer the element is filled from. + */ + void FillLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneWriter); + + /** + * Fills a dom element of type LaneChangeAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneChangeActionWriter the writer the element is filled from. + */ + void FillLaneChangeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneChangeActionWriter); + + /** + * Fills a dom element of type LaneChangeTarget + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneChangeTargetWriter the writer the element is filled from. + */ + void FillLaneChangeTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneChangeTargetWriter); + + /** + * Fills a dom element of type LaneOffsetAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneOffsetActionWriter the writer the element is filled from. + */ + void FillLaneOffsetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetActionWriter); + + /** + * Fills a dom element of type LaneOffsetActionDynamics + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneOffsetActionDynamicsWriter the writer the element is filled from. + */ + void FillLaneOffsetActionDynamicsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetActionDynamicsWriter); + + /** + * Fills a dom element of type LaneOffsetTarget + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param laneOffsetTargetWriter the writer the element is filled from. + */ + void FillLaneOffsetTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr laneOffsetTargetWriter); + + /** + * Fills a dom element of type LanePosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lanePositionWriter the writer the element is filled from. + */ + void FillLanePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lanePositionWriter); + + /** + * Fills a dom element of type LateralAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lateralActionWriter the writer the element is filled from. + */ + void FillLateralActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lateralActionWriter); + + /** + * Fills a dom element of type LateralDistanceAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lateralDistanceActionWriter the writer the element is filled from. + */ + void FillLateralDistanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lateralDistanceActionWriter); + + /** + * Fills a dom element of type License + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param licenseWriter the writer the element is filled from. + */ + void FillLicenseNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr licenseWriter); + + /** + * Fills a dom element of type LightState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lightStateWriter the writer the element is filled from. + */ + void FillLightStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightStateWriter); + + /** + * Fills a dom element of type LightStateAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lightStateActionWriter the writer the element is filled from. + */ + void FillLightStateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightStateActionWriter); + + /** + * Fills a dom element of type LightType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param lightTypeWriter the writer the element is filled from. + */ + void FillLightTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr lightTypeWriter); + + /** + * Fills a dom element of type LogNormalDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param logNormalDistributionWriter the writer the element is filled from. + */ + void FillLogNormalDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr logNormalDistributionWriter); + + /** + * Fills a dom element of type LongitudinalAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param longitudinalActionWriter the writer the element is filled from. + */ + void FillLongitudinalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr longitudinalActionWriter); + + /** + * Fills a dom element of type LongitudinalDistanceAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param longitudinalDistanceActionWriter the writer the element is filled from. + */ + void FillLongitudinalDistanceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr longitudinalDistanceActionWriter); + + /** + * Fills a dom element of type Maneuver + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param maneuverWriter the writer the element is filled from. + */ + void FillManeuverNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverWriter); + + /** + * Fills a dom element of type ManeuverCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param maneuverCatalogLocationWriter the writer the element is filled from. + */ + void FillManeuverCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverCatalogLocationWriter); + + /** + * Fills a dom element of type ManeuverGroup + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param maneuverGroupWriter the writer the element is filled from. + */ + void FillManeuverGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr maneuverGroupWriter); + + /** + * Fills a dom element of type ManualGear + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param manualGearWriter the writer the element is filled from. + */ + void FillManualGearNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr manualGearWriter); + + /** + * Fills a dom element of type MiscObject + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param miscObjectWriter the writer the element is filled from. + */ + void FillMiscObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr miscObjectWriter); + + /** + * Fills a dom element of type MiscObjectCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param miscObjectCatalogLocationWriter the writer the element is filled from. + */ + void FillMiscObjectCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr miscObjectCatalogLocationWriter); + + /** + * Fills a dom element of type ModifyRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param modifyRuleWriter the writer the element is filled from. + */ + void FillModifyRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr modifyRuleWriter); + + /** + * Fills a dom element of type MonitorDeclaration + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param monitorDeclarationWriter the writer the element is filled from. + */ + void FillMonitorDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr monitorDeclarationWriter); + + /** + * Fills a dom element of type None + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param noneWriter the writer the element is filled from. + */ + void FillNoneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr noneWriter); + + /** + * Fills a dom element of type NormalDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param normalDistributionWriter the writer the element is filled from. + */ + void FillNormalDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr normalDistributionWriter); + + /** + * Fills a dom element of type Nurbs + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param nurbsWriter the writer the element is filled from. + */ + void FillNurbsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr nurbsWriter); + + /** + * Fills a dom element of type ObjectController + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param objectControllerWriter the writer the element is filled from. + */ + void FillObjectControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr objectControllerWriter); + + /** + * Fills a dom element of type OffroadCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param offroadConditionWriter the writer the element is filled from. + */ + void FillOffroadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr offroadConditionWriter); + + /** + * Fills a dom element of type OpenScenario + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param openScenarioWriter the writer the element is filled from. + */ + void FillOpenScenarioNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr openScenarioWriter); + + /** + * Fills a dom element of type OpenScenarioCategory + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param openScenarioCategoryWriter the writer the element is filled from. + */ + void FillOpenScenarioCategoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr openScenarioCategoryWriter); + + /** + * Fills a dom element of type Orientation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param orientationWriter the writer the element is filled from. + */ + void FillOrientationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr orientationWriter); + + /** + * Fills a dom element of type OverrideBrakeAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideBrakeActionWriter the writer the element is filled from. + */ + void FillOverrideBrakeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideBrakeActionWriter); + + /** + * Fills a dom element of type OverrideClutchAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideClutchActionWriter the writer the element is filled from. + */ + void FillOverrideClutchActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideClutchActionWriter); + + /** + * Fills a dom element of type OverrideControllerValueAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideControllerValueActionWriter the writer the element is filled from. + */ + void FillOverrideControllerValueActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideControllerValueActionWriter); + + /** + * Fills a dom element of type OverrideGearAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideGearActionWriter the writer the element is filled from. + */ + void FillOverrideGearActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideGearActionWriter); + + /** + * Fills a dom element of type OverrideParkingBrakeAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideParkingBrakeActionWriter the writer the element is filled from. + */ + void FillOverrideParkingBrakeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideParkingBrakeActionWriter); + + /** + * Fills a dom element of type OverrideSteeringWheelAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideSteeringWheelActionWriter the writer the element is filled from. + */ + void FillOverrideSteeringWheelActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideSteeringWheelActionWriter); + + /** + * Fills a dom element of type OverrideThrottleAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param overrideThrottleActionWriter the writer the element is filled from. + */ + void FillOverrideThrottleActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr overrideThrottleActionWriter); + + /** + * Fills a dom element of type ParameterAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterActionWriter the writer the element is filled from. + */ + void FillParameterActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterActionWriter); + + /** + * Fills a dom element of type ParameterAddValueRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterAddValueRuleWriter the writer the element is filled from. + */ + void FillParameterAddValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterAddValueRuleWriter); + + /** + * Fills a dom element of type ParameterAssignment + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterAssignmentWriter the writer the element is filled from. + */ + void FillParameterAssignmentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterAssignmentWriter); + + /** + * Fills a dom element of type ParameterCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterConditionWriter the writer the element is filled from. + */ + void FillParameterConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterConditionWriter); + + /** + * Fills a dom element of type ParameterDeclaration + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterDeclarationWriter the writer the element is filled from. + */ + void FillParameterDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterDeclarationWriter); + + /** + * Fills a dom element of type ParameterModifyAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterModifyActionWriter the writer the element is filled from. + */ + void FillParameterModifyActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterModifyActionWriter); + + /** + * Fills a dom element of type ParameterMultiplyByValueRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterMultiplyByValueRuleWriter the writer the element is filled from. + */ + void FillParameterMultiplyByValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterMultiplyByValueRuleWriter); + + /** + * Fills a dom element of type ParameterSetAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterSetActionWriter the writer the element is filled from. + */ + void FillParameterSetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterSetActionWriter); + + /** + * Fills a dom element of type ParameterValueDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterValueDistributionWriter the writer the element is filled from. + */ + void FillParameterValueDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueDistributionWriter); + + /** + * Fills a dom element of type ParameterValueDistributionDefinition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterValueDistributionDefinitionWriter the writer the element is filled from. + */ + void FillParameterValueDistributionDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueDistributionDefinitionWriter); + + /** + * Fills a dom element of type ParameterValueSet + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param parameterValueSetWriter the writer the element is filled from. + */ + void FillParameterValueSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr parameterValueSetWriter); + + /** + * Fills a dom element of type Pedestrian + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param pedestrianWriter the writer the element is filled from. + */ + void FillPedestrianNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianWriter); + + /** + * Fills a dom element of type PedestrianAnimation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param pedestrianAnimationWriter the writer the element is filled from. + */ + void FillPedestrianAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianAnimationWriter); + + /** + * Fills a dom element of type PedestrianCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param pedestrianCatalogLocationWriter the writer the element is filled from. + */ + void FillPedestrianCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianCatalogLocationWriter); + + /** + * Fills a dom element of type PedestrianGesture + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param pedestrianGestureWriter the writer the element is filled from. + */ + void FillPedestrianGestureNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr pedestrianGestureWriter); + + /** + * Fills a dom element of type Performance + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param performanceWriter the writer the element is filled from. + */ + void FillPerformanceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr performanceWriter); + + /** + * Fills a dom element of type Phase + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param phaseWriter the writer the element is filled from. + */ + void FillPhaseNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr phaseWriter); + + /** + * Fills a dom element of type PoissonDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param poissonDistributionWriter the writer the element is filled from. + */ + void FillPoissonDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr poissonDistributionWriter); + + /** + * Fills a dom element of type Polygon + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param polygonWriter the writer the element is filled from. + */ + void FillPolygonNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr polygonWriter); + + /** + * Fills a dom element of type Polyline + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param polylineWriter the writer the element is filled from. + */ + void FillPolylineNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr polylineWriter); + + /** + * Fills a dom element of type Position + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param positionWriter the writer the element is filled from. + */ + void FillPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionWriter); + + /** + * Fills a dom element of type PositionInLaneCoordinates + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param positionInLaneCoordinatesWriter the writer the element is filled from. + */ + void FillPositionInLaneCoordinatesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionInLaneCoordinatesWriter); + + /** + * Fills a dom element of type PositionInRoadCoordinates + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param positionInRoadCoordinatesWriter the writer the element is filled from. + */ + void FillPositionInRoadCoordinatesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionInRoadCoordinatesWriter); + + /** + * Fills a dom element of type PositionOfCurrentEntity + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param positionOfCurrentEntityWriter the writer the element is filled from. + */ + void FillPositionOfCurrentEntityNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr positionOfCurrentEntityWriter); + + /** + * Fills a dom element of type Precipitation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param precipitationWriter the writer the element is filled from. + */ + void FillPrecipitationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr precipitationWriter); + + /** + * Fills a dom element of type Private + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param privateWriter the writer the element is filled from. + */ + void FillPrivateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr privateWriter); + + /** + * Fills a dom element of type PrivateAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param privateActionWriter the writer the element is filled from. + */ + void FillPrivateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr privateActionWriter); + + /** + * Fills a dom element of type ProbabilityDistributionSet + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param probabilityDistributionSetWriter the writer the element is filled from. + */ + void FillProbabilityDistributionSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr probabilityDistributionSetWriter); + + /** + * Fills a dom element of type ProbabilityDistributionSetElement + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param probabilityDistributionSetElementWriter the writer the element is filled from. + */ + void FillProbabilityDistributionSetElementNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr probabilityDistributionSetElementWriter); + + /** + * Fills a dom element of type Properties + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param propertiesWriter the writer the element is filled from. + */ + void FillPropertiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr propertiesWriter); + + /** + * Fills a dom element of type Property + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param propertyWriter the writer the element is filled from. + */ + void FillPropertyNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr propertyWriter); + + /** + * Fills a dom element of type RandomRouteAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param randomRouteActionWriter the writer the element is filled from. + */ + void FillRandomRouteActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr randomRouteActionWriter); + + /** + * Fills a dom element of type Range + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param rangeWriter the writer the element is filled from. + */ + void FillRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr rangeWriter); + + /** + * Fills a dom element of type ReachPositionCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param reachPositionConditionWriter the writer the element is filled from. + */ + void FillReachPositionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr reachPositionConditionWriter); + + /** + * Fills a dom element of type RelativeAngleCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeAngleConditionWriter the writer the element is filled from. + */ + void FillRelativeAngleConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeAngleConditionWriter); + + /** + * Fills a dom element of type RelativeClearanceCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeClearanceConditionWriter the writer the element is filled from. + */ + void FillRelativeClearanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeClearanceConditionWriter); + + /** + * Fills a dom element of type RelativeDistanceCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeDistanceConditionWriter the writer the element is filled from. + */ + void FillRelativeDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeDistanceConditionWriter); + + /** + * Fills a dom element of type RelativeLanePosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeLanePositionWriter the writer the element is filled from. + */ + void FillRelativeLanePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeLanePositionWriter); + + /** + * Fills a dom element of type RelativeLaneRange + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeLaneRangeWriter the writer the element is filled from. + */ + void FillRelativeLaneRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeLaneRangeWriter); + + /** + * Fills a dom element of type RelativeObjectPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeObjectPositionWriter the writer the element is filled from. + */ + void FillRelativeObjectPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeObjectPositionWriter); + + /** + * Fills a dom element of type RelativeRoadPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeRoadPositionWriter the writer the element is filled from. + */ + void FillRelativeRoadPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeRoadPositionWriter); + + /** + * Fills a dom element of type RelativeSpeedCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeSpeedConditionWriter the writer the element is filled from. + */ + void FillRelativeSpeedConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeSpeedConditionWriter); + + /** + * Fills a dom element of type RelativeSpeedToMaster + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeSpeedToMasterWriter the writer the element is filled from. + */ + void FillRelativeSpeedToMasterNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeSpeedToMasterWriter); + + /** + * Fills a dom element of type RelativeTargetLane + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeTargetLaneWriter the writer the element is filled from. + */ + void FillRelativeTargetLaneNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetLaneWriter); + + /** + * Fills a dom element of type RelativeTargetLaneOffset + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeTargetLaneOffsetWriter the writer the element is filled from. + */ + void FillRelativeTargetLaneOffsetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetLaneOffsetWriter); + + /** + * Fills a dom element of type RelativeTargetSpeed + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeTargetSpeedWriter the writer the element is filled from. + */ + void FillRelativeTargetSpeedNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeTargetSpeedWriter); + + /** + * Fills a dom element of type RelativeWorldPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param relativeWorldPositionWriter the writer the element is filled from. + */ + void FillRelativeWorldPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr relativeWorldPositionWriter); + + /** + * Fills a dom element of type RoadCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param roadConditionWriter the writer the element is filled from. + */ + void FillRoadConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadConditionWriter); + + /** + * Fills a dom element of type RoadCursor + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param roadCursorWriter the writer the element is filled from. + */ + void FillRoadCursorNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadCursorWriter); + + /** + * Fills a dom element of type RoadNetwork + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param roadNetworkWriter the writer the element is filled from. + */ + void FillRoadNetworkNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadNetworkWriter); + + /** + * Fills a dom element of type RoadPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param roadPositionWriter the writer the element is filled from. + */ + void FillRoadPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadPositionWriter); + + /** + * Fills a dom element of type RoadRange + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param roadRangeWriter the writer the element is filled from. + */ + void FillRoadRangeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr roadRangeWriter); + + /** + * Fills a dom element of type Route + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param routeWriter the writer the element is filled from. + */ + void FillRouteNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeWriter); + + /** + * Fills a dom element of type RouteCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param routeCatalogLocationWriter the writer the element is filled from. + */ + void FillRouteCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeCatalogLocationWriter); + + /** + * Fills a dom element of type RoutePosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param routePositionWriter the writer the element is filled from. + */ + void FillRoutePositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routePositionWriter); + + /** + * Fills a dom element of type RouteRef + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param routeRefWriter the writer the element is filled from. + */ + void FillRouteRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routeRefWriter); + + /** + * Fills a dom element of type RoutingAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param routingActionWriter the writer the element is filled from. + */ + void FillRoutingActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr routingActionWriter); + + /** + * Fills a dom element of type ScenarioDefinition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param scenarioDefinitionWriter the writer the element is filled from. + */ + void FillScenarioDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioDefinitionWriter); + + /** + * Fills a dom element of type ScenarioObject + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param scenarioObjectWriter the writer the element is filled from. + */ + void FillScenarioObjectNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioObjectWriter); + + /** + * Fills a dom element of type ScenarioObjectTemplate + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param scenarioObjectTemplateWriter the writer the element is filled from. + */ + void FillScenarioObjectTemplateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr scenarioObjectTemplateWriter); + + /** + * Fills a dom element of type SelectedEntities + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param selectedEntitiesWriter the writer the element is filled from. + */ + void FillSelectedEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr selectedEntitiesWriter); + + /** + * Fills a dom element of type SensorReference + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param sensorReferenceWriter the writer the element is filled from. + */ + void FillSensorReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sensorReferenceWriter); + + /** + * Fills a dom element of type SensorReferenceSet + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param sensorReferenceSetWriter the writer the element is filled from. + */ + void FillSensorReferenceSetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sensorReferenceSetWriter); + + /** + * Fills a dom element of type SetMonitorAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param setMonitorActionWriter the writer the element is filled from. + */ + void FillSetMonitorActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr setMonitorActionWriter); + + /** + * Fills a dom element of type Shape + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param shapeWriter the writer the element is filled from. + */ + void FillShapeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr shapeWriter); + + /** + * Fills a dom element of type SimulationTimeCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param simulationTimeConditionWriter the writer the element is filled from. + */ + void FillSimulationTimeConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr simulationTimeConditionWriter); + + /** + * Fills a dom element of type SpeedAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param speedActionWriter the writer the element is filled from. + */ + void FillSpeedActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedActionWriter); + + /** + * Fills a dom element of type SpeedActionTarget + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param speedActionTargetWriter the writer the element is filled from. + */ + void FillSpeedActionTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedActionTargetWriter); + + /** + * Fills a dom element of type SpeedCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param speedConditionWriter the writer the element is filled from. + */ + void FillSpeedConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedConditionWriter); + + /** + * Fills a dom element of type SpeedProfileAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param speedProfileActionWriter the writer the element is filled from. + */ + void FillSpeedProfileActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedProfileActionWriter); + + /** + * Fills a dom element of type SpeedProfileEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param speedProfileEntryWriter the writer the element is filled from. + */ + void FillSpeedProfileEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr speedProfileEntryWriter); + + /** + * Fills a dom element of type StandStillCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param standStillConditionWriter the writer the element is filled from. + */ + void FillStandStillConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr standStillConditionWriter); + + /** + * Fills a dom element of type SteadyState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param steadyStateWriter the writer the element is filled from. + */ + void FillSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr steadyStateWriter); + + /** + * Fills a dom element of type Stochastic + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param stochasticWriter the writer the element is filled from. + */ + void FillStochasticNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticWriter); + + /** + * Fills a dom element of type StochasticDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param stochasticDistributionWriter the writer the element is filled from. + */ + void FillStochasticDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticDistributionWriter); + + /** + * Fills a dom element of type StochasticDistributionType + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param stochasticDistributionTypeWriter the writer the element is filled from. + */ + void FillStochasticDistributionTypeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr stochasticDistributionTypeWriter); + + /** + * Fills a dom element of type Story + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param storyWriter the writer the element is filled from. + */ + void FillStoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyWriter); + + /** + * Fills a dom element of type Storyboard + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param storyboardWriter the writer the element is filled from. + */ + void FillStoryboardNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyboardWriter); + + /** + * Fills a dom element of type StoryboardElementStateCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param storyboardElementStateConditionWriter the writer the element is filled from. + */ + void FillStoryboardElementStateConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr storyboardElementStateConditionWriter); + + /** + * Fills a dom element of type Sun + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param sunWriter the writer the element is filled from. + */ + void FillSunNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr sunWriter); + + /** + * Fills a dom element of type SynchronizeAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param synchronizeActionWriter the writer the element is filled from. + */ + void FillSynchronizeActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr synchronizeActionWriter); + + /** + * Fills a dom element of type TargetDistanceSteadyState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param targetDistanceSteadyStateWriter the writer the element is filled from. + */ + void FillTargetDistanceSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr targetDistanceSteadyStateWriter); + + /** + * Fills a dom element of type TargetTimeSteadyState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param targetTimeSteadyStateWriter the writer the element is filled from. + */ + void FillTargetTimeSteadyStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr targetTimeSteadyStateWriter); + + /** + * Fills a dom element of type TeleportAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param teleportActionWriter the writer the element is filled from. + */ + void FillTeleportActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr teleportActionWriter); + + /** + * Fills a dom element of type TimeHeadwayCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeHeadwayConditionWriter the writer the element is filled from. + */ + void FillTimeHeadwayConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeHeadwayConditionWriter); + + /** + * Fills a dom element of type TimeOfDay + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeOfDayWriter the writer the element is filled from. + */ + void FillTimeOfDayNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeOfDayWriter); + + /** + * Fills a dom element of type TimeOfDayCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeOfDayConditionWriter the writer the element is filled from. + */ + void FillTimeOfDayConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeOfDayConditionWriter); + + /** + * Fills a dom element of type TimeReference + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeReferenceWriter the writer the element is filled from. + */ + void FillTimeReferenceNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeReferenceWriter); + + /** + * Fills a dom element of type TimeToCollisionCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeToCollisionConditionWriter the writer the element is filled from. + */ + void FillTimeToCollisionConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeToCollisionConditionWriter); + + /** + * Fills a dom element of type TimeToCollisionConditionTarget + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timeToCollisionConditionTargetWriter the writer the element is filled from. + */ + void FillTimeToCollisionConditionTargetNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timeToCollisionConditionTargetWriter); + + /** + * Fills a dom element of type Timing + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param timingWriter the writer the element is filled from. + */ + void FillTimingNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr timingWriter); + + /** + * Fills a dom element of type TrafficAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficActionWriter the writer the element is filled from. + */ + void FillTrafficActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficActionWriter); + + /** + * Fills a dom element of type TrafficArea + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficAreaWriter the writer the element is filled from. + */ + void FillTrafficAreaNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficAreaWriter); + + /** + * Fills a dom element of type TrafficAreaAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficAreaActionWriter the writer the element is filled from. + */ + void FillTrafficAreaActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficAreaActionWriter); + + /** + * Fills a dom element of type TrafficDefinition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficDefinitionWriter the writer the element is filled from. + */ + void FillTrafficDefinitionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDefinitionWriter); + + /** + * Fills a dom element of type TrafficDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficDistributionWriter the writer the element is filled from. + */ + void FillTrafficDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDistributionWriter); + + /** + * Fills a dom element of type TrafficDistributionEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficDistributionEntryWriter the writer the element is filled from. + */ + void FillTrafficDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficDistributionEntryWriter); + + /** + * Fills a dom element of type TrafficSignalAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalActionWriter the writer the element is filled from. + */ + void FillTrafficSignalActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalActionWriter); + + /** + * Fills a dom element of type TrafficSignalCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalConditionWriter the writer the element is filled from. + */ + void FillTrafficSignalConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalConditionWriter); + + /** + * Fills a dom element of type TrafficSignalController + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalControllerWriter the writer the element is filled from. + */ + void FillTrafficSignalControllerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerWriter); + + /** + * Fills a dom element of type TrafficSignalControllerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalControllerActionWriter the writer the element is filled from. + */ + void FillTrafficSignalControllerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerActionWriter); + + /** + * Fills a dom element of type TrafficSignalControllerCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalControllerConditionWriter the writer the element is filled from. + */ + void FillTrafficSignalControllerConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalControllerConditionWriter); + + /** + * Fills a dom element of type TrafficSignalGroupState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalGroupStateWriter the writer the element is filled from. + */ + void FillTrafficSignalGroupStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalGroupStateWriter); + + /** + * Fills a dom element of type TrafficSignalState + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalStateWriter the writer the element is filled from. + */ + void FillTrafficSignalStateNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalStateWriter); + + /** + * Fills a dom element of type TrafficSignalStateAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSignalStateActionWriter the writer the element is filled from. + */ + void FillTrafficSignalStateActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSignalStateActionWriter); + + /** + * Fills a dom element of type TrafficSinkAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSinkActionWriter the writer the element is filled from. + */ + void FillTrafficSinkActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSinkActionWriter); + + /** + * Fills a dom element of type TrafficSourceAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSourceActionWriter the writer the element is filled from. + */ + void FillTrafficSourceActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSourceActionWriter); + + /** + * Fills a dom element of type TrafficStopAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficStopActionWriter the writer the element is filled from. + */ + void FillTrafficStopActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficStopActionWriter); + + /** + * Fills a dom element of type TrafficSwarmAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trafficSwarmActionWriter the writer the element is filled from. + */ + void FillTrafficSwarmActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trafficSwarmActionWriter); + + /** + * Fills a dom element of type Trailer + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trailerWriter the writer the element is filled from. + */ + void FillTrailerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerWriter); + + /** + * Fills a dom element of type TrailerAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trailerActionWriter the writer the element is filled from. + */ + void FillTrailerActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerActionWriter); + + /** + * Fills a dom element of type TrailerCoupler + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trailerCouplerWriter the writer the element is filled from. + */ + void FillTrailerCouplerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerCouplerWriter); + + /** + * Fills a dom element of type TrailerHitch + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trailerHitchWriter the writer the element is filled from. + */ + void FillTrailerHitchNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trailerHitchWriter); + + /** + * Fills a dom element of type Trajectory + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trajectoryWriter the writer the element is filled from. + */ + void FillTrajectoryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryWriter); + + /** + * Fills a dom element of type TrajectoryCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trajectoryCatalogLocationWriter the writer the element is filled from. + */ + void FillTrajectoryCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryCatalogLocationWriter); + + /** + * Fills a dom element of type TrajectoryFollowingMode + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trajectoryFollowingModeWriter the writer the element is filled from. + */ + void FillTrajectoryFollowingModeNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryFollowingModeWriter); + + /** + * Fills a dom element of type TrajectoryPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trajectoryPositionWriter the writer the element is filled from. + */ + void FillTrajectoryPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryPositionWriter); + + /** + * Fills a dom element of type TrajectoryRef + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param trajectoryRefWriter the writer the element is filled from. + */ + void FillTrajectoryRefNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr trajectoryRefWriter); + + /** + * Fills a dom element of type TransitionDynamics + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param transitionDynamicsWriter the writer the element is filled from. + */ + void FillTransitionDynamicsNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr transitionDynamicsWriter); + + /** + * Fills a dom element of type TraveledDistanceCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param traveledDistanceConditionWriter the writer the element is filled from. + */ + void FillTraveledDistanceConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr traveledDistanceConditionWriter); + + /** + * Fills a dom element of type Trigger + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param triggerWriter the writer the element is filled from. + */ + void FillTriggerNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr triggerWriter); + + /** + * Fills a dom element of type TriggeringEntities + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param triggeringEntitiesWriter the writer the element is filled from. + */ + void FillTriggeringEntitiesNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr triggeringEntitiesWriter); + + /** + * Fills a dom element of type UniformDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param uniformDistributionWriter the writer the element is filled from. + */ + void FillUniformDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr uniformDistributionWriter); + + /** + * Fills a dom element of type UsedArea + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param usedAreaWriter the writer the element is filled from. + */ + void FillUsedAreaNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr usedAreaWriter); + + /** + * Fills a dom element of type UserDefinedAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedActionWriter the writer the element is filled from. + */ + void FillUserDefinedActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedActionWriter); + + /** + * Fills a dom element of type UserDefinedAnimation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedAnimationWriter the writer the element is filled from. + */ + void FillUserDefinedAnimationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedAnimationWriter); + + /** + * Fills a dom element of type UserDefinedComponent + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedComponentWriter the writer the element is filled from. + */ + void FillUserDefinedComponentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedComponentWriter); + + /** + * Fills a dom element of type UserDefinedDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedDistributionWriter the writer the element is filled from. + */ + void FillUserDefinedDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedDistributionWriter); + + /** + * Fills a dom element of type UserDefinedLight + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedLightWriter the writer the element is filled from. + */ + void FillUserDefinedLightNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedLightWriter); + + /** + * Fills a dom element of type UserDefinedValueCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param userDefinedValueConditionWriter the writer the element is filled from. + */ + void FillUserDefinedValueConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr userDefinedValueConditionWriter); + + /** + * Fills a dom element of type ValueConstraint + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param valueConstraintWriter the writer the element is filled from. + */ + void FillValueConstraintNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueConstraintWriter); + + /** + * Fills a dom element of type ValueConstraintGroup + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param valueConstraintGroupWriter the writer the element is filled from. + */ + void FillValueConstraintGroupNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueConstraintGroupWriter); + + /** + * Fills a dom element of type ValueSetDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param valueSetDistributionWriter the writer the element is filled from. + */ + void FillValueSetDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr valueSetDistributionWriter); + + /** + * Fills a dom element of type VariableAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableActionWriter the writer the element is filled from. + */ + void FillVariableActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableActionWriter); + + /** + * Fills a dom element of type VariableAddValueRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableAddValueRuleWriter the writer the element is filled from. + */ + void FillVariableAddValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableAddValueRuleWriter); + + /** + * Fills a dom element of type VariableCondition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableConditionWriter the writer the element is filled from. + */ + void FillVariableConditionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableConditionWriter); + + /** + * Fills a dom element of type VariableDeclaration + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableDeclarationWriter the writer the element is filled from. + */ + void FillVariableDeclarationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableDeclarationWriter); + + /** + * Fills a dom element of type VariableModifyAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableModifyActionWriter the writer the element is filled from. + */ + void FillVariableModifyActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableModifyActionWriter); + + /** + * Fills a dom element of type VariableModifyRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableModifyRuleWriter the writer the element is filled from. + */ + void FillVariableModifyRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableModifyRuleWriter); + + /** + * Fills a dom element of type VariableMultiplyByValueRule + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableMultiplyByValueRuleWriter the writer the element is filled from. + */ + void FillVariableMultiplyByValueRuleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableMultiplyByValueRuleWriter); + + /** + * Fills a dom element of type VariableSetAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param variableSetActionWriter the writer the element is filled from. + */ + void FillVariableSetActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr variableSetActionWriter); + + /** + * Fills a dom element of type Vehicle + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleWriter the writer the element is filled from. + */ + void FillVehicleNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleWriter); + + /** + * Fills a dom element of type VehicleCatalogLocation + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleCatalogLocationWriter the writer the element is filled from. + */ + void FillVehicleCatalogLocationNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCatalogLocationWriter); + + /** + * Fills a dom element of type VehicleCategoryDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleCategoryDistributionWriter the writer the element is filled from. + */ + void FillVehicleCategoryDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCategoryDistributionWriter); + + /** + * Fills a dom element of type VehicleCategoryDistributionEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleCategoryDistributionEntryWriter the writer the element is filled from. + */ + void FillVehicleCategoryDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleCategoryDistributionEntryWriter); + + /** + * Fills a dom element of type VehicleComponent + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleComponentWriter the writer the element is filled from. + */ + void FillVehicleComponentNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleComponentWriter); + + /** + * Fills a dom element of type VehicleLight + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleLightWriter the writer the element is filled from. + */ + void FillVehicleLightNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleLightWriter); + + /** + * Fills a dom element of type VehicleRoleDistribution + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleRoleDistributionWriter the writer the element is filled from. + */ + void FillVehicleRoleDistributionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleRoleDistributionWriter); + + /** + * Fills a dom element of type VehicleRoleDistributionEntry + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vehicleRoleDistributionEntryWriter the writer the element is filled from. + */ + void FillVehicleRoleDistributionEntryNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vehicleRoleDistributionEntryWriter); + + /** + * Fills a dom element of type Vertex + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param vertexWriter the writer the element is filled from. + */ + void FillVertexNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr vertexWriter); + + /** + * Fills a dom element of type VisibilityAction + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param visibilityActionWriter the writer the element is filled from. + */ + void FillVisibilityActionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr visibilityActionWriter); + + /** + * Fills a dom element of type Waypoint + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param waypointWriter the writer the element is filled from. + */ + void FillWaypointNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr waypointWriter); + + /** + * Fills a dom element of type Weather + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param weatherWriter the writer the element is filled from. + */ + void FillWeatherNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr weatherWriter); + + /** + * Fills a dom element of type Wind + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param windWriter the writer the element is filled from. + */ + void FillWindNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr windWriter); + + /** + * Fills a dom element of type WorldPosition + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param worldPositionWriter the writer the element is filled from. + */ + void FillWorldPositionNode(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptr worldPositionWriter); + }; + + } +} + diff --git a/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.cpp new file mode 100644 index 00000000..e1752fee --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.cpp @@ -0,0 +1,94722 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ApiClassImplV1_3.h" +#include "OscConstantsV1_3.h" +#include "FileContentMessage.h" +#include "IOpenScenarioModelElement.h" +#include "ErrorLevel.h" +#include "NamedReferenceProxy.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + IOpenScenarioFlexElement* AbsoluteSpeedImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AbsoluteSpeedImpl::GetValue() const + { + return _value; + } + std::shared_ptr AbsoluteSpeedImpl::GetSteadyState() const + { + return _steadyState; + } + + + void AbsoluteSpeedImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void AbsoluteSpeedImpl::SetSteadyState(std::shared_ptr steadyState) + { + _steadyState = steadyState; + _isSetSteadyState = true; + } + + std::shared_ptr AbsoluteSpeedImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AbsoluteSpeedImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAbsoluteSpeed).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAbsoluteSpeedWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AbsoluteSpeedImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AbsoluteSpeedImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AbsoluteSpeedImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AbsoluteSpeedImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AbsoluteSpeedImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AbsoluteSpeedImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AbsoluteSpeedImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AbsoluteSpeedImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AbsoluteSpeedImpl::GetModelType() const + { + return "AbsoluteSpeed"; + } + + void AbsoluteSpeedImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string AbsoluteSpeedImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool AbsoluteSpeedImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr AbsoluteSpeedImpl::GetWriterSteadyState() const + { + return std::dynamic_pointer_cast(_steadyState); + } + + AbsoluteSpeedImpl::AbsoluteSpeedImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void AbsoluteSpeedImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType AbsoluteSpeedImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AbsoluteSpeedImpl::GetChildren() const + { + std::vector> result; + + const auto kSteadyState = GetWriterSteadyState(); + if (kSteadyState) + { + result.push_back(std::dynamic_pointer_cast(kSteadyState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AbsoluteSpeedImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + const auto kSteadyState = GetWriterSteadyState(); + if (kSteadyState) + { + auto clonedChild = std::dynamic_pointer_cast(kSteadyState)->Clone(); + auto clonedChildISteadyState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSteadyState(std::dynamic_pointer_cast(clonedChildISteadyState)); + } + return clonedObject; + } + + std::string AbsoluteSpeedImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteSpeedImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__STEADY_STATE) + { + return std::dynamic_pointer_cast(GetSteadyState()); + } + throw KeyNotSupportedException(); + } + + std::vector> AbsoluteSpeedImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteSpeedImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AbsoluteSpeedImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AbsoluteSpeedImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool AbsoluteSpeedImpl::IsSetValue() const + { + return _isSetValue; + } + void AbsoluteSpeedImpl::ResetSteadyState() + { + _isSetSteadyState = false; + _steadyState = {}; + + } + bool AbsoluteSpeedImpl::IsSetSteadyState() const + { + return _isSetSteadyState; + } + + IOpenScenarioFlexElement* AbsoluteTargetLaneImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string AbsoluteTargetLaneImpl::GetValue() const + { + return _value; + } + + + void AbsoluteTargetLaneImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr AbsoluteTargetLaneImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AbsoluteTargetLaneImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAbsoluteTargetLane).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAbsoluteTargetLaneWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AbsoluteTargetLaneImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AbsoluteTargetLaneImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AbsoluteTargetLaneImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AbsoluteTargetLaneImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AbsoluteTargetLaneImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AbsoluteTargetLaneImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AbsoluteTargetLaneImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AbsoluteTargetLaneImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AbsoluteTargetLaneImpl::GetModelType() const + { + return "AbsoluteTargetLane"; + } + + void AbsoluteTargetLaneImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string AbsoluteTargetLaneImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool AbsoluteTargetLaneImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AbsoluteTargetLaneImpl::AbsoluteTargetLaneImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void AbsoluteTargetLaneImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType AbsoluteTargetLaneImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AbsoluteTargetLaneImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AbsoluteTargetLaneImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string AbsoluteTargetLaneImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetLaneImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AbsoluteTargetLaneImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetLaneImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AbsoluteTargetLaneImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AbsoluteTargetLaneImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool AbsoluteTargetLaneImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* AbsoluteTargetLaneOffsetImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AbsoluteTargetLaneOffsetImpl::GetValue() const + { + return _value; + } + + + void AbsoluteTargetLaneOffsetImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr AbsoluteTargetLaneOffsetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AbsoluteTargetLaneOffsetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAbsoluteTargetLaneOffset).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAbsoluteTargetLaneOffsetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AbsoluteTargetLaneOffsetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AbsoluteTargetLaneOffsetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AbsoluteTargetLaneOffsetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AbsoluteTargetLaneOffsetImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AbsoluteTargetLaneOffsetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AbsoluteTargetLaneOffsetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AbsoluteTargetLaneOffsetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AbsoluteTargetLaneOffsetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AbsoluteTargetLaneOffsetImpl::GetModelType() const + { + return "AbsoluteTargetLaneOffset"; + } + + void AbsoluteTargetLaneOffsetImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string AbsoluteTargetLaneOffsetImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool AbsoluteTargetLaneOffsetImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AbsoluteTargetLaneOffsetImpl::AbsoluteTargetLaneOffsetImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void AbsoluteTargetLaneOffsetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType AbsoluteTargetLaneOffsetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AbsoluteTargetLaneOffsetImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AbsoluteTargetLaneOffsetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string AbsoluteTargetLaneOffsetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetLaneOffsetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AbsoluteTargetLaneOffsetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetLaneOffsetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AbsoluteTargetLaneOffsetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AbsoluteTargetLaneOffsetImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool AbsoluteTargetLaneOffsetImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* AbsoluteTargetSpeedImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AbsoluteTargetSpeedImpl::GetValue() const + { + return _value; + } + + + void AbsoluteTargetSpeedImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr AbsoluteTargetSpeedImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AbsoluteTargetSpeedImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAbsoluteTargetSpeed).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAbsoluteTargetSpeedWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AbsoluteTargetSpeedImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AbsoluteTargetSpeedImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AbsoluteTargetSpeedImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AbsoluteTargetSpeedImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AbsoluteTargetSpeedImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AbsoluteTargetSpeedImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AbsoluteTargetSpeedImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AbsoluteTargetSpeedImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AbsoluteTargetSpeedImpl::GetModelType() const + { + return "AbsoluteTargetSpeed"; + } + + void AbsoluteTargetSpeedImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string AbsoluteTargetSpeedImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool AbsoluteTargetSpeedImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AbsoluteTargetSpeedImpl::AbsoluteTargetSpeedImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void AbsoluteTargetSpeedImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType AbsoluteTargetSpeedImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AbsoluteTargetSpeedImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AbsoluteTargetSpeedImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string AbsoluteTargetSpeedImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetSpeedImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AbsoluteTargetSpeedImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AbsoluteTargetSpeedImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AbsoluteTargetSpeedImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AbsoluteTargetSpeedImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool AbsoluteTargetSpeedImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* AccelerationConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + DirectionalDimension AccelerationConditionImpl::GetDirection() const + { + return _direction; + } + Rule AccelerationConditionImpl::GetRule() const + { + return _rule; + } + double AccelerationConditionImpl::GetValue() const + { + return _value; + } + + + void AccelerationConditionImpl::SetDirection(const DirectionalDimension direction) + { + _direction = direction; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + _isSetDirection = true; + } + + void AccelerationConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void AccelerationConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr AccelerationConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AccelerationConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAccelerationCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAccelerationConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AccelerationConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AccelerationConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AccelerationConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AccelerationConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AccelerationConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AccelerationConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AccelerationConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AccelerationConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AccelerationConditionImpl::GetModelType() const + { + return "AccelerationCondition"; + } + + void AccelerationConditionImpl::WriteParameterToDirection(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, parameterName, nullTextMarker /*no textmarker*/); + _direction = {}; + } + + void AccelerationConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void AccelerationConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string AccelerationConditionImpl::GetParameterFromDirection() const + { + auto direction = OSC_CONSTANTS::ATTRIBUTE__DIRECTION; + return GetParameterNameFromAttribute(direction); + } + + std::string AccelerationConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string AccelerationConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool AccelerationConditionImpl::IsDirectionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool AccelerationConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool AccelerationConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AccelerationConditionImpl::AccelerationConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void AccelerationConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(parameterLiteralValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + _direction = kResult; + AddResolvedParameter(attributeKey); + _isSetDirection = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType AccelerationConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AccelerationConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AccelerationConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDirection = GetDirection(); + if ( kDirection.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_direction = DirectionalDimension::GetFromLiteral(kDirection.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetDirection = _isSetDirection; + // clone children + return clonedObject; + } + + std::string AccelerationConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AccelerationConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AccelerationConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AccelerationConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AccelerationConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + auto direction = GetDirection(); + return direction.GetLiteral() != "UNKNOWN" ? direction.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void AccelerationConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void AccelerationConditionImpl::ResetDirection() + { + _isSetDirection = false; + _direction = {}; + + } + bool AccelerationConditionImpl::IsSetDirection() const + { + return _isSetDirection; + } + bool AccelerationConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool AccelerationConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* AcquirePositionActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AcquirePositionActionImpl::GetPosition() const + { + return _position; + } + + + void AcquirePositionActionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr AcquirePositionActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AcquirePositionActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAcquirePositionAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAcquirePositionActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AcquirePositionActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AcquirePositionActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AcquirePositionActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AcquirePositionActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AcquirePositionActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AcquirePositionActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AcquirePositionActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AcquirePositionActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AcquirePositionActionImpl::GetModelType() const + { + return "AcquirePositionAction"; + } + + // children + std::shared_ptr AcquirePositionActionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + AcquirePositionActionImpl::AcquirePositionActionImpl() + { + /** + * Filling the property to type map + */ + } + + void AcquirePositionActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AcquirePositionActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AcquirePositionActionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AcquirePositionActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string AcquirePositionActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AcquirePositionActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> AcquirePositionActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AcquirePositionActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AcquirePositionActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool AcquirePositionActionImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* ActImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ActImpl::GetName() const + { + return _name; + } + std::vector> ActImpl::GetManeuverGroups() const + { + std::vector> temp; + for(auto&& elm: _maneuverGroups) + temp.push_back(elm); + return temp; + } + std::vector> ActImpl::GetWriterManeuverGroups() const + { + return _maneuverGroups; + } + + int ActImpl::GetManeuverGroupsSize() const + { + return static_cast(_maneuverGroups.size()); + } + + std::shared_ptr ActImpl::GetManeuverGroupsAtIndex(unsigned int index) const + { + if (index >= 0 && _maneuverGroups.size() > index) + { + return _maneuverGroups[index]; + } + return nullptr; + } + std::shared_ptr ActImpl::GetStartTrigger() const + { + return _startTrigger; + } + std::shared_ptr ActImpl::GetStopTrigger() const + { + return _stopTrigger; + } + + + void ActImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ActImpl::SetManeuverGroups(std::vector>& maneuverGroups) + { + _maneuverGroups = maneuverGroups; + _isSetManeuverGroups = true; + } + + void ActImpl::SetStartTrigger(std::shared_ptr startTrigger) + { + _startTrigger = startTrigger; + _isSetStartTrigger = true; + } + + void ActImpl::SetStopTrigger(std::shared_ptr stopTrigger) + { + _stopTrigger = stopTrigger; + _isSetStopTrigger = true; + } + + std::shared_ptr ActImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ActImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAct).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IActWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ActImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ActImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ActImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ActImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ActImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ActImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ActImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ActImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ActImpl::GetModelType() const + { + return "Act"; + } + + void ActImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ActImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ActImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ActImpl::GetWriterStartTrigger() const + { + return std::dynamic_pointer_cast(_startTrigger); + } + std::shared_ptr ActImpl::GetWriterStopTrigger() const + { + return std::dynamic_pointer_cast(_stopTrigger); + } + + ActImpl::ActImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ActImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ActImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ActImpl::GetChildren() const + { + std::vector> result; + + auto maneuverGroups = GetWriterManeuverGroups(); + if (!maneuverGroups.empty()) + { + for(auto&& item : maneuverGroups) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kStartTrigger = GetWriterStartTrigger(); + if (kStartTrigger) + { + result.push_back(std::dynamic_pointer_cast(kStartTrigger)); + } + const auto kStopTrigger = GetWriterStopTrigger(); + if (kStopTrigger) + { + result.push_back(std::dynamic_pointer_cast(kStopTrigger)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ActImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kManeuverGroups = GetWriterManeuverGroups(); + if (!kManeuverGroups.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kManeuverGroups) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetManeuverGroups(clonedList); + } + const auto kStartTrigger = GetWriterStartTrigger(); + if (kStartTrigger) + { + auto clonedChild = std::dynamic_pointer_cast(kStartTrigger)->Clone(); + auto clonedChildITrigger = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStartTrigger(std::dynamic_pointer_cast(clonedChildITrigger)); + } + const auto kStopTrigger = GetWriterStopTrigger(); + if (kStopTrigger) + { + auto clonedChild = std::dynamic_pointer_cast(kStopTrigger)->Clone(); + auto clonedChildITrigger = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStopTrigger(std::dynamic_pointer_cast(clonedChildITrigger)); + } + return clonedObject; + } + + std::string ActImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ActImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__START_TRIGGER) + { + return std::dynamic_pointer_cast(GetStartTrigger()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STOP_TRIGGER) + { + return std::dynamic_pointer_cast(GetStopTrigger()); + } + throw KeyNotSupportedException(); + } + + std::vector> ActImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__MANEUVER_GROUP) + { + std::vector> vect; + for (auto&& elem : GetManeuverGroups()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ActImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ActImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ActImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ActImpl::IsSetName() const + { + return _isSetName; + } + bool ActImpl::IsSetManeuverGroups() const + { + return _isSetManeuverGroups; + } + void ActImpl::ResetStartTrigger() + { + _isSetStartTrigger = false; + _startTrigger = {}; + + } + bool ActImpl::IsSetStartTrigger() const + { + return _isSetStartTrigger; + } + void ActImpl::ResetStopTrigger() + { + _isSetStopTrigger = false; + _stopTrigger = {}; + + } + bool ActImpl::IsSetStopTrigger() const + { + return _isSetStopTrigger; + } + + IOpenScenarioFlexElement* ActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ActionImpl::GetName() const + { + return _name; + } + std::shared_ptr ActionImpl::GetGlobalAction() const + { + return _globalAction; + } + std::shared_ptr ActionImpl::GetUserDefinedAction() const + { + return _userDefinedAction; + } + std::shared_ptr ActionImpl::GetPrivateAction() const + { + return _privateAction; + } + + + void ActionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ActionImpl::SetGlobalAction(std::shared_ptr globalAction) + { + _globalAction = globalAction; + _userDefinedAction = {}; + _privateAction = {}; + _isSetGlobalAction = true; + } + + void ActionImpl::SetUserDefinedAction(std::shared_ptr userDefinedAction) + { + _userDefinedAction = userDefinedAction; + _globalAction = {}; + _privateAction = {}; + _isSetUserDefinedAction = true; + } + + void ActionImpl::SetPrivateAction(std::shared_ptr privateAction) + { + _privateAction = privateAction; + _globalAction = {}; + _userDefinedAction = {}; + _isSetPrivateAction = true; + } + + std::shared_ptr ActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ActionImpl::GetModelType() const + { + return "Action"; + } + + void ActionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ActionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ActionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ActionImpl::GetWriterGlobalAction() const + { + return std::dynamic_pointer_cast(_globalAction); + } + std::shared_ptr ActionImpl::GetWriterUserDefinedAction() const + { + return std::dynamic_pointer_cast(_userDefinedAction); + } + std::shared_ptr ActionImpl::GetWriterPrivateAction() const + { + return std::dynamic_pointer_cast(_privateAction); + } + + ActionImpl::ActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ActionImpl::GetChildren() const + { + std::vector> result; + + const auto kGlobalAction = GetWriterGlobalAction(); + if (kGlobalAction) + { + result.push_back(std::dynamic_pointer_cast(kGlobalAction)); + } + const auto kUserDefinedAction = GetWriterUserDefinedAction(); + if (kUserDefinedAction) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedAction)); + } + const auto kPrivateAction = GetWriterPrivateAction(); + if (kPrivateAction) + { + result.push_back(std::dynamic_pointer_cast(kPrivateAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kGlobalAction = GetWriterGlobalAction(); + if (kGlobalAction) + { + auto clonedChild = std::dynamic_pointer_cast(kGlobalAction)->Clone(); + auto clonedChildIGlobalAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetGlobalAction(std::dynamic_pointer_cast(clonedChildIGlobalAction)); + } + const auto kUserDefinedAction = GetWriterUserDefinedAction(); + if (kUserDefinedAction) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedAction)->Clone(); + auto clonedChildIUserDefinedAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedAction(std::dynamic_pointer_cast(clonedChildIUserDefinedAction)); + } + const auto kPrivateAction = GetWriterPrivateAction(); + if (kPrivateAction) + { + auto clonedChild = std::dynamic_pointer_cast(kPrivateAction)->Clone(); + auto clonedChildIPrivateAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPrivateAction(std::dynamic_pointer_cast(clonedChildIPrivateAction)); + } + return clonedObject; + } + + std::string ActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION) + { + return std::dynamic_pointer_cast(GetGlobalAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION) + { + return std::dynamic_pointer_cast(GetUserDefinedAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION) + { + return std::dynamic_pointer_cast(GetPrivateAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> ActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ActionImpl::IsSetName() const + { + return _isSetName; + } + bool ActionImpl::IsSetGlobalAction() const + { + return _isSetGlobalAction; + } + bool ActionImpl::IsSetUserDefinedAction() const + { + return _isSetUserDefinedAction; + } + bool ActionImpl::IsSetPrivateAction() const + { + return _isSetPrivateAction; + } + + IOpenScenarioFlexElement* ActivateControllerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool ActivateControllerActionImpl::GetAnimation() const + { + return _animation; + } + std::shared_ptr> ActivateControllerActionImpl::GetControllerRef() const + { + return _controllerRef; + } + bool ActivateControllerActionImpl::GetLateral() const + { + return _lateral; + } + bool ActivateControllerActionImpl::GetLighting() const + { + return _lighting; + } + bool ActivateControllerActionImpl::GetLongitudinal() const + { + return _longitudinal; + } + std::shared_ptr> ActivateControllerActionImpl::GetObjectControllerRef() const + { + return _objectControllerRef; + } + + + void ActivateControllerActionImpl::SetAnimation(const bool animation) + { + _animation = animation; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION); + _isSetAnimation = true; + } + + void ActivateControllerActionImpl::SetControllerRef(std::shared_ptr> controllerRef) + { + _controllerRef = controllerRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF); + _isSetControllerRef = true; + } + + void ActivateControllerActionImpl::SetLateral(const bool lateral) + { + _lateral = lateral; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATERAL); + _isSetLateral = true; + } + + void ActivateControllerActionImpl::SetLighting(const bool lighting) + { + _lighting = lighting; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LIGHTING); + _isSetLighting = true; + } + + void ActivateControllerActionImpl::SetLongitudinal(const bool longitudinal) + { + _longitudinal = longitudinal; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL); + _isSetLongitudinal = true; + } + + void ActivateControllerActionImpl::SetObjectControllerRef(std::shared_ptr> objectControllerRef) + { + _objectControllerRef = objectControllerRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF); + _isSetObjectControllerRef = true; + } + + std::shared_ptr ActivateControllerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ActivateControllerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IActivateControllerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IActivateControllerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ActivateControllerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ActivateControllerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ActivateControllerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ActivateControllerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ActivateControllerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ActivateControllerActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + return GetAnimation(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LATERAL) + { + return GetLateral(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LIGHTING) + { + return GetLighting(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL) + { + return GetLongitudinal(); + } + throw KeyNotSupportedException(); + + } + + DateTime ActivateControllerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ActivateControllerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ActivateControllerActionImpl::GetModelType() const + { + return "ActivateControllerAction"; + } + + void ActivateControllerActionImpl::WriteParameterToAnimation(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, parameterName, nullTextMarker /*no textmarker*/); + _animation = {}; + } + + void ActivateControllerActionImpl::WriteParameterToControllerRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, parameterName, nullTextMarker /*no textmarker*/); + _controllerRef = {}; + } + + void ActivateControllerActionImpl::WriteParameterToLateral(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATERAL, parameterName, nullTextMarker /*no textmarker*/); + _lateral = {}; + } + + void ActivateControllerActionImpl::WriteParameterToLighting(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, parameterName, nullTextMarker /*no textmarker*/); + _lighting = {}; + } + + void ActivateControllerActionImpl::WriteParameterToLongitudinal(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, parameterName, nullTextMarker /*no textmarker*/); + _longitudinal = {}; + } + + void ActivateControllerActionImpl::WriteParameterToObjectControllerRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, parameterName, nullTextMarker /*no textmarker*/); + _objectControllerRef = {}; + } + + std::string ActivateControllerActionImpl::GetParameterFromAnimation() const + { + auto animation = OSC_CONSTANTS::ATTRIBUTE__ANIMATION; + return GetParameterNameFromAttribute(animation); + } + + std::string ActivateControllerActionImpl::GetParameterFromControllerRef() const + { + auto controllerRef = OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF; + return GetParameterNameFromAttribute(controllerRef); + } + + std::string ActivateControllerActionImpl::GetParameterFromLateral() const + { + auto lateral = OSC_CONSTANTS::ATTRIBUTE__LATERAL; + return GetParameterNameFromAttribute(lateral); + } + + std::string ActivateControllerActionImpl::GetParameterFromLighting() const + { + auto lighting = OSC_CONSTANTS::ATTRIBUTE__LIGHTING; + return GetParameterNameFromAttribute(lighting); + } + + std::string ActivateControllerActionImpl::GetParameterFromLongitudinal() const + { + auto longitudinal = OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL; + return GetParameterNameFromAttribute(longitudinal); + } + + std::string ActivateControllerActionImpl::GetParameterFromObjectControllerRef() const + { + auto objectControllerRef = OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF; + return GetParameterNameFromAttribute(objectControllerRef); + } + + bool ActivateControllerActionImpl::IsAnimationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANIMATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool ActivateControllerActionImpl::IsControllerRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool ActivateControllerActionImpl::IsLateralParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LATERAL); + if (kIt != keys.end()) + return true; + return false; + } + + bool ActivateControllerActionImpl::IsLightingParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LIGHTING); + if (kIt != keys.end()) + return true; + return false; + } + + bool ActivateControllerActionImpl::IsLongitudinalParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL); + if (kIt != keys.end()) + return true; + return false; + } + + bool ActivateControllerActionImpl::IsObjectControllerRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ActivateControllerActionImpl::ActivateControllerActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LATERAL, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, SimpleType::STRING); + } + + void ActivateControllerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + // Simple type + _animation = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAnimation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _controllerRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetControllerRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATERAL) + { + // Simple type + _lateral = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLateral = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LIGHTING) + { + // Simple type + _lighting = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLighting = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL) + { + // Simple type + _longitudinal = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLongitudinal = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _objectControllerRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetObjectControllerRef = true; + } + } + + SimpleType ActivateControllerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ActivateControllerActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ActivateControllerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_animation = GetAnimation(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetControllerRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_controllerRef = proxy; + + // Simple type + clonedObject->_lateral = GetLateral(); + // Simple type + clonedObject->_lighting = GetLighting(); + // Simple type + clonedObject->_longitudinal = GetLongitudinal(); + // Proxy + auto proxy1 = std::make_shared>(*std::dynamic_pointer_cast>(GetObjectControllerRef())); + proxy1->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_objectControllerRef = proxy1; + + // clone indicators + clonedObject->_isSetAnimation = _isSetAnimation; + clonedObject->_isSetControllerRef = _isSetControllerRef; + clonedObject->_isSetLateral = _isSetLateral; + clonedObject->_isSetLighting = _isSetLighting; + clonedObject->_isSetLongitudinal = _isSetLongitudinal; + clonedObject->_isSetObjectControllerRef = _isSetObjectControllerRef; + // clone children + return clonedObject; + } + + std::string ActivateControllerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF) + { + // Get the Proxy + auto controllerRef = GetControllerRef(); + return controllerRef!= nullptr ? controllerRef->GetNameRef() : ""; + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF) + { + // Get the Proxy + auto objectControllerRef = GetObjectControllerRef(); + return objectControllerRef!= nullptr ? objectControllerRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ActivateControllerActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ActivateControllerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ActivateControllerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF) + { + // Get the Proxy + auto controllerRef = GetControllerRef(); + return controllerRef != nullptr ? std::dynamic_pointer_cast(controllerRef->GetTargetObject()) : nullptr; + } + if (key == OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF) + { + // Get the Proxy + auto objectControllerRef = GetObjectControllerRef(); + return objectControllerRef != nullptr ? std::dynamic_pointer_cast(objectControllerRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string ActivateControllerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ActivateControllerActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + // Simple type + _animation = value; + AddResolvedParameter(attributeKey); + _isSetAnimation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATERAL) + { + // Simple type + _lateral = value; + AddResolvedParameter(attributeKey); + _isSetLateral = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LIGHTING) + { + // Simple type + _lighting = value; + AddResolvedParameter(attributeKey); + _isSetLighting = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL) + { + // Simple type + _longitudinal = value; + AddResolvedParameter(attributeKey); + _isSetLongitudinal = true; + } + + } + + + void ActivateControllerActionImpl::ResetAnimation() + { + _isSetAnimation = false; + _animation = {}; + + } + bool ActivateControllerActionImpl::IsSetAnimation() const + { + return _isSetAnimation; + } + void ActivateControllerActionImpl::ResetControllerRef() + { + _isSetControllerRef = false; + _controllerRef = nullptr; + + } + bool ActivateControllerActionImpl::IsSetControllerRef() const + { + return _isSetControllerRef; + } + void ActivateControllerActionImpl::ResetLateral() + { + _isSetLateral = false; + _lateral = {}; + + } + bool ActivateControllerActionImpl::IsSetLateral() const + { + return _isSetLateral; + } + void ActivateControllerActionImpl::ResetLighting() + { + _isSetLighting = false; + _lighting = {}; + + } + bool ActivateControllerActionImpl::IsSetLighting() const + { + return _isSetLighting; + } + void ActivateControllerActionImpl::ResetLongitudinal() + { + _isSetLongitudinal = false; + _longitudinal = {}; + + } + bool ActivateControllerActionImpl::IsSetLongitudinal() const + { + return _isSetLongitudinal; + } + void ActivateControllerActionImpl::ResetObjectControllerRef() + { + _isSetObjectControllerRef = false; + _objectControllerRef = nullptr; + + } + bool ActivateControllerActionImpl::IsSetObjectControllerRef() const + { + return _isSetObjectControllerRef; + } + + IOpenScenarioFlexElement* ActorsImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool ActorsImpl::GetSelectTriggeringEntities() const + { + return _selectTriggeringEntities; + } + std::vector> ActorsImpl::GetEntityRefs() const + { + std::vector> temp; + for(auto&& elm: _entityRefs) + temp.push_back(elm); + return temp; + } + std::vector> ActorsImpl::GetWriterEntityRefs() const + { + return _entityRefs; + } + + int ActorsImpl::GetEntityRefsSize() const + { + return static_cast(_entityRefs.size()); + } + + std::shared_ptr ActorsImpl::GetEntityRefsAtIndex(unsigned int index) const + { + if (index >= 0 && _entityRefs.size() > index) + { + return _entityRefs[index]; + } + return nullptr; + } + + + void ActorsImpl::SetSelectTriggeringEntities(const bool selectTriggeringEntities) + { + _selectTriggeringEntities = selectTriggeringEntities; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES); + _isSetSelectTriggeringEntities = true; + } + + void ActorsImpl::SetEntityRefs(std::vector>& entityRefs) + { + _entityRefs = entityRefs; + _isSetEntityRefs = true; + } + + std::shared_ptr ActorsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ActorsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IActors).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IActorsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ActorsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ActorsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ActorsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ActorsImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ActorsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ActorsImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES) + { + return GetSelectTriggeringEntities(); + } + throw KeyNotSupportedException(); + + } + + DateTime ActorsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ActorsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ActorsImpl::GetModelType() const + { + return "Actors"; + } + + void ActorsImpl::WriteParameterToSelectTriggeringEntities(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, parameterName, nullTextMarker /*no textmarker*/); + _selectTriggeringEntities = {}; + } + + std::string ActorsImpl::GetParameterFromSelectTriggeringEntities() const + { + auto selectTriggeringEntities = OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES; + return GetParameterNameFromAttribute(selectTriggeringEntities); + } + + bool ActorsImpl::IsSelectTriggeringEntitiesParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ActorsImpl::ActorsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, SimpleType::BOOLEAN); + } + + void ActorsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES) + { + // Simple type + _selectTriggeringEntities = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSelectTriggeringEntities = true; + } + } + + SimpleType ActorsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ActorsImpl::GetChildren() const + { + std::vector> result; + + auto entityRefs = GetWriterEntityRefs(); + if (!entityRefs.empty()) + { + for(auto&& item : entityRefs) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ActorsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_selectTriggeringEntities = GetSelectTriggeringEntities(); + // clone indicators + // clone children + const auto kEntityRefs = GetWriterEntityRefs(); + if (!kEntityRefs.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntityRefs) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntityRefs(clonedList); + } + return clonedObject; + } + + std::string ActorsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ActorsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ActorsImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + std::vector> vect; + for (auto&& elem : GetEntityRefs()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ActorsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ActorsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ActorsImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES) + { + // Simple type + _selectTriggeringEntities = value; + AddResolvedParameter(attributeKey); + _isSetSelectTriggeringEntities = true; + } + + } + + + bool ActorsImpl::IsSetSelectTriggeringEntities() const + { + return _isSetSelectTriggeringEntities; + } + void ActorsImpl::ResetEntityRefs() + { + _isSetEntityRefs = false; + _entityRefs = {}; + + } + bool ActorsImpl::IsSetEntityRefs() const + { + return _isSetEntityRefs; + } + + IOpenScenarioFlexElement* AddEntityActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AddEntityActionImpl::GetPosition() const + { + return _position; + } + + + void AddEntityActionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr AddEntityActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AddEntityActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAddEntityAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAddEntityActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AddEntityActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AddEntityActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AddEntityActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AddEntityActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AddEntityActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AddEntityActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AddEntityActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AddEntityActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AddEntityActionImpl::GetModelType() const + { + return "AddEntityAction"; + } + + // children + std::shared_ptr AddEntityActionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + AddEntityActionImpl::AddEntityActionImpl() + { + /** + * Filling the property to type map + */ + } + + void AddEntityActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AddEntityActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AddEntityActionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AddEntityActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string AddEntityActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AddEntityActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> AddEntityActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AddEntityActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AddEntityActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool AddEntityActionImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* AngleConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AngleConditionImpl::GetAngle() const + { + return _angle; + } + double AngleConditionImpl::GetAngleTolerance() const + { + return _angleTolerance; + } + AngleType AngleConditionImpl::GetAngleType() const + { + return _angleType; + } + CoordinateSystem AngleConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + + + void AngleConditionImpl::SetAngle(const double angle) + { + _angle = angle; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE); + _isSetAngle = true; + } + + void AngleConditionImpl::SetAngleTolerance(const double angleTolerance) + { + _angleTolerance = angleTolerance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE); + _isSetAngleTolerance = true; + } + + void AngleConditionImpl::SetAngleType(const AngleType angleType) + { + _angleType = angleType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE); + _isSetAngleType = true; + } + + void AngleConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + std::shared_ptr AngleConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AngleConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAngleCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAngleConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AngleConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AngleConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AngleConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AngleConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + return GetAngle(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + return GetAngleTolerance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AngleConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AngleConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AngleConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AngleConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AngleConditionImpl::GetModelType() const + { + return "AngleCondition"; + } + + void AngleConditionImpl::WriteParameterToAngle(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, parameterName, nullTextMarker /*no textmarker*/); + _angle = {}; + } + + void AngleConditionImpl::WriteParameterToAngleTolerance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, parameterName, nullTextMarker /*no textmarker*/); + _angleTolerance = {}; + } + + void AngleConditionImpl::WriteParameterToAngleType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _angleType = {}; + } + + void AngleConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + std::string AngleConditionImpl::GetParameterFromAngle() const + { + auto angle = OSC_CONSTANTS::ATTRIBUTE__ANGLE; + return GetParameterNameFromAttribute(angle); + } + + std::string AngleConditionImpl::GetParameterFromAngleTolerance() const + { + auto angleTolerance = OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE; + return GetParameterNameFromAttribute(angleTolerance); + } + + std::string AngleConditionImpl::GetParameterFromAngleType() const + { + auto angleType = OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE; + return GetParameterNameFromAttribute(angleType); + } + + std::string AngleConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + bool AngleConditionImpl::IsAngleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE); + if (kIt != keys.end()) + return true; + return false; + } + + bool AngleConditionImpl::IsAngleToleranceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool AngleConditionImpl::IsAngleTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool AngleConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AngleConditionImpl::AngleConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + } + + void AngleConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + // Simple type + _angle = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAngle = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + // Simple type + _angleTolerance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAngleTolerance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE) + { + // Enumeration Type + const auto kResult = AngleType::GetFromLiteral(parameterLiteralValue); + if (kResult != AngleType::UNKNOWN) + { + _angleType = kResult; + AddResolvedParameter(attributeKey); + _isSetAngleType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType AngleConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AngleConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AngleConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_angle = GetAngle(); + // Simple type + clonedObject->_angleTolerance = GetAngleTolerance(); + // Enumeration Type + const auto kAngleType = GetAngleType(); + if ( kAngleType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_angleType = AngleType::GetFromLiteral(kAngleType.GetLiteral()); + } + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // clone indicators + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + // clone children + return clonedObject; + } + + std::string AngleConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AngleConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AngleConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AngleConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AngleConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE) + { + auto angleType = GetAngleType(); + return angleType.GetLiteral() != "UNKNOWN" ? angleType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void AngleConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + // Simple type + _angle = value; + AddResolvedParameter(attributeKey); + _isSetAngle = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + // Simple type + _angleTolerance = value; + AddResolvedParameter(attributeKey); + _isSetAngleTolerance = true; + } + + } + + + bool AngleConditionImpl::IsSetAngle() const + { + return _isSetAngle; + } + bool AngleConditionImpl::IsSetAngleTolerance() const + { + return _isSetAngleTolerance; + } + bool AngleConditionImpl::IsSetAngleType() const + { + return _isSetAngleType; + } + void AngleConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {}; + + } + bool AngleConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + + IOpenScenarioFlexElement* AnimationActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AnimationActionImpl::GetAnimationDuration() const + { + return _animationDuration; + } + bool AnimationActionImpl::GetLoop() const + { + return _loop; + } + std::shared_ptr AnimationActionImpl::GetAnimationType() const + { + return _animationType; + } + std::shared_ptr AnimationActionImpl::GetAnimationState() const + { + return _animationState; + } + + + void AnimationActionImpl::SetAnimationDuration(const double animationDuration) + { + _animationDuration = animationDuration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION); + _isSetAnimationDuration = true; + } + + void AnimationActionImpl::SetLoop(const bool loop) + { + _loop = loop; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOOP); + _isSetLoop = true; + } + + void AnimationActionImpl::SetAnimationType(std::shared_ptr animationType) + { + _animationType = animationType; + _isSetAnimationType = true; + } + + void AnimationActionImpl::SetAnimationState(std::shared_ptr animationState) + { + _animationState = animationState; + _isSetAnimationState = true; + } + + std::shared_ptr AnimationActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AnimationActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAnimationAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAnimationActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AnimationActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AnimationActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AnimationActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AnimationActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION) + { + return GetAnimationDuration(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AnimationActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AnimationActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LOOP) + { + return GetLoop(); + } + throw KeyNotSupportedException(); + + } + + DateTime AnimationActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AnimationActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AnimationActionImpl::GetModelType() const + { + return "AnimationAction"; + } + + void AnimationActionImpl::WriteParameterToAnimationDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, parameterName, nullTextMarker /*no textmarker*/); + _animationDuration = {}; + } + + void AnimationActionImpl::WriteParameterToLoop(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOOP, parameterName, nullTextMarker /*no textmarker*/); + _loop = {}; + } + + std::string AnimationActionImpl::GetParameterFromAnimationDuration() const + { + auto animationDuration = OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION; + return GetParameterNameFromAttribute(animationDuration); + } + + std::string AnimationActionImpl::GetParameterFromLoop() const + { + auto loop = OSC_CONSTANTS::ATTRIBUTE__LOOP; + return GetParameterNameFromAttribute(loop); + } + + bool AnimationActionImpl::IsAnimationDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool AnimationActionImpl::IsLoopParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LOOP); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr AnimationActionImpl::GetWriterAnimationType() const + { + return std::dynamic_pointer_cast(_animationType); + } + std::shared_ptr AnimationActionImpl::GetWriterAnimationState() const + { + return std::dynamic_pointer_cast(_animationState); + } + + AnimationActionImpl::AnimationActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LOOP, SimpleType::BOOLEAN); + } + + void AnimationActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION) + { + // Simple type + _animationDuration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAnimationDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LOOP) + { + // Simple type + _loop = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLoop = true; + } + } + + SimpleType AnimationActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AnimationActionImpl::GetChildren() const + { + std::vector> result; + + const auto kAnimationType = GetWriterAnimationType(); + if (kAnimationType) + { + result.push_back(std::dynamic_pointer_cast(kAnimationType)); + } + const auto kAnimationState = GetWriterAnimationState(); + if (kAnimationState) + { + result.push_back(std::dynamic_pointer_cast(kAnimationState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AnimationActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_animationDuration = GetAnimationDuration(); + // Simple type + clonedObject->_loop = GetLoop(); + // clone indicators + clonedObject->_isSetAnimationDuration = _isSetAnimationDuration; + clonedObject->_isSetLoop = _isSetLoop; + // clone children + const auto kAnimationType = GetWriterAnimationType(); + if (kAnimationType) + { + auto clonedChild = std::dynamic_pointer_cast(kAnimationType)->Clone(); + auto clonedChildIAnimationType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAnimationType(std::dynamic_pointer_cast(clonedChildIAnimationType)); + } + const auto kAnimationState = GetWriterAnimationState(); + if (kAnimationState) + { + auto clonedChild = std::dynamic_pointer_cast(kAnimationState)->Clone(); + auto clonedChildIAnimationState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAnimationState(std::dynamic_pointer_cast(clonedChildIAnimationState)); + } + return clonedObject; + } + + std::string AnimationActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ANIMATION_TYPE) + { + return std::dynamic_pointer_cast(GetAnimationType()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ANIMATION_STATE) + { + return std::dynamic_pointer_cast(GetAnimationState()); + } + throw KeyNotSupportedException(); + } + + std::vector> AnimationActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AnimationActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AnimationActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LOOP) + { + // Simple type + _loop = value; + AddResolvedParameter(attributeKey); + _isSetLoop = true; + } + + } + void AnimationActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION) + { + // Simple type + _animationDuration = value; + AddResolvedParameter(attributeKey); + _isSetAnimationDuration = true; + } + + } + + + void AnimationActionImpl::ResetAnimationDuration() + { + _isSetAnimationDuration = false; + _animationDuration = {}; + + } + bool AnimationActionImpl::IsSetAnimationDuration() const + { + return _isSetAnimationDuration; + } + void AnimationActionImpl::ResetLoop() + { + _isSetLoop = false; + _loop = {false}; + + } + bool AnimationActionImpl::IsSetLoop() const + { + return _isSetLoop; + } + bool AnimationActionImpl::IsSetAnimationType() const + { + return _isSetAnimationType; + } + void AnimationActionImpl::ResetAnimationState() + { + _isSetAnimationState = false; + _animationState = {}; + + } + bool AnimationActionImpl::IsSetAnimationState() const + { + return _isSetAnimationState; + } + + IOpenScenarioFlexElement* AnimationFileImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AnimationFileImpl::GetTimeOffset() const + { + return _timeOffset; + } + std::shared_ptr AnimationFileImpl::GetFile() const + { + return _file; + } + + + void AnimationFileImpl::SetTimeOffset(const double timeOffset) + { + _timeOffset = timeOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET); + _isSetTimeOffset = true; + } + + void AnimationFileImpl::SetFile(std::shared_ptr file) + { + _file = file; + _isSetFile = true; + } + + std::shared_ptr AnimationFileImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AnimationFileImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAnimationFile).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAnimationFileWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AnimationFileImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AnimationFileImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AnimationFileImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AnimationFileImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET) + { + return GetTimeOffset(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AnimationFileImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AnimationFileImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AnimationFileImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AnimationFileImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AnimationFileImpl::GetModelType() const + { + return "AnimationFile"; + } + + void AnimationFileImpl::WriteParameterToTimeOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _timeOffset = {}; + } + + std::string AnimationFileImpl::GetParameterFromTimeOffset() const + { + auto timeOffset = OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET; + return GetParameterNameFromAttribute(timeOffset); + } + + bool AnimationFileImpl::IsTimeOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr AnimationFileImpl::GetWriterFile() const + { + return std::dynamic_pointer_cast(_file); + } + + AnimationFileImpl::AnimationFileImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, SimpleType::DOUBLE); + } + + void AnimationFileImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET) + { + // Simple type + _timeOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTimeOffset = true; + } + } + + SimpleType AnimationFileImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AnimationFileImpl::GetChildren() const + { + std::vector> result; + + const auto kFile = GetWriterFile(); + if (kFile) + { + result.push_back(std::dynamic_pointer_cast(kFile)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AnimationFileImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_timeOffset = GetTimeOffset(); + // clone indicators + clonedObject->_isSetTimeOffset = _isSetTimeOffset; + // clone children + const auto kFile = GetWriterFile(); + if (kFile) + { + auto clonedChild = std::dynamic_pointer_cast(kFile)->Clone(); + auto clonedChildIFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFile(std::dynamic_pointer_cast(clonedChildIFile)); + } + return clonedObject; + } + + std::string AnimationFileImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationFileImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__FILE) + { + return std::dynamic_pointer_cast(GetFile()); + } + throw KeyNotSupportedException(); + } + + std::vector> AnimationFileImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationFileImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AnimationFileImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AnimationFileImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET) + { + // Simple type + _timeOffset = value; + AddResolvedParameter(attributeKey); + _isSetTimeOffset = true; + } + + } + + + void AnimationFileImpl::ResetTimeOffset() + { + _isSetTimeOffset = false; + _timeOffset = {}; + + } + bool AnimationFileImpl::IsSetTimeOffset() const + { + return _isSetTimeOffset; + } + bool AnimationFileImpl::IsSetFile() const + { + return _isSetFile; + } + + IOpenScenarioFlexElement* AnimationStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AnimationStateImpl::GetState() const + { + return _state; + } + + + void AnimationStateImpl::SetState(const double state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + std::shared_ptr AnimationStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AnimationStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAnimationState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAnimationStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AnimationStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AnimationStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AnimationStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AnimationStateImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + return GetState(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AnimationStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AnimationStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AnimationStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AnimationStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AnimationStateImpl::GetModelType() const + { + return "AnimationState"; + } + + void AnimationStateImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + std::string AnimationStateImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + bool AnimationStateImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AnimationStateImpl::AnimationStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::DOUBLE); + } + + void AnimationStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetState = true; + } + } + + SimpleType AnimationStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AnimationStateImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AnimationStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_state = GetState(); + // clone indicators + // clone children + return clonedObject; + } + + std::string AnimationStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationStateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AnimationStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AnimationStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AnimationStateImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = value; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + + } + + + bool AnimationStateImpl::IsSetState() const + { + return _isSetState; + } + + IOpenScenarioFlexElement* AnimationTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AnimationTypeImpl::GetComponentAnimation() const + { + return _componentAnimation; + } + std::shared_ptr AnimationTypeImpl::GetPedestrianAnimation() const + { + return _pedestrianAnimation; + } + std::shared_ptr AnimationTypeImpl::GetAnimationFile() const + { + return _animationFile; + } + std::shared_ptr AnimationTypeImpl::GetUserDefinedAnimation() const + { + return _userDefinedAnimation; + } + + + void AnimationTypeImpl::SetComponentAnimation(std::shared_ptr componentAnimation) + { + _componentAnimation = componentAnimation; + _pedestrianAnimation = {}; + _animationFile = {}; + _userDefinedAnimation = {}; + _isSetComponentAnimation = true; + } + + void AnimationTypeImpl::SetPedestrianAnimation(std::shared_ptr pedestrianAnimation) + { + _pedestrianAnimation = pedestrianAnimation; + _componentAnimation = {}; + _animationFile = {}; + _userDefinedAnimation = {}; + _isSetPedestrianAnimation = true; + } + + void AnimationTypeImpl::SetAnimationFile(std::shared_ptr animationFile) + { + _animationFile = animationFile; + _componentAnimation = {}; + _pedestrianAnimation = {}; + _userDefinedAnimation = {}; + _isSetAnimationFile = true; + } + + void AnimationTypeImpl::SetUserDefinedAnimation(std::shared_ptr userDefinedAnimation) + { + _userDefinedAnimation = userDefinedAnimation; + _componentAnimation = {}; + _pedestrianAnimation = {}; + _animationFile = {}; + _isSetUserDefinedAnimation = true; + } + + std::shared_ptr AnimationTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AnimationTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAnimationType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAnimationTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AnimationTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AnimationTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AnimationTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AnimationTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AnimationTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AnimationTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AnimationTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AnimationTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AnimationTypeImpl::GetModelType() const + { + return "AnimationType"; + } + + // children + std::shared_ptr AnimationTypeImpl::GetWriterComponentAnimation() const + { + return std::dynamic_pointer_cast(_componentAnimation); + } + std::shared_ptr AnimationTypeImpl::GetWriterPedestrianAnimation() const + { + return std::dynamic_pointer_cast(_pedestrianAnimation); + } + std::shared_ptr AnimationTypeImpl::GetWriterAnimationFile() const + { + return std::dynamic_pointer_cast(_animationFile); + } + std::shared_ptr AnimationTypeImpl::GetWriterUserDefinedAnimation() const + { + return std::dynamic_pointer_cast(_userDefinedAnimation); + } + + AnimationTypeImpl::AnimationTypeImpl() + { + /** + * Filling the property to type map + */ + } + + void AnimationTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AnimationTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AnimationTypeImpl::GetChildren() const + { + std::vector> result; + + const auto kComponentAnimation = GetWriterComponentAnimation(); + if (kComponentAnimation) + { + result.push_back(std::dynamic_pointer_cast(kComponentAnimation)); + } + const auto kPedestrianAnimation = GetWriterPedestrianAnimation(); + if (kPedestrianAnimation) + { + result.push_back(std::dynamic_pointer_cast(kPedestrianAnimation)); + } + const auto kAnimationFile = GetWriterAnimationFile(); + if (kAnimationFile) + { + result.push_back(std::dynamic_pointer_cast(kAnimationFile)); + } + const auto kUserDefinedAnimation = GetWriterUserDefinedAnimation(); + if (kUserDefinedAnimation) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedAnimation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AnimationTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kComponentAnimation = GetWriterComponentAnimation(); + if (kComponentAnimation) + { + auto clonedChild = std::dynamic_pointer_cast(kComponentAnimation)->Clone(); + auto clonedChildIComponentAnimation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetComponentAnimation(std::dynamic_pointer_cast(clonedChildIComponentAnimation)); + } + const auto kPedestrianAnimation = GetWriterPedestrianAnimation(); + if (kPedestrianAnimation) + { + auto clonedChild = std::dynamic_pointer_cast(kPedestrianAnimation)->Clone(); + auto clonedChildIPedestrianAnimation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPedestrianAnimation(std::dynamic_pointer_cast(clonedChildIPedestrianAnimation)); + } + const auto kAnimationFile = GetWriterAnimationFile(); + if (kAnimationFile) + { + auto clonedChild = std::dynamic_pointer_cast(kAnimationFile)->Clone(); + auto clonedChildIAnimationFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAnimationFile(std::dynamic_pointer_cast(clonedChildIAnimationFile)); + } + const auto kUserDefinedAnimation = GetWriterUserDefinedAnimation(); + if (kUserDefinedAnimation) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedAnimation)->Clone(); + auto clonedChildIUserDefinedAnimation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedAnimation(std::dynamic_pointer_cast(clonedChildIUserDefinedAnimation)); + } + return clonedObject; + } + + std::string AnimationTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationTypeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION) + { + return std::dynamic_pointer_cast(GetComponentAnimation()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION) + { + return std::dynamic_pointer_cast(GetPedestrianAnimation()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ANIMATION_FILE) + { + return std::dynamic_pointer_cast(GetAnimationFile()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION) + { + return std::dynamic_pointer_cast(GetUserDefinedAnimation()); + } + throw KeyNotSupportedException(); + } + + std::vector> AnimationTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AnimationTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AnimationTypeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool AnimationTypeImpl::IsSetComponentAnimation() const + { + return _isSetComponentAnimation; + } + bool AnimationTypeImpl::IsSetPedestrianAnimation() const + { + return _isSetPedestrianAnimation; + } + bool AnimationTypeImpl::IsSetAnimationFile() const + { + return _isSetAnimationFile; + } + bool AnimationTypeImpl::IsSetUserDefinedAnimation() const + { + return _isSetUserDefinedAnimation; + } + + IOpenScenarioFlexElement* AppearanceActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AppearanceActionImpl::GetLightStateAction() const + { + return _lightStateAction; + } + std::shared_ptr AppearanceActionImpl::GetAnimationAction() const + { + return _animationAction; + } + + + void AppearanceActionImpl::SetLightStateAction(std::shared_ptr lightStateAction) + { + _lightStateAction = lightStateAction; + _animationAction = {}; + _isSetLightStateAction = true; + } + + void AppearanceActionImpl::SetAnimationAction(std::shared_ptr animationAction) + { + _animationAction = animationAction; + _lightStateAction = {}; + _isSetAnimationAction = true; + } + + std::shared_ptr AppearanceActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AppearanceActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAppearanceAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAppearanceActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AppearanceActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AppearanceActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AppearanceActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AppearanceActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AppearanceActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AppearanceActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AppearanceActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AppearanceActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AppearanceActionImpl::GetModelType() const + { + return "AppearanceAction"; + } + + // children + std::shared_ptr AppearanceActionImpl::GetWriterLightStateAction() const + { + return std::dynamic_pointer_cast(_lightStateAction); + } + std::shared_ptr AppearanceActionImpl::GetWriterAnimationAction() const + { + return std::dynamic_pointer_cast(_animationAction); + } + + AppearanceActionImpl::AppearanceActionImpl() + { + /** + * Filling the property to type map + */ + } + + void AppearanceActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AppearanceActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AppearanceActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLightStateAction = GetWriterLightStateAction(); + if (kLightStateAction) + { + result.push_back(std::dynamic_pointer_cast(kLightStateAction)); + } + const auto kAnimationAction = GetWriterAnimationAction(); + if (kAnimationAction) + { + result.push_back(std::dynamic_pointer_cast(kAnimationAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AppearanceActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kLightStateAction = GetWriterLightStateAction(); + if (kLightStateAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLightStateAction)->Clone(); + auto clonedChildILightStateAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLightStateAction(std::dynamic_pointer_cast(clonedChildILightStateAction)); + } + const auto kAnimationAction = GetWriterAnimationAction(); + if (kAnimationAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAnimationAction)->Clone(); + auto clonedChildIAnimationAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAnimationAction(std::dynamic_pointer_cast(clonedChildIAnimationAction)); + } + return clonedObject; + } + + std::string AppearanceActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AppearanceActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION) + { + return std::dynamic_pointer_cast(GetLightStateAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION) + { + return std::dynamic_pointer_cast(GetAnimationAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> AppearanceActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AppearanceActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AppearanceActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool AppearanceActionImpl::IsSetLightStateAction() const + { + return _isSetLightStateAction; + } + bool AppearanceActionImpl::IsSetAnimationAction() const + { + return _isSetAnimationAction; + } + + IOpenScenarioFlexElement* AssignControllerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool AssignControllerActionImpl::GetActivateAnimation() const + { + return _activateAnimation; + } + bool AssignControllerActionImpl::GetActivateLateral() const + { + return _activateLateral; + } + bool AssignControllerActionImpl::GetActivateLighting() const + { + return _activateLighting; + } + bool AssignControllerActionImpl::GetActivateLongitudinal() const + { + return _activateLongitudinal; + } + std::shared_ptr AssignControllerActionImpl::GetController() const + { + return _controller; + } + std::shared_ptr AssignControllerActionImpl::GetCatalogReference() const + { + return _catalogReference; + } + std::shared_ptr AssignControllerActionImpl::GetObjectController() const + { + return _objectController; + } + + + void AssignControllerActionImpl::SetActivateAnimation(const bool activateAnimation) + { + _activateAnimation = activateAnimation; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION); + _isSetActivateAnimation = true; + } + + void AssignControllerActionImpl::SetActivateLateral(const bool activateLateral) + { + _activateLateral = activateLateral; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL); + _isSetActivateLateral = true; + } + + void AssignControllerActionImpl::SetActivateLighting(const bool activateLighting) + { + _activateLighting = activateLighting; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING); + _isSetActivateLighting = true; + } + + void AssignControllerActionImpl::SetActivateLongitudinal(const bool activateLongitudinal) + { + _activateLongitudinal = activateLongitudinal; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL); + _isSetActivateLongitudinal = true; + } + + void AssignControllerActionImpl::SetController(std::shared_ptr controller) + { + _controller = controller; + _catalogReference = {}; + _objectController = {}; + _isSetController = true; + } + + void AssignControllerActionImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _controller = {}; + _objectController = {}; + _isSetCatalogReference = true; + } + + void AssignControllerActionImpl::SetObjectController(std::shared_ptr objectController) + { + _objectController = objectController; + _controller = {}; + _catalogReference = {}; + _isSetObjectController = true; + } + + std::shared_ptr AssignControllerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AssignControllerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAssignControllerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAssignControllerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AssignControllerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AssignControllerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AssignControllerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AssignControllerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AssignControllerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AssignControllerActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION) + { + return GetActivateAnimation(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL) + { + return GetActivateLateral(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING) + { + return GetActivateLighting(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL) + { + return GetActivateLongitudinal(); + } + throw KeyNotSupportedException(); + + } + + DateTime AssignControllerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AssignControllerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AssignControllerActionImpl::GetModelType() const + { + return "AssignControllerAction"; + } + + void AssignControllerActionImpl::WriteParameterToActivateAnimation(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, parameterName, nullTextMarker /*no textmarker*/); + _activateAnimation = {}; + } + + void AssignControllerActionImpl::WriteParameterToActivateLateral(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, parameterName, nullTextMarker /*no textmarker*/); + _activateLateral = {}; + } + + void AssignControllerActionImpl::WriteParameterToActivateLighting(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, parameterName, nullTextMarker /*no textmarker*/); + _activateLighting = {}; + } + + void AssignControllerActionImpl::WriteParameterToActivateLongitudinal(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, parameterName, nullTextMarker /*no textmarker*/); + _activateLongitudinal = {}; + } + + std::string AssignControllerActionImpl::GetParameterFromActivateAnimation() const + { + auto activateAnimation = OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION; + return GetParameterNameFromAttribute(activateAnimation); + } + + std::string AssignControllerActionImpl::GetParameterFromActivateLateral() const + { + auto activateLateral = OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL; + return GetParameterNameFromAttribute(activateLateral); + } + + std::string AssignControllerActionImpl::GetParameterFromActivateLighting() const + { + auto activateLighting = OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING; + return GetParameterNameFromAttribute(activateLighting); + } + + std::string AssignControllerActionImpl::GetParameterFromActivateLongitudinal() const + { + auto activateLongitudinal = OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL; + return GetParameterNameFromAttribute(activateLongitudinal); + } + + bool AssignControllerActionImpl::IsActivateAnimationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool AssignControllerActionImpl::IsActivateLateralParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL); + if (kIt != keys.end()) + return true; + return false; + } + + bool AssignControllerActionImpl::IsActivateLightingParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING); + if (kIt != keys.end()) + return true; + return false; + } + + bool AssignControllerActionImpl::IsActivateLongitudinalParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr AssignControllerActionImpl::GetWriterController() const + { + return std::dynamic_pointer_cast(_controller); + } + std::shared_ptr AssignControllerActionImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + std::shared_ptr AssignControllerActionImpl::GetWriterObjectController() const + { + return std::dynamic_pointer_cast(_objectController); + } + + AssignControllerActionImpl::AssignControllerActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, SimpleType::BOOLEAN); + } + + void AssignControllerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION) + { + // Simple type + _activateAnimation = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActivateAnimation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL) + { + // Simple type + _activateLateral = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActivateLateral = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING) + { + // Simple type + _activateLighting = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActivateLighting = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL) + { + // Simple type + _activateLongitudinal = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActivateLongitudinal = true; + } + } + + SimpleType AssignControllerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AssignControllerActionImpl::GetChildren() const + { + std::vector> result; + + const auto kController = GetWriterController(); + if (kController) + { + result.push_back(std::dynamic_pointer_cast(kController)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + const auto kObjectController = GetWriterObjectController(); + if (kObjectController) + { + result.push_back(std::dynamic_pointer_cast(kObjectController)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AssignControllerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_activateAnimation = GetActivateAnimation(); + // Simple type + clonedObject->_activateLateral = GetActivateLateral(); + // Simple type + clonedObject->_activateLighting = GetActivateLighting(); + // Simple type + clonedObject->_activateLongitudinal = GetActivateLongitudinal(); + // clone indicators + clonedObject->_isSetActivateAnimation = _isSetActivateAnimation; + clonedObject->_isSetActivateLateral = _isSetActivateLateral; + clonedObject->_isSetActivateLighting = _isSetActivateLighting; + clonedObject->_isSetActivateLongitudinal = _isSetActivateLongitudinal; + // clone children + const auto kController = GetWriterController(); + if (kController) + { + auto clonedChild = std::dynamic_pointer_cast(kController)->Clone(); + auto clonedChildIController = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetController(std::dynamic_pointer_cast(clonedChildIController)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + const auto kObjectController = GetWriterObjectController(); + if (kObjectController) + { + auto clonedChild = std::dynamic_pointer_cast(kObjectController)->Clone(); + auto clonedChildIObjectController = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetObjectController(std::dynamic_pointer_cast(clonedChildIObjectController)); + } + return clonedObject; + } + + std::string AssignControllerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AssignControllerActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER) + { + return std::dynamic_pointer_cast(GetController()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + + if (key == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER) + { + return std::dynamic_pointer_cast(GetObjectController()); + } + throw KeyNotSupportedException(); + } + + std::vector> AssignControllerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AssignControllerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AssignControllerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AssignControllerActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION) + { + // Simple type + _activateAnimation = value; + AddResolvedParameter(attributeKey); + _isSetActivateAnimation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL) + { + // Simple type + _activateLateral = value; + AddResolvedParameter(attributeKey); + _isSetActivateLateral = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING) + { + // Simple type + _activateLighting = value; + AddResolvedParameter(attributeKey); + _isSetActivateLighting = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL) + { + // Simple type + _activateLongitudinal = value; + AddResolvedParameter(attributeKey); + _isSetActivateLongitudinal = true; + } + + } + + + void AssignControllerActionImpl::ResetActivateAnimation() + { + _isSetActivateAnimation = false; + _activateAnimation = {}; + + } + bool AssignControllerActionImpl::IsSetActivateAnimation() const + { + return _isSetActivateAnimation; + } + void AssignControllerActionImpl::ResetActivateLateral() + { + _isSetActivateLateral = false; + _activateLateral = {}; + + } + bool AssignControllerActionImpl::IsSetActivateLateral() const + { + return _isSetActivateLateral; + } + void AssignControllerActionImpl::ResetActivateLighting() + { + _isSetActivateLighting = false; + _activateLighting = {}; + + } + bool AssignControllerActionImpl::IsSetActivateLighting() const + { + return _isSetActivateLighting; + } + void AssignControllerActionImpl::ResetActivateLongitudinal() + { + _isSetActivateLongitudinal = false; + _activateLongitudinal = {}; + + } + bool AssignControllerActionImpl::IsSetActivateLongitudinal() const + { + return _isSetActivateLongitudinal; + } + void AssignControllerActionImpl::ResetController() + { + _isSetController = false; + _controller = {}; + + } + bool AssignControllerActionImpl::IsSetController() const + { + return _isSetController; + } + void AssignControllerActionImpl::ResetCatalogReference() + { + _isSetCatalogReference = false; + _catalogReference = {}; + + } + bool AssignControllerActionImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + void AssignControllerActionImpl::ResetObjectController() + { + _isSetObjectController = false; + _objectController = {}; + + } + bool AssignControllerActionImpl::IsSetObjectController() const + { + return _isSetObjectController; + } + + IOpenScenarioFlexElement* AssignRouteActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AssignRouteActionImpl::GetRoute() const + { + return _route; + } + std::shared_ptr AssignRouteActionImpl::GetCatalogReference() const + { + return _catalogReference; + } + + + void AssignRouteActionImpl::SetRoute(std::shared_ptr route) + { + _route = route; + _catalogReference = {}; + _isSetRoute = true; + } + + void AssignRouteActionImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _route = {}; + _isSetCatalogReference = true; + } + + std::shared_ptr AssignRouteActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AssignRouteActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAssignRouteAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAssignRouteActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AssignRouteActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AssignRouteActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AssignRouteActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AssignRouteActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AssignRouteActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AssignRouteActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AssignRouteActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AssignRouteActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AssignRouteActionImpl::GetModelType() const + { + return "AssignRouteAction"; + } + + // children + std::shared_ptr AssignRouteActionImpl::GetWriterRoute() const + { + return std::dynamic_pointer_cast(_route); + } + std::shared_ptr AssignRouteActionImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + + AssignRouteActionImpl::AssignRouteActionImpl() + { + /** + * Filling the property to type map + */ + } + + void AssignRouteActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AssignRouteActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AssignRouteActionImpl::GetChildren() const + { + std::vector> result; + + const auto kRoute = GetWriterRoute(); + if (kRoute) + { + result.push_back(std::dynamic_pointer_cast(kRoute)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AssignRouteActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRoute = GetWriterRoute(); + if (kRoute) + { + auto clonedChild = std::dynamic_pointer_cast(kRoute)->Clone(); + auto clonedChildIRoute = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoute(std::dynamic_pointer_cast(clonedChildIRoute)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + return clonedObject; + } + + std::string AssignRouteActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AssignRouteActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTE) + { + return std::dynamic_pointer_cast(GetRoute()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> AssignRouteActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AssignRouteActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AssignRouteActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool AssignRouteActionImpl::IsSetRoute() const + { + return _isSetRoute; + } + bool AssignRouteActionImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + + IOpenScenarioFlexElement* AutomaticGearImpl::GetOpenScenarioFlexElement() + { + return this; + } + AutomaticGearType AutomaticGearImpl::GetGear() const + { + return _gear; + } + + + void AutomaticGearImpl::SetGear(const AutomaticGearType gear) + { + _gear = gear; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GEAR); + _isSetGear = true; + } + + std::shared_ptr AutomaticGearImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AutomaticGearImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAutomaticGear).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAutomaticGearWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AutomaticGearImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AutomaticGearImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AutomaticGearImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AutomaticGearImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AutomaticGearImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AutomaticGearImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AutomaticGearImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AutomaticGearImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AutomaticGearImpl::GetModelType() const + { + return "AutomaticGear"; + } + + void AutomaticGearImpl::WriteParameterToGear(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GEAR, parameterName, nullTextMarker /*no textmarker*/); + _gear = {}; + } + + std::string AutomaticGearImpl::GetParameterFromGear() const + { + auto gear = OSC_CONSTANTS::ATTRIBUTE__GEAR; + return GetParameterNameFromAttribute(gear); + } + + bool AutomaticGearImpl::IsGearParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__GEAR); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AutomaticGearImpl::AutomaticGearImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__GEAR, SimpleType::ENUM_TYPE); + } + + void AutomaticGearImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GEAR) + { + // Enumeration Type + const auto kResult = AutomaticGearType::GetFromLiteral(parameterLiteralValue); + if (kResult != AutomaticGearType::UNKNOWN) + { + _gear = kResult; + AddResolvedParameter(attributeKey); + _isSetGear = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType AutomaticGearImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AutomaticGearImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AutomaticGearImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kGear = GetGear(); + if ( kGear.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_gear = AutomaticGearType::GetFromLiteral(kGear.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string AutomaticGearImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AutomaticGearImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AutomaticGearImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AutomaticGearImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AutomaticGearImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__GEAR) + { + auto gear = GetGear(); + return gear.GetLiteral() != "UNKNOWN" ? gear.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool AutomaticGearImpl::IsSetGear() const + { + return _isSetGear; + } + + IOpenScenarioFlexElement* AxleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double AxleImpl::GetMaxSteering() const + { + return _maxSteering; + } + double AxleImpl::GetPositionX() const + { + return _positionX; + } + double AxleImpl::GetPositionZ() const + { + return _positionZ; + } + double AxleImpl::GetTrackWidth() const + { + return _trackWidth; + } + double AxleImpl::GetWheelDiameter() const + { + return _wheelDiameter; + } + + + void AxleImpl::SetMaxSteering(const double maxSteering) + { + _maxSteering = maxSteering; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + _isSetMaxSteering = true; + } + + void AxleImpl::SetPositionX(const double positionX) + { + _positionX = positionX; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_X); + _isSetPositionX = true; + } + + void AxleImpl::SetPositionZ(const double positionZ) + { + _positionZ = positionZ; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z); + _isSetPositionZ = true; + } + + void AxleImpl::SetTrackWidth(const double trackWidth) + { + _trackWidth = trackWidth; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH); + _isSetTrackWidth = true; + } + + void AxleImpl::SetWheelDiameter(const double wheelDiameter) + { + _wheelDiameter = wheelDiameter; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER); + _isSetWheelDiameter = true; + } + + std::shared_ptr AxleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AxleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAxle).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAxleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AxleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AxleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AxleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AxleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING) + { + return GetMaxSteering(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__POSITION_X) + { + return GetPositionX(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__POSITION_Z) + { + return GetPositionZ(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH) + { + return GetTrackWidth(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER) + { + return GetWheelDiameter(); + } + throw KeyNotSupportedException(); + + } + + uint16_t AxleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AxleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AxleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AxleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AxleImpl::GetModelType() const + { + return "Axle"; + } + + void AxleImpl::WriteParameterToMaxSteering(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, parameterName, nullTextMarker /*no textmarker*/); + _maxSteering = {}; + } + + void AxleImpl::WriteParameterToPositionX(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, parameterName, nullTextMarker /*no textmarker*/); + _positionX = {}; + } + + void AxleImpl::WriteParameterToPositionZ(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, parameterName, nullTextMarker /*no textmarker*/); + _positionZ = {}; + } + + void AxleImpl::WriteParameterToTrackWidth(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, parameterName, nullTextMarker /*no textmarker*/); + _trackWidth = {}; + } + + void AxleImpl::WriteParameterToWheelDiameter(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, parameterName, nullTextMarker /*no textmarker*/); + _wheelDiameter = {}; + } + + std::string AxleImpl::GetParameterFromMaxSteering() const + { + auto maxSteering = OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING; + return GetParameterNameFromAttribute(maxSteering); + } + + std::string AxleImpl::GetParameterFromPositionX() const + { + auto positionX = OSC_CONSTANTS::ATTRIBUTE__POSITION_X; + return GetParameterNameFromAttribute(positionX); + } + + std::string AxleImpl::GetParameterFromPositionZ() const + { + auto positionZ = OSC_CONSTANTS::ATTRIBUTE__POSITION_Z; + return GetParameterNameFromAttribute(positionZ); + } + + std::string AxleImpl::GetParameterFromTrackWidth() const + { + auto trackWidth = OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH; + return GetParameterNameFromAttribute(trackWidth); + } + + std::string AxleImpl::GetParameterFromWheelDiameter() const + { + auto wheelDiameter = OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER; + return GetParameterNameFromAttribute(wheelDiameter); + } + + bool AxleImpl::IsMaxSteeringParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING); + if (kIt != keys.end()) + return true; + return false; + } + + bool AxleImpl::IsPositionXParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__POSITION_X); + if (kIt != keys.end()) + return true; + return false; + } + + bool AxleImpl::IsPositionZParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__POSITION_Z); + if (kIt != keys.end()) + return true; + return false; + } + + bool AxleImpl::IsTrackWidthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH); + if (kIt != keys.end()) + return true; + return false; + } + + bool AxleImpl::IsWheelDiameterParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + AxleImpl::AxleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, SimpleType::DOUBLE); + } + + void AxleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING) + { + // Simple type + _maxSteering = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxSteering = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__POSITION_X) + { + // Simple type + _positionX = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPositionX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__POSITION_Z) + { + // Simple type + _positionZ = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPositionZ = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH) + { + // Simple type + _trackWidth = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTrackWidth = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER) + { + // Simple type + _wheelDiameter = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWheelDiameter = true; + } + } + + SimpleType AxleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AxleImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AxleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maxSteering = GetMaxSteering(); + // Simple type + clonedObject->_positionX = GetPositionX(); + // Simple type + clonedObject->_positionZ = GetPositionZ(); + // Simple type + clonedObject->_trackWidth = GetTrackWidth(); + // Simple type + clonedObject->_wheelDiameter = GetWheelDiameter(); + // clone indicators + // clone children + return clonedObject; + } + + std::string AxleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AxleImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> AxleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr AxleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AxleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void AxleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING) + { + // Simple type + _maxSteering = value; + AddResolvedParameter(attributeKey); + _isSetMaxSteering = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__POSITION_X) + { + // Simple type + _positionX = value; + AddResolvedParameter(attributeKey); + _isSetPositionX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__POSITION_Z) + { + // Simple type + _positionZ = value; + AddResolvedParameter(attributeKey); + _isSetPositionZ = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH) + { + // Simple type + _trackWidth = value; + AddResolvedParameter(attributeKey); + _isSetTrackWidth = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER) + { + // Simple type + _wheelDiameter = value; + AddResolvedParameter(attributeKey); + _isSetWheelDiameter = true; + } + + } + + + bool AxleImpl::IsSetMaxSteering() const + { + return _isSetMaxSteering; + } + bool AxleImpl::IsSetPositionX() const + { + return _isSetPositionX; + } + bool AxleImpl::IsSetPositionZ() const + { + return _isSetPositionZ; + } + bool AxleImpl::IsSetTrackWidth() const + { + return _isSetTrackWidth; + } + bool AxleImpl::IsSetWheelDiameter() const + { + return _isSetWheelDiameter; + } + + IOpenScenarioFlexElement* AxlesImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr AxlesImpl::GetFrontAxle() const + { + return _frontAxle; + } + std::shared_ptr AxlesImpl::GetRearAxle() const + { + return _rearAxle; + } + std::vector> AxlesImpl::GetAdditionalAxles() const + { + std::vector> temp; + for(auto&& elm: _additionalAxles) + temp.push_back(elm); + return temp; + } + std::vector> AxlesImpl::GetWriterAdditionalAxles() const + { + return _additionalAxles; + } + + int AxlesImpl::GetAdditionalAxlesSize() const + { + return static_cast(_additionalAxles.size()); + } + + std::shared_ptr AxlesImpl::GetAdditionalAxlesAtIndex(unsigned int index) const + { + if (index >= 0 && _additionalAxles.size() > index) + { + return _additionalAxles[index]; + } + return nullptr; + } + + + void AxlesImpl::SetFrontAxle(std::shared_ptr frontAxle) + { + _frontAxle = frontAxle; + _isSetFrontAxle = true; + } + + void AxlesImpl::SetRearAxle(std::shared_ptr rearAxle) + { + _rearAxle = rearAxle; + _isSetRearAxle = true; + } + + void AxlesImpl::SetAdditionalAxles(std::vector>& additionalAxles) + { + _additionalAxles = additionalAxles; + _isSetAdditionalAxles = true; + } + + std::shared_ptr AxlesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(AxlesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IAxles).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IAxlesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr AxlesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t AxlesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int AxlesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double AxlesImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t AxlesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool AxlesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime AxlesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr AxlesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string AxlesImpl::GetModelType() const + { + return "Axles"; + } + + // children + std::shared_ptr AxlesImpl::GetWriterFrontAxle() const + { + return std::dynamic_pointer_cast(_frontAxle); + } + std::shared_ptr AxlesImpl::GetWriterRearAxle() const + { + return std::dynamic_pointer_cast(_rearAxle); + } + + AxlesImpl::AxlesImpl() + { + /** + * Filling the property to type map + */ + } + + void AxlesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType AxlesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> AxlesImpl::GetChildren() const + { + std::vector> result; + + const auto kFrontAxle = GetWriterFrontAxle(); + if (kFrontAxle) + { + result.push_back(std::dynamic_pointer_cast(kFrontAxle)); + } + const auto kRearAxle = GetWriterRearAxle(); + if (kRearAxle) + { + result.push_back(std::dynamic_pointer_cast(kRearAxle)); + } + auto additionalAxles = GetWriterAdditionalAxles(); + if (!additionalAxles.empty()) + { + for(auto&& item : additionalAxles) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr AxlesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kFrontAxle = GetWriterFrontAxle(); + if (kFrontAxle) + { + auto clonedChild = std::dynamic_pointer_cast(kFrontAxle)->Clone(); + auto clonedChildIAxle = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFrontAxle(std::dynamic_pointer_cast(clonedChildIAxle)); + } + const auto kRearAxle = GetWriterRearAxle(); + if (kRearAxle) + { + auto clonedChild = std::dynamic_pointer_cast(kRearAxle)->Clone(); + auto clonedChildIAxle = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRearAxle(std::dynamic_pointer_cast(clonedChildIAxle)); + } + const auto kAdditionalAxles = GetWriterAdditionalAxles(); + if (!kAdditionalAxles.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kAdditionalAxles) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetAdditionalAxles(clonedList); + } + return clonedObject; + } + + std::string AxlesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr AxlesImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__FRONT_AXLE) + { + return std::dynamic_pointer_cast(GetFrontAxle()); + } + + if (key == OSC_CONSTANTS::ELEMENT__REAR_AXLE) + { + return std::dynamic_pointer_cast(GetRearAxle()); + } + throw KeyNotSupportedException(); + } + + std::vector> AxlesImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ADDITIONAL_AXLE) + { + std::vector> vect; + for (auto&& elem : GetAdditionalAxles()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr AxlesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string AxlesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void AxlesImpl::ResetFrontAxle() + { + _isSetFrontAxle = false; + _frontAxle = {}; + + } + bool AxlesImpl::IsSetFrontAxle() const + { + return _isSetFrontAxle; + } + bool AxlesImpl::IsSetRearAxle() const + { + return _isSetRearAxle; + } + void AxlesImpl::ResetAdditionalAxles() + { + _isSetAdditionalAxles = false; + _additionalAxles = {}; + + } + bool AxlesImpl::IsSetAdditionalAxles() const + { + return _isSetAdditionalAxles; + } + + IOpenScenarioFlexElement* BoundingBoxImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr BoundingBoxImpl::GetCenter() const + { + return _center; + } + std::shared_ptr BoundingBoxImpl::GetDimensions() const + { + return _dimensions; + } + + + void BoundingBoxImpl::SetCenter(std::shared_ptr center) + { + _center = center; + _isSetCenter = true; + } + + void BoundingBoxImpl::SetDimensions(std::shared_ptr dimensions) + { + _dimensions = dimensions; + _isSetDimensions = true; + } + + std::shared_ptr BoundingBoxImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(BoundingBoxImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IBoundingBox).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IBoundingBoxWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr BoundingBoxImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t BoundingBoxImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int BoundingBoxImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double BoundingBoxImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t BoundingBoxImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool BoundingBoxImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime BoundingBoxImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr BoundingBoxImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string BoundingBoxImpl::GetModelType() const + { + return "BoundingBox"; + } + + // children + std::shared_ptr BoundingBoxImpl::GetWriterCenter() const + { + return std::dynamic_pointer_cast(_center); + } + std::shared_ptr BoundingBoxImpl::GetWriterDimensions() const + { + return std::dynamic_pointer_cast(_dimensions); + } + + BoundingBoxImpl::BoundingBoxImpl() + { + /** + * Filling the property to type map + */ + } + + void BoundingBoxImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType BoundingBoxImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> BoundingBoxImpl::GetChildren() const + { + std::vector> result; + + const auto kCenter = GetWriterCenter(); + if (kCenter) + { + result.push_back(std::dynamic_pointer_cast(kCenter)); + } + const auto kDimensions = GetWriterDimensions(); + if (kDimensions) + { + result.push_back(std::dynamic_pointer_cast(kDimensions)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr BoundingBoxImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kCenter = GetWriterCenter(); + if (kCenter) + { + auto clonedChild = std::dynamic_pointer_cast(kCenter)->Clone(); + auto clonedChildICenter = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCenter(std::dynamic_pointer_cast(clonedChildICenter)); + } + const auto kDimensions = GetWriterDimensions(); + if (kDimensions) + { + auto clonedChild = std::dynamic_pointer_cast(kDimensions)->Clone(); + auto clonedChildIDimensions = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDimensions(std::dynamic_pointer_cast(clonedChildIDimensions)); + } + return clonedObject; + } + + std::string BoundingBoxImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr BoundingBoxImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CENTER) + { + return std::dynamic_pointer_cast(GetCenter()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIMENSIONS) + { + return std::dynamic_pointer_cast(GetDimensions()); + } + throw KeyNotSupportedException(); + } + + std::vector> BoundingBoxImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr BoundingBoxImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string BoundingBoxImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool BoundingBoxImpl::IsSetCenter() const + { + return _isSetCenter; + } + bool BoundingBoxImpl::IsSetDimensions() const + { + return _isSetDimensions; + } + + IOpenScenarioFlexElement* BrakeImpl::GetOpenScenarioFlexElement() + { + return this; + } + double BrakeImpl::GetMaxRate() const + { + return _maxRate; + } + double BrakeImpl::GetValue() const + { + return _value; + } + + + void BrakeImpl::SetMaxRate(const double maxRate) + { + _maxRate = maxRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + _isSetMaxRate = true; + } + + void BrakeImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr BrakeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(BrakeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IBrake).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IBrakeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr BrakeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t BrakeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int BrakeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double BrakeImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + return GetMaxRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t BrakeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool BrakeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime BrakeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr BrakeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string BrakeImpl::GetModelType() const + { + return "Brake"; + } + + void BrakeImpl::WriteParameterToMaxRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxRate = {}; + } + + void BrakeImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string BrakeImpl::GetParameterFromMaxRate() const + { + auto maxRate = OSC_CONSTANTS::ATTRIBUTE__MAX_RATE; + return GetParameterNameFromAttribute(maxRate); + } + + std::string BrakeImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool BrakeImpl::IsMaxRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool BrakeImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + BrakeImpl::BrakeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void BrakeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType BrakeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> BrakeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr BrakeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maxRate = GetMaxRate(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetMaxRate = _isSetMaxRate; + // clone children + return clonedObject; + } + + std::string BrakeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr BrakeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> BrakeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr BrakeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string BrakeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void BrakeImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void BrakeImpl::ResetMaxRate() + { + _isSetMaxRate = false; + _maxRate = {}; + + } + bool BrakeImpl::IsSetMaxRate() const + { + return _isSetMaxRate; + } + bool BrakeImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* BrakeInputImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr BrakeInputImpl::GetBrakePercent() const + { + return _brakePercent; + } + std::shared_ptr BrakeInputImpl::GetBrakeForce() const + { + return _brakeForce; + } + + + void BrakeInputImpl::SetBrakePercent(std::shared_ptr brakePercent) + { + _brakePercent = brakePercent; + _brakeForce = {}; + _isSetBrakePercent = true; + } + + void BrakeInputImpl::SetBrakeForce(std::shared_ptr brakeForce) + { + _brakeForce = brakeForce; + _brakePercent = {}; + _isSetBrakeForce = true; + } + + std::shared_ptr BrakeInputImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(BrakeInputImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IBrakeInput).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IBrakeInputWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr BrakeInputImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t BrakeInputImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int BrakeInputImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double BrakeInputImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t BrakeInputImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool BrakeInputImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime BrakeInputImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr BrakeInputImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string BrakeInputImpl::GetModelType() const + { + return "BrakeInput"; + } + + // children + std::shared_ptr BrakeInputImpl::GetWriterBrakePercent() const + { + return std::dynamic_pointer_cast(_brakePercent); + } + std::shared_ptr BrakeInputImpl::GetWriterBrakeForce() const + { + return std::dynamic_pointer_cast(_brakeForce); + } + + BrakeInputImpl::BrakeInputImpl() + { + /** + * Filling the property to type map + */ + } + + void BrakeInputImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType BrakeInputImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> BrakeInputImpl::GetChildren() const + { + std::vector> result; + + const auto kBrakePercent = GetWriterBrakePercent(); + if (kBrakePercent) + { + result.push_back(std::dynamic_pointer_cast(kBrakePercent)); + } + const auto kBrakeForce = GetWriterBrakeForce(); + if (kBrakeForce) + { + result.push_back(std::dynamic_pointer_cast(kBrakeForce)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr BrakeInputImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kBrakePercent = GetWriterBrakePercent(); + if (kBrakePercent) + { + auto clonedChild = std::dynamic_pointer_cast(kBrakePercent)->Clone(); + auto clonedChildIBrake = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBrakePercent(std::dynamic_pointer_cast(clonedChildIBrake)); + } + const auto kBrakeForce = GetWriterBrakeForce(); + if (kBrakeForce) + { + auto clonedChild = std::dynamic_pointer_cast(kBrakeForce)->Clone(); + auto clonedChildIBrake = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBrakeForce(std::dynamic_pointer_cast(clonedChildIBrake)); + } + return clonedObject; + } + + std::string BrakeInputImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr BrakeInputImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT) + { + return std::dynamic_pointer_cast(GetBrakePercent()); + } + + if (key == OSC_CONSTANTS::ELEMENT__BRAKE_FORCE) + { + return std::dynamic_pointer_cast(GetBrakeForce()); + } + throw KeyNotSupportedException(); + } + + std::vector> BrakeInputImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr BrakeInputImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string BrakeInputImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool BrakeInputImpl::IsSetBrakePercent() const + { + return _isSetBrakePercent; + } + bool BrakeInputImpl::IsSetBrakeForce() const + { + return _isSetBrakeForce; + } + + IOpenScenarioFlexElement* ByEntityConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ByEntityConditionImpl::GetTriggeringEntities() const + { + return _triggeringEntities; + } + std::shared_ptr ByEntityConditionImpl::GetEntityCondition() const + { + return _entityCondition; + } + + + void ByEntityConditionImpl::SetTriggeringEntities(std::shared_ptr triggeringEntities) + { + _triggeringEntities = triggeringEntities; + _isSetTriggeringEntities = true; + } + + void ByEntityConditionImpl::SetEntityCondition(std::shared_ptr entityCondition) + { + _entityCondition = entityCondition; + _isSetEntityCondition = true; + } + + std::shared_ptr ByEntityConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ByEntityConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IByEntityCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IByEntityConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ByEntityConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ByEntityConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ByEntityConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ByEntityConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ByEntityConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ByEntityConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ByEntityConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ByEntityConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ByEntityConditionImpl::GetModelType() const + { + return "ByEntityCondition"; + } + + // children + std::shared_ptr ByEntityConditionImpl::GetWriterTriggeringEntities() const + { + return std::dynamic_pointer_cast(_triggeringEntities); + } + std::shared_ptr ByEntityConditionImpl::GetWriterEntityCondition() const + { + return std::dynamic_pointer_cast(_entityCondition); + } + + ByEntityConditionImpl::ByEntityConditionImpl() + { + /** + * Filling the property to type map + */ + } + + void ByEntityConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ByEntityConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ByEntityConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kTriggeringEntities = GetWriterTriggeringEntities(); + if (kTriggeringEntities) + { + result.push_back(std::dynamic_pointer_cast(kTriggeringEntities)); + } + const auto kEntityCondition = GetWriterEntityCondition(); + if (kEntityCondition) + { + result.push_back(std::dynamic_pointer_cast(kEntityCondition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ByEntityConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTriggeringEntities = GetWriterTriggeringEntities(); + if (kTriggeringEntities) + { + auto clonedChild = std::dynamic_pointer_cast(kTriggeringEntities)->Clone(); + auto clonedChildITriggeringEntities = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTriggeringEntities(std::dynamic_pointer_cast(clonedChildITriggeringEntities)); + } + const auto kEntityCondition = GetWriterEntityCondition(); + if (kEntityCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityCondition)->Clone(); + auto clonedChildIEntityCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityCondition(std::dynamic_pointer_cast(clonedChildIEntityCondition)); + } + return clonedObject; + } + + std::string ByEntityConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ByEntityConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRIGGERING_ENTITIES) + { + return std::dynamic_pointer_cast(GetTriggeringEntities()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_CONDITION) + { + return std::dynamic_pointer_cast(GetEntityCondition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ByEntityConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ByEntityConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ByEntityConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ByEntityConditionImpl::IsSetTriggeringEntities() const + { + return _isSetTriggeringEntities; + } + bool ByEntityConditionImpl::IsSetEntityCondition() const + { + return _isSetEntityCondition; + } + + IOpenScenarioFlexElement* ByObjectTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + ObjectType ByObjectTypeImpl::GetType() const + { + return _type; + } + + + void ByObjectTypeImpl::SetType(const ObjectType type) + { + _type = type; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE); + _isSetType = true; + } + + std::shared_ptr ByObjectTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ByObjectTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IByObjectType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IByObjectTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ByObjectTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ByObjectTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ByObjectTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ByObjectTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ByObjectTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ByObjectTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ByObjectTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ByObjectTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ByObjectTypeImpl::GetModelType() const + { + return "ByObjectType"; + } + + void ByObjectTypeImpl::WriteParameterToType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, parameterName, nullTextMarker /*no textmarker*/); + _type = {}; + } + + std::string ByObjectTypeImpl::GetParameterFromType() const + { + auto type = OSC_CONSTANTS::ATTRIBUTE__TYPE; + return GetParameterNameFromAttribute(type); + } + + bool ByObjectTypeImpl::IsTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ByObjectTypeImpl::ByObjectTypeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TYPE, SimpleType::ENUM_TYPE); + } + + void ByObjectTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Enumeration Type + const auto kResult = ObjectType::GetFromLiteral(parameterLiteralValue); + if (kResult != ObjectType::UNKNOWN) + { + _type = kResult; + AddResolvedParameter(attributeKey); + _isSetType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType ByObjectTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ByObjectTypeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ByObjectTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kType = GetType(); + if ( kType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_type = ObjectType::GetFromLiteral(kType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string ByObjectTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ByObjectTypeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ByObjectTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ByObjectTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ByObjectTypeImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + auto type = GetType(); + return type.GetLiteral() != "UNKNOWN" ? type.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool ByObjectTypeImpl::IsSetType() const + { + return _isSetType; + } + + IOpenScenarioFlexElement* ByTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + ObjectType ByTypeImpl::GetObjectType() const + { + return _objectType; + } + + + void ByTypeImpl::SetObjectType(const ObjectType objectType) + { + _objectType = objectType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE); + _isSetObjectType = true; + } + + std::shared_ptr ByTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ByTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IByType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IByTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ByTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ByTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ByTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ByTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ByTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ByTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ByTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ByTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ByTypeImpl::GetModelType() const + { + return "ByType"; + } + + void ByTypeImpl::WriteParameterToObjectType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _objectType = {}; + } + + std::string ByTypeImpl::GetParameterFromObjectType() const + { + auto objectType = OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE; + return GetParameterNameFromAttribute(objectType); + } + + bool ByTypeImpl::IsObjectTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ByTypeImpl::ByTypeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, SimpleType::ENUM_TYPE); + } + + void ByTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE) + { + // Enumeration Type + const auto kResult = ObjectType::GetFromLiteral(parameterLiteralValue); + if (kResult != ObjectType::UNKNOWN) + { + _objectType = kResult; + AddResolvedParameter(attributeKey); + _isSetObjectType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType ByTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ByTypeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ByTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kObjectType = GetObjectType(); + if ( kObjectType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_objectType = ObjectType::GetFromLiteral(kObjectType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string ByTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ByTypeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ByTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ByTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ByTypeImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE) + { + auto objectType = GetObjectType(); + return objectType.GetLiteral() != "UNKNOWN" ? objectType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool ByTypeImpl::IsSetObjectType() const + { + return _isSetObjectType; + } + + IOpenScenarioFlexElement* ByValueConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ByValueConditionImpl::GetParameterCondition() const + { + return _parameterCondition; + } + std::shared_ptr ByValueConditionImpl::GetTimeOfDayCondition() const + { + return _timeOfDayCondition; + } + std::shared_ptr ByValueConditionImpl::GetSimulationTimeCondition() const + { + return _simulationTimeCondition; + } + std::shared_ptr ByValueConditionImpl::GetStoryboardElementStateCondition() const + { + return _storyboardElementStateCondition; + } + std::shared_ptr ByValueConditionImpl::GetUserDefinedValueCondition() const + { + return _userDefinedValueCondition; + } + std::shared_ptr ByValueConditionImpl::GetTrafficSignalCondition() const + { + return _trafficSignalCondition; + } + std::shared_ptr ByValueConditionImpl::GetTrafficSignalControllerCondition() const + { + return _trafficSignalControllerCondition; + } + std::shared_ptr ByValueConditionImpl::GetVariableCondition() const + { + return _variableCondition; + } + + + void ByValueConditionImpl::SetParameterCondition(std::shared_ptr parameterCondition) + { + _parameterCondition = parameterCondition; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetParameterCondition = true; + } + + void ByValueConditionImpl::SetTimeOfDayCondition(std::shared_ptr timeOfDayCondition) + { + _timeOfDayCondition = timeOfDayCondition; + _parameterCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetTimeOfDayCondition = true; + } + + void ByValueConditionImpl::SetSimulationTimeCondition(std::shared_ptr simulationTimeCondition) + { + _simulationTimeCondition = simulationTimeCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetSimulationTimeCondition = true; + } + + void ByValueConditionImpl::SetStoryboardElementStateCondition(std::shared_ptr storyboardElementStateCondition) + { + _storyboardElementStateCondition = storyboardElementStateCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetStoryboardElementStateCondition = true; + } + + void ByValueConditionImpl::SetUserDefinedValueCondition(std::shared_ptr userDefinedValueCondition) + { + _userDefinedValueCondition = userDefinedValueCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetUserDefinedValueCondition = true; + } + + void ByValueConditionImpl::SetTrafficSignalCondition(std::shared_ptr trafficSignalCondition) + { + _trafficSignalCondition = trafficSignalCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalControllerCondition = {}; + _variableCondition = {}; + _isSetTrafficSignalCondition = true; + } + + void ByValueConditionImpl::SetTrafficSignalControllerCondition(std::shared_ptr trafficSignalControllerCondition) + { + _trafficSignalControllerCondition = trafficSignalControllerCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _variableCondition = {}; + _isSetTrafficSignalControllerCondition = true; + } + + void ByValueConditionImpl::SetVariableCondition(std::shared_ptr variableCondition) + { + _variableCondition = variableCondition; + _parameterCondition = {}; + _timeOfDayCondition = {}; + _simulationTimeCondition = {}; + _storyboardElementStateCondition = {}; + _userDefinedValueCondition = {}; + _trafficSignalCondition = {}; + _trafficSignalControllerCondition = {}; + _isSetVariableCondition = true; + } + + std::shared_ptr ByValueConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ByValueConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IByValueCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IByValueConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ByValueConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ByValueConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ByValueConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ByValueConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ByValueConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ByValueConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ByValueConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ByValueConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ByValueConditionImpl::GetModelType() const + { + return "ByValueCondition"; + } + + // children + std::shared_ptr ByValueConditionImpl::GetWriterParameterCondition() const + { + return std::dynamic_pointer_cast(_parameterCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterTimeOfDayCondition() const + { + return std::dynamic_pointer_cast(_timeOfDayCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterSimulationTimeCondition() const + { + return std::dynamic_pointer_cast(_simulationTimeCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterStoryboardElementStateCondition() const + { + return std::dynamic_pointer_cast(_storyboardElementStateCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterUserDefinedValueCondition() const + { + return std::dynamic_pointer_cast(_userDefinedValueCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterTrafficSignalCondition() const + { + return std::dynamic_pointer_cast(_trafficSignalCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterTrafficSignalControllerCondition() const + { + return std::dynamic_pointer_cast(_trafficSignalControllerCondition); + } + std::shared_ptr ByValueConditionImpl::GetWriterVariableCondition() const + { + return std::dynamic_pointer_cast(_variableCondition); + } + + ByValueConditionImpl::ByValueConditionImpl() + { + /** + * Filling the property to type map + */ + } + + void ByValueConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ByValueConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ByValueConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kParameterCondition = GetWriterParameterCondition(); + if (kParameterCondition) + { + result.push_back(std::dynamic_pointer_cast(kParameterCondition)); + } + const auto kTimeOfDayCondition = GetWriterTimeOfDayCondition(); + if (kTimeOfDayCondition) + { + result.push_back(std::dynamic_pointer_cast(kTimeOfDayCondition)); + } + const auto kSimulationTimeCondition = GetWriterSimulationTimeCondition(); + if (kSimulationTimeCondition) + { + result.push_back(std::dynamic_pointer_cast(kSimulationTimeCondition)); + } + const auto kStoryboardElementStateCondition = GetWriterStoryboardElementStateCondition(); + if (kStoryboardElementStateCondition) + { + result.push_back(std::dynamic_pointer_cast(kStoryboardElementStateCondition)); + } + const auto kUserDefinedValueCondition = GetWriterUserDefinedValueCondition(); + if (kUserDefinedValueCondition) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedValueCondition)); + } + const auto kTrafficSignalCondition = GetWriterTrafficSignalCondition(); + if (kTrafficSignalCondition) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalCondition)); + } + const auto kTrafficSignalControllerCondition = GetWriterTrafficSignalControllerCondition(); + if (kTrafficSignalControllerCondition) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalControllerCondition)); + } + const auto kVariableCondition = GetWriterVariableCondition(); + if (kVariableCondition) + { + result.push_back(std::dynamic_pointer_cast(kVariableCondition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ByValueConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kParameterCondition = GetWriterParameterCondition(); + if (kParameterCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kParameterCondition)->Clone(); + auto clonedChildIParameterCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetParameterCondition(std::dynamic_pointer_cast(clonedChildIParameterCondition)); + } + const auto kTimeOfDayCondition = GetWriterTimeOfDayCondition(); + if (kTimeOfDayCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeOfDayCondition)->Clone(); + auto clonedChildITimeOfDayCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeOfDayCondition(std::dynamic_pointer_cast(clonedChildITimeOfDayCondition)); + } + const auto kSimulationTimeCondition = GetWriterSimulationTimeCondition(); + if (kSimulationTimeCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kSimulationTimeCondition)->Clone(); + auto clonedChildISimulationTimeCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSimulationTimeCondition(std::dynamic_pointer_cast(clonedChildISimulationTimeCondition)); + } + const auto kStoryboardElementStateCondition = GetWriterStoryboardElementStateCondition(); + if (kStoryboardElementStateCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kStoryboardElementStateCondition)->Clone(); + auto clonedChildIStoryboardElementStateCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStoryboardElementStateCondition(std::dynamic_pointer_cast(clonedChildIStoryboardElementStateCondition)); + } + const auto kUserDefinedValueCondition = GetWriterUserDefinedValueCondition(); + if (kUserDefinedValueCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedValueCondition)->Clone(); + auto clonedChildIUserDefinedValueCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedValueCondition(std::dynamic_pointer_cast(clonedChildIUserDefinedValueCondition)); + } + const auto kTrafficSignalCondition = GetWriterTrafficSignalCondition(); + if (kTrafficSignalCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalCondition)->Clone(); + auto clonedChildITrafficSignalCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalCondition(std::dynamic_pointer_cast(clonedChildITrafficSignalCondition)); + } + const auto kTrafficSignalControllerCondition = GetWriterTrafficSignalControllerCondition(); + if (kTrafficSignalControllerCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalControllerCondition)->Clone(); + auto clonedChildITrafficSignalControllerCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalControllerCondition(std::dynamic_pointer_cast(clonedChildITrafficSignalControllerCondition)); + } + const auto kVariableCondition = GetWriterVariableCondition(); + if (kVariableCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kVariableCondition)->Clone(); + auto clonedChildIVariableCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVariableCondition(std::dynamic_pointer_cast(clonedChildIVariableCondition)); + } + return clonedObject; + } + + std::string ByValueConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ByValueConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION) + { + return std::dynamic_pointer_cast(GetParameterCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION) + { + return std::dynamic_pointer_cast(GetTimeOfDayCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION) + { + return std::dynamic_pointer_cast(GetSimulationTimeCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION) + { + return std::dynamic_pointer_cast(GetStoryboardElementStateCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION) + { + return std::dynamic_pointer_cast(GetUserDefinedValueCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION) + { + return std::dynamic_pointer_cast(GetTrafficSignalCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION) + { + return std::dynamic_pointer_cast(GetTrafficSignalControllerCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION) + { + return std::dynamic_pointer_cast(GetVariableCondition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ByValueConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ByValueConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ByValueConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ByValueConditionImpl::IsSetParameterCondition() const + { + return _isSetParameterCondition; + } + bool ByValueConditionImpl::IsSetTimeOfDayCondition() const + { + return _isSetTimeOfDayCondition; + } + bool ByValueConditionImpl::IsSetSimulationTimeCondition() const + { + return _isSetSimulationTimeCondition; + } + bool ByValueConditionImpl::IsSetStoryboardElementStateCondition() const + { + return _isSetStoryboardElementStateCondition; + } + bool ByValueConditionImpl::IsSetUserDefinedValueCondition() const + { + return _isSetUserDefinedValueCondition; + } + bool ByValueConditionImpl::IsSetTrafficSignalCondition() const + { + return _isSetTrafficSignalCondition; + } + bool ByValueConditionImpl::IsSetTrafficSignalControllerCondition() const + { + return _isSetTrafficSignalControllerCondition; + } + bool ByValueConditionImpl::IsSetVariableCondition() const + { + return _isSetVariableCondition; + } + + IOpenScenarioFlexElement* CatalogImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string CatalogImpl::GetName() const + { + return _name; + } + std::vector> CatalogImpl::GetVehicles() const + { + std::vector> temp; + for(auto&& elm: _vehicles) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterVehicles() const + { + return _vehicles; + } + + int CatalogImpl::GetVehiclesSize() const + { + return static_cast(_vehicles.size()); + } + + std::shared_ptr CatalogImpl::GetVehiclesAtIndex(unsigned int index) const + { + if (index >= 0 && _vehicles.size() > index) + { + return _vehicles[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetControllers() const + { + std::vector> temp; + for(auto&& elm: _controllers) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterControllers() const + { + return _controllers; + } + + int CatalogImpl::GetControllersSize() const + { + return static_cast(_controllers.size()); + } + + std::shared_ptr CatalogImpl::GetControllersAtIndex(unsigned int index) const + { + if (index >= 0 && _controllers.size() > index) + { + return _controllers[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetPedestrians() const + { + std::vector> temp; + for(auto&& elm: _pedestrians) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterPedestrians() const + { + return _pedestrians; + } + + int CatalogImpl::GetPedestriansSize() const + { + return static_cast(_pedestrians.size()); + } + + std::shared_ptr CatalogImpl::GetPedestriansAtIndex(unsigned int index) const + { + if (index >= 0 && _pedestrians.size() > index) + { + return _pedestrians[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetMiscObjects() const + { + std::vector> temp; + for(auto&& elm: _miscObjects) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterMiscObjects() const + { + return _miscObjects; + } + + int CatalogImpl::GetMiscObjectsSize() const + { + return static_cast(_miscObjects.size()); + } + + std::shared_ptr CatalogImpl::GetMiscObjectsAtIndex(unsigned int index) const + { + if (index >= 0 && _miscObjects.size() > index) + { + return _miscObjects[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetEnvironments() const + { + std::vector> temp; + for(auto&& elm: _environments) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterEnvironments() const + { + return _environments; + } + + int CatalogImpl::GetEnvironmentsSize() const + { + return static_cast(_environments.size()); + } + + std::shared_ptr CatalogImpl::GetEnvironmentsAtIndex(unsigned int index) const + { + if (index >= 0 && _environments.size() > index) + { + return _environments[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetManeuvers() const + { + std::vector> temp; + for(auto&& elm: _maneuvers) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterManeuvers() const + { + return _maneuvers; + } + + int CatalogImpl::GetManeuversSize() const + { + return static_cast(_maneuvers.size()); + } + + std::shared_ptr CatalogImpl::GetManeuversAtIndex(unsigned int index) const + { + if (index >= 0 && _maneuvers.size() > index) + { + return _maneuvers[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetTrajectories() const + { + std::vector> temp; + for(auto&& elm: _trajectories) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterTrajectories() const + { + return _trajectories; + } + + int CatalogImpl::GetTrajectoriesSize() const + { + return static_cast(_trajectories.size()); + } + + std::shared_ptr CatalogImpl::GetTrajectoriesAtIndex(unsigned int index) const + { + if (index >= 0 && _trajectories.size() > index) + { + return _trajectories[index]; + } + return nullptr; + } + std::vector> CatalogImpl::GetRoutes() const + { + std::vector> temp; + for(auto&& elm: _routes) + temp.push_back(elm); + return temp; + } + std::vector> CatalogImpl::GetWriterRoutes() const + { + return _routes; + } + + int CatalogImpl::GetRoutesSize() const + { + return static_cast(_routes.size()); + } + + std::shared_ptr CatalogImpl::GetRoutesAtIndex(unsigned int index) const + { + if (index >= 0 && _routes.size() > index) + { + return _routes[index]; + } + return nullptr; + } + + + void CatalogImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void CatalogImpl::SetVehicles(std::vector>& vehicles) + { + _vehicles = vehicles; + _isSetVehicles = true; + } + + void CatalogImpl::SetControllers(std::vector>& controllers) + { + _controllers = controllers; + _isSetControllers = true; + } + + void CatalogImpl::SetPedestrians(std::vector>& pedestrians) + { + _pedestrians = pedestrians; + _isSetPedestrians = true; + } + + void CatalogImpl::SetMiscObjects(std::vector>& miscObjects) + { + _miscObjects = miscObjects; + _isSetMiscObjects = true; + } + + void CatalogImpl::SetEnvironments(std::vector>& environments) + { + _environments = environments; + _isSetEnvironments = true; + } + + void CatalogImpl::SetManeuvers(std::vector>& maneuvers) + { + _maneuvers = maneuvers; + _isSetManeuvers = true; + } + + void CatalogImpl::SetTrajectories(std::vector>& trajectories) + { + _trajectories = trajectories; + _isSetTrajectories = true; + } + + void CatalogImpl::SetRoutes(std::vector>& routes) + { + _routes = routes; + _isSetRoutes = true; + } + + std::shared_ptr CatalogImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CatalogImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICatalog).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICatalogWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CatalogImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CatalogImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CatalogImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CatalogImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CatalogImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CatalogImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CatalogImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CatalogImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CatalogImpl::GetModelType() const + { + return "Catalog"; + } + + void CatalogImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string CatalogImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool CatalogImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CatalogImpl::CatalogImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void CatalogImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType CatalogImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CatalogImpl::GetChildren() const + { + std::vector> result; + + auto vehicles = GetWriterVehicles(); + if (!vehicles.empty()) + { + for(auto&& item : vehicles) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto controllers = GetWriterControllers(); + if (!controllers.empty()) + { + for(auto&& item : controllers) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto pedestrians = GetWriterPedestrians(); + if (!pedestrians.empty()) + { + for(auto&& item : pedestrians) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto miscObjects = GetWriterMiscObjects(); + if (!miscObjects.empty()) + { + for(auto&& item : miscObjects) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto environments = GetWriterEnvironments(); + if (!environments.empty()) + { + for(auto&& item : environments) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto maneuvers = GetWriterManeuvers(); + if (!maneuvers.empty()) + { + for(auto&& item : maneuvers) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto trajectories = GetWriterTrajectories(); + if (!trajectories.empty()) + { + for(auto&& item : trajectories) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto routes = GetWriterRoutes(); + if (!routes.empty()) + { + for(auto&& item : routes) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CatalogImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kVehicles = GetWriterVehicles(); + if (!kVehicles.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kVehicles) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetVehicles(clonedList); + } + const auto kControllers = GetWriterControllers(); + if (!kControllers.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kControllers) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetControllers(clonedList); + } + const auto kPedestrians = GetWriterPedestrians(); + if (!kPedestrians.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPedestrians) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPedestrians(clonedList); + } + const auto kMiscObjects = GetWriterMiscObjects(); + if (!kMiscObjects.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kMiscObjects) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetMiscObjects(clonedList); + } + const auto kEnvironments = GetWriterEnvironments(); + if (!kEnvironments.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEnvironments) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEnvironments(clonedList); + } + const auto kManeuvers = GetWriterManeuvers(); + if (!kManeuvers.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kManeuvers) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetManeuvers(clonedList); + } + const auto kTrajectories = GetWriterTrajectories(); + if (!kTrajectories.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kTrajectories) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetTrajectories(clonedList); + } + const auto kRoutes = GetWriterRoutes(); + if (!kRoutes.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kRoutes) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetRoutes(clonedList); + } + return clonedObject; + } + + std::string CatalogImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CatalogImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE) + { + std::vector> vect; + for (auto&& elem : GetVehicles()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER) + { + std::vector> vect; + for (auto&& elem : GetControllers()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__PEDESTRIAN) + { + std::vector> vect; + for (auto&& elem : GetPedestrians()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__MISC_OBJECT) + { + std::vector> vect; + for (auto&& elem : GetMiscObjects()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__ENVIRONMENT) + { + std::vector> vect; + for (auto&& elem : GetEnvironments()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__MANEUVER) + { + std::vector> vect; + for (auto&& elem : GetManeuvers()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY) + { + std::vector> vect; + for (auto&& elem : GetTrajectories()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__ROUTE) + { + std::vector> vect; + for (auto&& elem : GetRoutes()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CatalogImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void CatalogImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool CatalogImpl::IsSetName() const + { + return _isSetName; + } + void CatalogImpl::ResetVehicles() + { + _isSetVehicles = false; + _vehicles = {}; + + } + bool CatalogImpl::IsSetVehicles() const + { + return _isSetVehicles; + } + void CatalogImpl::ResetControllers() + { + _isSetControllers = false; + _controllers = {}; + + } + bool CatalogImpl::IsSetControllers() const + { + return _isSetControllers; + } + void CatalogImpl::ResetPedestrians() + { + _isSetPedestrians = false; + _pedestrians = {}; + + } + bool CatalogImpl::IsSetPedestrians() const + { + return _isSetPedestrians; + } + void CatalogImpl::ResetMiscObjects() + { + _isSetMiscObjects = false; + _miscObjects = {}; + + } + bool CatalogImpl::IsSetMiscObjects() const + { + return _isSetMiscObjects; + } + void CatalogImpl::ResetEnvironments() + { + _isSetEnvironments = false; + _environments = {}; + + } + bool CatalogImpl::IsSetEnvironments() const + { + return _isSetEnvironments; + } + void CatalogImpl::ResetManeuvers() + { + _isSetManeuvers = false; + _maneuvers = {}; + + } + bool CatalogImpl::IsSetManeuvers() const + { + return _isSetManeuvers; + } + void CatalogImpl::ResetTrajectories() + { + _isSetTrajectories = false; + _trajectories = {}; + + } + bool CatalogImpl::IsSetTrajectories() const + { + return _isSetTrajectories; + } + void CatalogImpl::ResetRoutes() + { + _isSetRoutes = false; + _routes = {}; + + } + bool CatalogImpl::IsSetRoutes() const + { + return _isSetRoutes; + } + + IOpenScenarioFlexElement* CatalogDefinitionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr CatalogDefinitionImpl::GetCatalog() const + { + return _catalog; + } + + + void CatalogDefinitionImpl::SetCatalog(std::shared_ptr catalog) + { + _catalog = catalog; + _isSetCatalog = true; + } + + std::shared_ptr CatalogDefinitionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CatalogDefinitionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICatalogDefinition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICatalogDefinitionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CatalogDefinitionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CatalogDefinitionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CatalogDefinitionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CatalogDefinitionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CatalogDefinitionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CatalogDefinitionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CatalogDefinitionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CatalogDefinitionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CatalogDefinitionImpl::GetModelType() const + { + return "CatalogDefinition"; + } + + // children + std::shared_ptr CatalogDefinitionImpl::GetWriterCatalog() const + { + return std::dynamic_pointer_cast(_catalog); + } + + CatalogDefinitionImpl::CatalogDefinitionImpl() + { + /** + * Filling the property to type map + */ + } + + void CatalogDefinitionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType CatalogDefinitionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CatalogDefinitionImpl::GetChildren() const + { + std::vector> result; + + const auto kCatalog = GetWriterCatalog(); + if (kCatalog) + { + result.push_back(std::dynamic_pointer_cast(kCatalog)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CatalogDefinitionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kCatalog = GetWriterCatalog(); + if (kCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalog)->Clone(); + auto clonedChildICatalog = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalog(std::dynamic_pointer_cast(clonedChildICatalog)); + } + return clonedObject; + } + + std::string CatalogDefinitionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogDefinitionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG) + { + return std::dynamic_pointer_cast(GetCatalog()); + } + throw KeyNotSupportedException(); + } + + std::vector> CatalogDefinitionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogDefinitionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CatalogDefinitionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool CatalogDefinitionImpl::IsSetCatalog() const + { + return _isSetCatalog; + } + + IOpenScenarioFlexElement* CatalogLocationsImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr CatalogLocationsImpl::GetVehicleCatalog() const + { + return _vehicleCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetControllerCatalog() const + { + return _controllerCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetPedestrianCatalog() const + { + return _pedestrianCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetMiscObjectCatalog() const + { + return _miscObjectCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetEnvironmentCatalog() const + { + return _environmentCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetManeuverCatalog() const + { + return _maneuverCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetTrajectoryCatalog() const + { + return _trajectoryCatalog; + } + std::shared_ptr CatalogLocationsImpl::GetRouteCatalog() const + { + return _routeCatalog; + } + + + void CatalogLocationsImpl::SetVehicleCatalog(std::shared_ptr vehicleCatalog) + { + _vehicleCatalog = vehicleCatalog; + _isSetVehicleCatalog = true; + } + + void CatalogLocationsImpl::SetControllerCatalog(std::shared_ptr controllerCatalog) + { + _controllerCatalog = controllerCatalog; + _isSetControllerCatalog = true; + } + + void CatalogLocationsImpl::SetPedestrianCatalog(std::shared_ptr pedestrianCatalog) + { + _pedestrianCatalog = pedestrianCatalog; + _isSetPedestrianCatalog = true; + } + + void CatalogLocationsImpl::SetMiscObjectCatalog(std::shared_ptr miscObjectCatalog) + { + _miscObjectCatalog = miscObjectCatalog; + _isSetMiscObjectCatalog = true; + } + + void CatalogLocationsImpl::SetEnvironmentCatalog(std::shared_ptr environmentCatalog) + { + _environmentCatalog = environmentCatalog; + _isSetEnvironmentCatalog = true; + } + + void CatalogLocationsImpl::SetManeuverCatalog(std::shared_ptr maneuverCatalog) + { + _maneuverCatalog = maneuverCatalog; + _isSetManeuverCatalog = true; + } + + void CatalogLocationsImpl::SetTrajectoryCatalog(std::shared_ptr trajectoryCatalog) + { + _trajectoryCatalog = trajectoryCatalog; + _isSetTrajectoryCatalog = true; + } + + void CatalogLocationsImpl::SetRouteCatalog(std::shared_ptr routeCatalog) + { + _routeCatalog = routeCatalog; + _isSetRouteCatalog = true; + } + + std::shared_ptr CatalogLocationsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CatalogLocationsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICatalogLocations).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICatalogLocationsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CatalogLocationsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CatalogLocationsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CatalogLocationsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CatalogLocationsImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CatalogLocationsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CatalogLocationsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CatalogLocationsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CatalogLocationsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CatalogLocationsImpl::GetModelType() const + { + return "CatalogLocations"; + } + + // children + std::shared_ptr CatalogLocationsImpl::GetWriterVehicleCatalog() const + { + return std::dynamic_pointer_cast(_vehicleCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterControllerCatalog() const + { + return std::dynamic_pointer_cast(_controllerCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterPedestrianCatalog() const + { + return std::dynamic_pointer_cast(_pedestrianCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterMiscObjectCatalog() const + { + return std::dynamic_pointer_cast(_miscObjectCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterEnvironmentCatalog() const + { + return std::dynamic_pointer_cast(_environmentCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterManeuverCatalog() const + { + return std::dynamic_pointer_cast(_maneuverCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterTrajectoryCatalog() const + { + return std::dynamic_pointer_cast(_trajectoryCatalog); + } + std::shared_ptr CatalogLocationsImpl::GetWriterRouteCatalog() const + { + return std::dynamic_pointer_cast(_routeCatalog); + } + + CatalogLocationsImpl::CatalogLocationsImpl() + { + /** + * Filling the property to type map + */ + } + + void CatalogLocationsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType CatalogLocationsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CatalogLocationsImpl::GetChildren() const + { + std::vector> result; + + const auto kVehicleCatalog = GetWriterVehicleCatalog(); + if (kVehicleCatalog) + { + result.push_back(std::dynamic_pointer_cast(kVehicleCatalog)); + } + const auto kControllerCatalog = GetWriterControllerCatalog(); + if (kControllerCatalog) + { + result.push_back(std::dynamic_pointer_cast(kControllerCatalog)); + } + const auto kPedestrianCatalog = GetWriterPedestrianCatalog(); + if (kPedestrianCatalog) + { + result.push_back(std::dynamic_pointer_cast(kPedestrianCatalog)); + } + const auto kMiscObjectCatalog = GetWriterMiscObjectCatalog(); + if (kMiscObjectCatalog) + { + result.push_back(std::dynamic_pointer_cast(kMiscObjectCatalog)); + } + const auto kEnvironmentCatalog = GetWriterEnvironmentCatalog(); + if (kEnvironmentCatalog) + { + result.push_back(std::dynamic_pointer_cast(kEnvironmentCatalog)); + } + const auto kManeuverCatalog = GetWriterManeuverCatalog(); + if (kManeuverCatalog) + { + result.push_back(std::dynamic_pointer_cast(kManeuverCatalog)); + } + const auto kTrajectoryCatalog = GetWriterTrajectoryCatalog(); + if (kTrajectoryCatalog) + { + result.push_back(std::dynamic_pointer_cast(kTrajectoryCatalog)); + } + const auto kRouteCatalog = GetWriterRouteCatalog(); + if (kRouteCatalog) + { + result.push_back(std::dynamic_pointer_cast(kRouteCatalog)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CatalogLocationsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVehicleCatalog = GetWriterVehicleCatalog(); + if (kVehicleCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicleCatalog)->Clone(); + auto clonedChildIVehicleCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicleCatalog(std::dynamic_pointer_cast(clonedChildIVehicleCatalogLocation)); + } + const auto kControllerCatalog = GetWriterControllerCatalog(); + if (kControllerCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kControllerCatalog)->Clone(); + auto clonedChildIControllerCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetControllerCatalog(std::dynamic_pointer_cast(clonedChildIControllerCatalogLocation)); + } + const auto kPedestrianCatalog = GetWriterPedestrianCatalog(); + if (kPedestrianCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kPedestrianCatalog)->Clone(); + auto clonedChildIPedestrianCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPedestrianCatalog(std::dynamic_pointer_cast(clonedChildIPedestrianCatalogLocation)); + } + const auto kMiscObjectCatalog = GetWriterMiscObjectCatalog(); + if (kMiscObjectCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kMiscObjectCatalog)->Clone(); + auto clonedChildIMiscObjectCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetMiscObjectCatalog(std::dynamic_pointer_cast(clonedChildIMiscObjectCatalogLocation)); + } + const auto kEnvironmentCatalog = GetWriterEnvironmentCatalog(); + if (kEnvironmentCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kEnvironmentCatalog)->Clone(); + auto clonedChildIEnvironmentCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEnvironmentCatalog(std::dynamic_pointer_cast(clonedChildIEnvironmentCatalogLocation)); + } + const auto kManeuverCatalog = GetWriterManeuverCatalog(); + if (kManeuverCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kManeuverCatalog)->Clone(); + auto clonedChildIManeuverCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetManeuverCatalog(std::dynamic_pointer_cast(clonedChildIManeuverCatalogLocation)); + } + const auto kTrajectoryCatalog = GetWriterTrajectoryCatalog(); + if (kTrajectoryCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectoryCatalog)->Clone(); + auto clonedChildITrajectoryCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectoryCatalog(std::dynamic_pointer_cast(clonedChildITrajectoryCatalogLocation)); + } + const auto kRouteCatalog = GetWriterRouteCatalog(); + if (kRouteCatalog) + { + auto clonedChild = std::dynamic_pointer_cast(kRouteCatalog)->Clone(); + auto clonedChildIRouteCatalogLocation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRouteCatalog(std::dynamic_pointer_cast(clonedChildIRouteCatalogLocation)); + } + return clonedObject; + } + + std::string CatalogLocationsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogLocationsImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_CATALOG) + { + return std::dynamic_pointer_cast(GetVehicleCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER_CATALOG) + { + return std::dynamic_pointer_cast(GetControllerCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_CATALOG) + { + return std::dynamic_pointer_cast(GetPedestrianCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MISC_OBJECT_CATALOG) + { + return std::dynamic_pointer_cast(GetMiscObjectCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENVIRONMENT_CATALOG) + { + return std::dynamic_pointer_cast(GetEnvironmentCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MANEUVER_CATALOG) + { + return std::dynamic_pointer_cast(GetManeuverCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY_CATALOG) + { + return std::dynamic_pointer_cast(GetTrajectoryCatalog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTE_CATALOG) + { + return std::dynamic_pointer_cast(GetRouteCatalog()); + } + throw KeyNotSupportedException(); + } + + std::vector> CatalogLocationsImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogLocationsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CatalogLocationsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void CatalogLocationsImpl::ResetVehicleCatalog() + { + _isSetVehicleCatalog = false; + _vehicleCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetVehicleCatalog() const + { + return _isSetVehicleCatalog; + } + void CatalogLocationsImpl::ResetControllerCatalog() + { + _isSetControllerCatalog = false; + _controllerCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetControllerCatalog() const + { + return _isSetControllerCatalog; + } + void CatalogLocationsImpl::ResetPedestrianCatalog() + { + _isSetPedestrianCatalog = false; + _pedestrianCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetPedestrianCatalog() const + { + return _isSetPedestrianCatalog; + } + void CatalogLocationsImpl::ResetMiscObjectCatalog() + { + _isSetMiscObjectCatalog = false; + _miscObjectCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetMiscObjectCatalog() const + { + return _isSetMiscObjectCatalog; + } + void CatalogLocationsImpl::ResetEnvironmentCatalog() + { + _isSetEnvironmentCatalog = false; + _environmentCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetEnvironmentCatalog() const + { + return _isSetEnvironmentCatalog; + } + void CatalogLocationsImpl::ResetManeuverCatalog() + { + _isSetManeuverCatalog = false; + _maneuverCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetManeuverCatalog() const + { + return _isSetManeuverCatalog; + } + void CatalogLocationsImpl::ResetTrajectoryCatalog() + { + _isSetTrajectoryCatalog = false; + _trajectoryCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetTrajectoryCatalog() const + { + return _isSetTrajectoryCatalog; + } + void CatalogLocationsImpl::ResetRouteCatalog() + { + _isSetRouteCatalog = false; + _routeCatalog = {}; + + } + bool CatalogLocationsImpl::IsSetRouteCatalog() const + { + return _isSetRouteCatalog; + } + + IOpenScenarioFlexElement* CatalogReferenceImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string CatalogReferenceImpl::GetCatalogName() const + { + return _catalogName; + } + std::string CatalogReferenceImpl::GetEntryName() const + { + return _entryName; + } + std::vector> CatalogReferenceImpl::GetParameterAssignments() const + { + std::vector> temp; + for(auto&& elm: _parameterAssignments) + temp.push_back(elm); + return temp; + } + std::vector> CatalogReferenceImpl::GetWriterParameterAssignments() const + { + return _parameterAssignments; + } + + int CatalogReferenceImpl::GetParameterAssignmentsSize() const + { + return static_cast(_parameterAssignments.size()); + } + + std::shared_ptr CatalogReferenceImpl::GetParameterAssignmentsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterAssignments.size() > index) + { + return _parameterAssignments[index]; + } + return nullptr; + } + std::shared_ptr CatalogReferenceImpl::GetRef() const + { + return _ref; + } + + + void CatalogReferenceImpl::SetCatalogName(const std::string catalogName) + { + _catalogName = catalogName; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME); + _isSetCatalogName = true; + } + + void CatalogReferenceImpl::SetEntryName(const std::string entryName) + { + _entryName = entryName; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME); + _isSetEntryName = true; + } + + void CatalogReferenceImpl::SetParameterAssignments(std::vector>& parameterAssignments) + { + _parameterAssignments = parameterAssignments; + _isSetParameterAssignments = true; + } + + void CatalogReferenceImpl::SetRef(const std::shared_ptr ref) + { + _ref = ref; + _isSetRef = true; + } + + std::shared_ptr CatalogReferenceImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CatalogReferenceImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICatalogReference).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICatalogReferenceWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CatalogReferenceImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CatalogReferenceImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CatalogReferenceImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CatalogReferenceImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CatalogReferenceImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CatalogReferenceImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CatalogReferenceImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CatalogReferenceImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CatalogReferenceImpl::GetModelType() const + { + return "CatalogReference"; + } + + void CatalogReferenceImpl::WriteParameterToCatalogName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, parameterName, nullTextMarker /*no textmarker*/); + _catalogName = {}; + } + + void CatalogReferenceImpl::WriteParameterToEntryName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, parameterName, nullTextMarker /*no textmarker*/); + _entryName = {}; + } + + std::string CatalogReferenceImpl::GetParameterFromCatalogName() const + { + auto catalogName = OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME; + return GetParameterNameFromAttribute(catalogName); + } + + std::string CatalogReferenceImpl::GetParameterFromEntryName() const + { + auto entryName = OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME; + return GetParameterNameFromAttribute(entryName); + } + + bool CatalogReferenceImpl::IsCatalogNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool CatalogReferenceImpl::IsEntryNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CatalogReferenceImpl::CatalogReferenceImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, SimpleType::STRING); + } + + void CatalogReferenceImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME) + { + // Simple type + _catalogName = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCatalogName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME) + { + // Simple type + _entryName = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetEntryName = true; + } + } + + SimpleType CatalogReferenceImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CatalogReferenceImpl::GetChildren() const + { + std::vector> result; + + auto parameterAssignments = GetWriterParameterAssignments(); + if (!parameterAssignments.empty()) + { + for(auto&& item : parameterAssignments) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CatalogReferenceImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_catalogName = GetCatalogName(); + // Simple type + clonedObject->_entryName = GetEntryName(); + // clone indicators + // clone children + const auto kParameterAssignments = GetWriterParameterAssignments(); + if (!kParameterAssignments.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterAssignments) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterAssignments(clonedList); + } + return clonedObject; + } + + std::string CatalogReferenceImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME) + { + return GetCatalogName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME) + { + return GetEntryName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogReferenceImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CatalogReferenceImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT) + { + std::vector> vect; + for (auto&& elem : GetParameterAssignments()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CatalogReferenceImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CatalogReferenceImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void CatalogReferenceImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME) + { + // Simple type + _catalogName = value; + AddResolvedParameter(attributeKey); + _isSetCatalogName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME) + { + // Simple type + _entryName = value; + AddResolvedParameter(attributeKey); + _isSetEntryName = true; + } + + } + + + bool CatalogReferenceImpl::IsSetCatalogName() const + { + return _isSetCatalogName; + } + bool CatalogReferenceImpl::IsSetEntryName() const + { + return _isSetEntryName; + } + void CatalogReferenceImpl::ResetParameterAssignments() + { + _isSetParameterAssignments = false; + _parameterAssignments = {}; + + } + bool CatalogReferenceImpl::IsSetParameterAssignments() const + { + return _isSetParameterAssignments; + } + bool CatalogReferenceImpl::IsSetRef() const + { + return _isSetRef; + } + + IOpenScenarioFlexElement* CenterImpl::GetOpenScenarioFlexElement() + { + return this; + } + double CenterImpl::GetX() const + { + return _x; + } + double CenterImpl::GetY() const + { + return _y; + } + double CenterImpl::GetZ() const + { + return _z; + } + + + void CenterImpl::SetX(const double x) + { + _x = x; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X); + _isSetX = true; + } + + void CenterImpl::SetY(const double y) + { + _y = y; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y); + _isSetY = true; + } + + void CenterImpl::SetZ(const double z) + { + _z = z; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z); + _isSetZ = true; + } + + std::shared_ptr CenterImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CenterImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICenter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICenterWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CenterImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CenterImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CenterImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CenterImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__X) + { + return GetX(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__Y) + { + return GetY(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__Z) + { + return GetZ(); + } + throw KeyNotSupportedException(); + + } + + uint16_t CenterImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CenterImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CenterImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CenterImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CenterImpl::GetModelType() const + { + return "Center"; + } + + void CenterImpl::WriteParameterToX(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, parameterName, nullTextMarker /*no textmarker*/); + _x = {}; + } + + void CenterImpl::WriteParameterToY(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, parameterName, nullTextMarker /*no textmarker*/); + _y = {}; + } + + void CenterImpl::WriteParameterToZ(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, parameterName, nullTextMarker /*no textmarker*/); + _z = {}; + } + + std::string CenterImpl::GetParameterFromX() const + { + auto x = OSC_CONSTANTS::ATTRIBUTE__X; + return GetParameterNameFromAttribute(x); + } + + std::string CenterImpl::GetParameterFromY() const + { + auto y = OSC_CONSTANTS::ATTRIBUTE__Y; + return GetParameterNameFromAttribute(y); + } + + std::string CenterImpl::GetParameterFromZ() const + { + auto z = OSC_CONSTANTS::ATTRIBUTE__Z; + return GetParameterNameFromAttribute(z); + } + + bool CenterImpl::IsXParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__X); + if (kIt != keys.end()) + return true; + return false; + } + + bool CenterImpl::IsYParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__Y); + if (kIt != keys.end()) + return true; + return false; + } + + bool CenterImpl::IsZParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__Z); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CenterImpl::CenterImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__X, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__Y, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__Z, SimpleType::DOUBLE); + } + + void CenterImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__X) + { + // Simple type + _x = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Y) + { + // Simple type + _y = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetY = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Z) + { + // Simple type + _z = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetZ = true; + } + } + + SimpleType CenterImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CenterImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CenterImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_x = GetX(); + // Simple type + clonedObject->_y = GetY(); + // Simple type + clonedObject->_z = GetZ(); + // clone indicators + // clone children + return clonedObject; + } + + std::string CenterImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr CenterImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CenterImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CenterImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CenterImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void CenterImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__X) + { + // Simple type + _x = value; + AddResolvedParameter(attributeKey); + _isSetX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Y) + { + // Simple type + _y = value; + AddResolvedParameter(attributeKey); + _isSetY = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Z) + { + // Simple type + _z = value; + AddResolvedParameter(attributeKey); + _isSetZ = true; + } + + } + + + bool CenterImpl::IsSetX() const + { + return _isSetX; + } + bool CenterImpl::IsSetY() const + { + return _isSetY; + } + bool CenterImpl::IsSetZ() const + { + return _isSetZ; + } + + IOpenScenarioFlexElement* CentralSwarmObjectImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> CentralSwarmObjectImpl::GetEntityRef() const + { + return _entityRef; + } + + + void CentralSwarmObjectImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + std::shared_ptr CentralSwarmObjectImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CentralSwarmObjectImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICentralSwarmObject).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICentralSwarmObjectWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CentralSwarmObjectImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CentralSwarmObjectImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CentralSwarmObjectImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CentralSwarmObjectImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CentralSwarmObjectImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CentralSwarmObjectImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CentralSwarmObjectImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CentralSwarmObjectImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CentralSwarmObjectImpl::GetModelType() const + { + return "CentralSwarmObject"; + } + + void CentralSwarmObjectImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string CentralSwarmObjectImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool CentralSwarmObjectImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CentralSwarmObjectImpl::CentralSwarmObjectImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void CentralSwarmObjectImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType CentralSwarmObjectImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CentralSwarmObjectImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CentralSwarmObjectImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string CentralSwarmObjectImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CentralSwarmObjectImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CentralSwarmObjectImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CentralSwarmObjectImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string CentralSwarmObjectImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool CentralSwarmObjectImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* ClothoidImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ClothoidImpl::GetCurvature() const + { + return _curvature; + } + double ClothoidImpl::GetCurvatureDot() const + { + return _curvatureDot; + } + double ClothoidImpl::GetCurvaturePrime() const + { + return _curvaturePrime; + } + double ClothoidImpl::GetLength() const + { + return _length; + } + double ClothoidImpl::GetStartTime() const + { + return _startTime; + } + double ClothoidImpl::GetStopTime() const + { + return _stopTime; + } + std::shared_ptr ClothoidImpl::GetPosition() const + { + return _position; + } + + + void ClothoidImpl::SetCurvature(const double curvature) + { + _curvature = curvature; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE); + _isSetCurvature = true; + } + + void ClothoidImpl::SetCurvatureDot(const double curvatureDot) + { + _curvatureDot = curvatureDot; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT); + _isSetCurvatureDot = true; + } + + void ClothoidImpl::SetCurvaturePrime(const double curvaturePrime) + { + _curvaturePrime = curvaturePrime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME); + _isSetCurvaturePrime = true; + } + + void ClothoidImpl::SetLength(const double length) + { + _length = length; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH); + _isSetLength = true; + } + + void ClothoidImpl::SetStartTime(const double startTime) + { + _startTime = startTime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__START_TIME); + _isSetStartTime = true; + } + + void ClothoidImpl::SetStopTime(const double stopTime) + { + _stopTime = stopTime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME); + _isSetStopTime = true; + } + + void ClothoidImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr ClothoidImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ClothoidImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IClothoid).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IClothoidWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ClothoidImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ClothoidImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ClothoidImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ClothoidImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CURVATURE) + { + return GetCurvature(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT) + { + return GetCurvatureDot(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME) + { + return GetCurvaturePrime(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + return GetLength(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__START_TIME) + { + return GetStartTime(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__STOP_TIME) + { + return GetStopTime(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ClothoidImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ClothoidImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ClothoidImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ClothoidImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ClothoidImpl::GetModelType() const + { + return "Clothoid"; + } + + void ClothoidImpl::WriteParameterToCurvature(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, parameterName, nullTextMarker /*no textmarker*/); + _curvature = {}; + } + + void ClothoidImpl::WriteParameterToCurvatureDot(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, parameterName, nullTextMarker /*no textmarker*/); + _curvatureDot = {}; + } + + void ClothoidImpl::WriteParameterToCurvaturePrime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, parameterName, nullTextMarker /*no textmarker*/); + _curvaturePrime = {}; + } + + void ClothoidImpl::WriteParameterToLength(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, parameterName, nullTextMarker /*no textmarker*/); + _length = {}; + } + + void ClothoidImpl::WriteParameterToStartTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__START_TIME, parameterName, nullTextMarker /*no textmarker*/); + _startTime = {}; + } + + void ClothoidImpl::WriteParameterToStopTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, parameterName, nullTextMarker /*no textmarker*/); + _stopTime = {}; + } + + std::string ClothoidImpl::GetParameterFromCurvature() const + { + auto curvature = OSC_CONSTANTS::ATTRIBUTE__CURVATURE; + return GetParameterNameFromAttribute(curvature); + } + + std::string ClothoidImpl::GetParameterFromCurvatureDot() const + { + auto curvatureDot = OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT; + return GetParameterNameFromAttribute(curvatureDot); + } + + std::string ClothoidImpl::GetParameterFromCurvaturePrime() const + { + auto curvaturePrime = OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME; + return GetParameterNameFromAttribute(curvaturePrime); + } + + std::string ClothoidImpl::GetParameterFromLength() const + { + auto length = OSC_CONSTANTS::ATTRIBUTE__LENGTH; + return GetParameterNameFromAttribute(length); + } + + std::string ClothoidImpl::GetParameterFromStartTime() const + { + auto startTime = OSC_CONSTANTS::ATTRIBUTE__START_TIME; + return GetParameterNameFromAttribute(startTime); + } + + std::string ClothoidImpl::GetParameterFromStopTime() const + { + auto stopTime = OSC_CONSTANTS::ATTRIBUTE__STOP_TIME; + return GetParameterNameFromAttribute(stopTime); + } + + bool ClothoidImpl::IsCurvatureParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CURVATURE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidImpl::IsCurvatureDotParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidImpl::IsCurvaturePrimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidImpl::IsLengthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LENGTH); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidImpl::IsStartTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__START_TIME); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidImpl::IsStopTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STOP_TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ClothoidImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + ClothoidImpl::ClothoidImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LENGTH, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__START_TIME, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, SimpleType::DOUBLE); + } + + void ClothoidImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE) + { + // Simple type + _curvature = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCurvature = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT) + { + // Simple type + _curvatureDot = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCurvatureDot = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME) + { + // Simple type + _curvaturePrime = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCurvaturePrime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__START_TIME) + { + // Simple type + _startTime = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetStartTime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STOP_TIME) + { + // Simple type + _stopTime = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetStopTime = true; + } + } + + SimpleType ClothoidImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ClothoidImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ClothoidImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_curvature = GetCurvature(); + // Simple type + clonedObject->_curvatureDot = GetCurvatureDot(); + // Simple type + clonedObject->_curvaturePrime = GetCurvaturePrime(); + // Simple type + clonedObject->_length = GetLength(); + // Simple type + clonedObject->_startTime = GetStartTime(); + // Simple type + clonedObject->_stopTime = GetStopTime(); + // clone indicators + clonedObject->_isSetCurvatureDot = _isSetCurvatureDot; + clonedObject->_isSetCurvaturePrime = _isSetCurvaturePrime; + clonedObject->_isSetStartTime = _isSetStartTime; + clonedObject->_isSetStopTime = _isSetStopTime; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string ClothoidImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ClothoidImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ClothoidImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ClothoidImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE) + { + // Simple type + _curvature = value; + AddResolvedParameter(attributeKey); + _isSetCurvature = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT) + { + // Simple type + _curvatureDot = value; + AddResolvedParameter(attributeKey); + _isSetCurvatureDot = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME) + { + // Simple type + _curvaturePrime = value; + AddResolvedParameter(attributeKey); + _isSetCurvaturePrime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = value; + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__START_TIME) + { + // Simple type + _startTime = value; + AddResolvedParameter(attributeKey); + _isSetStartTime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STOP_TIME) + { + // Simple type + _stopTime = value; + AddResolvedParameter(attributeKey); + _isSetStopTime = true; + } + + } + + + bool ClothoidImpl::IsSetCurvature() const + { + return _isSetCurvature; + } + void ClothoidImpl::ResetCurvatureDot() + { + _isSetCurvatureDot = false; + _curvatureDot = {}; + + } + bool ClothoidImpl::IsSetCurvatureDot() const + { + return _isSetCurvatureDot; + } + void ClothoidImpl::ResetCurvaturePrime() + { + _isSetCurvaturePrime = false; + _curvaturePrime = {}; + + } + bool ClothoidImpl::IsSetCurvaturePrime() const + { + return _isSetCurvaturePrime; + } + bool ClothoidImpl::IsSetLength() const + { + return _isSetLength; + } + void ClothoidImpl::ResetStartTime() + { + _isSetStartTime = false; + _startTime = {}; + + } + bool ClothoidImpl::IsSetStartTime() const + { + return _isSetStartTime; + } + void ClothoidImpl::ResetStopTime() + { + _isSetStopTime = false; + _stopTime = {}; + + } + bool ClothoidImpl::IsSetStopTime() const + { + return _isSetStopTime; + } + bool ClothoidImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* ClothoidSplineImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ClothoidSplineImpl::GetTimeEnd() const + { + return _timeEnd; + } + std::vector> ClothoidSplineImpl::GetSegments() const + { + std::vector> temp; + for(auto&& elm: _segments) + temp.push_back(elm); + return temp; + } + std::vector> ClothoidSplineImpl::GetWriterSegments() const + { + return _segments; + } + + int ClothoidSplineImpl::GetSegmentsSize() const + { + return static_cast(_segments.size()); + } + + std::shared_ptr ClothoidSplineImpl::GetSegmentsAtIndex(unsigned int index) const + { + if (index >= 0 && _segments.size() > index) + { + return _segments[index]; + } + return nullptr; + } + + + void ClothoidSplineImpl::SetTimeEnd(const double timeEnd) + { + _timeEnd = timeEnd; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_END); + _isSetTimeEnd = true; + } + + void ClothoidSplineImpl::SetSegments(std::vector>& segments) + { + _segments = segments; + _isSetSegments = true; + } + + std::shared_ptr ClothoidSplineImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ClothoidSplineImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IClothoidSpline).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IClothoidSplineWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ClothoidSplineImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ClothoidSplineImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ClothoidSplineImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ClothoidSplineImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME_END) + { + return GetTimeEnd(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ClothoidSplineImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ClothoidSplineImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ClothoidSplineImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ClothoidSplineImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ClothoidSplineImpl::GetModelType() const + { + return "ClothoidSpline"; + } + + void ClothoidSplineImpl::WriteParameterToTimeEnd(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_END, parameterName, nullTextMarker /*no textmarker*/); + _timeEnd = {}; + } + + std::string ClothoidSplineImpl::GetParameterFromTimeEnd() const + { + auto timeEnd = OSC_CONSTANTS::ATTRIBUTE__TIME_END; + return GetParameterNameFromAttribute(timeEnd); + } + + bool ClothoidSplineImpl::IsTimeEndParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME_END); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ClothoidSplineImpl::ClothoidSplineImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME_END, SimpleType::DOUBLE); + } + + void ClothoidSplineImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_END) + { + // Simple type + _timeEnd = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTimeEnd = true; + } + } + + SimpleType ClothoidSplineImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ClothoidSplineImpl::GetChildren() const + { + std::vector> result; + + auto segments = GetWriterSegments(); + if (!segments.empty()) + { + for(auto&& item : segments) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ClothoidSplineImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_timeEnd = GetTimeEnd(); + // clone indicators + clonedObject->_isSetTimeEnd = _isSetTimeEnd; + // clone children + const auto kSegments = GetWriterSegments(); + if (!kSegments.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kSegments) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetSegments(clonedList); + } + return clonedObject; + } + + std::string ClothoidSplineImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidSplineImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ClothoidSplineImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE_SEGMENT) + { + std::vector> vect; + for (auto&& elem : GetSegments()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidSplineImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ClothoidSplineImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ClothoidSplineImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_END) + { + // Simple type + _timeEnd = value; + AddResolvedParameter(attributeKey); + _isSetTimeEnd = true; + } + + } + + + void ClothoidSplineImpl::ResetTimeEnd() + { + _isSetTimeEnd = false; + _timeEnd = {}; + + } + bool ClothoidSplineImpl::IsSetTimeEnd() const + { + return _isSetTimeEnd; + } + bool ClothoidSplineImpl::IsSetSegments() const + { + return _isSetSegments; + } + + IOpenScenarioFlexElement* ClothoidSplineSegmentImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ClothoidSplineSegmentImpl::GetCurvatureEnd() const + { + return _curvatureEnd; + } + double ClothoidSplineSegmentImpl::GetCurvatureStart() const + { + return _curvatureStart; + } + double ClothoidSplineSegmentImpl::GetHOffset() const + { + return _hOffset; + } + double ClothoidSplineSegmentImpl::GetLength() const + { + return _length; + } + double ClothoidSplineSegmentImpl::GetTimeStart() const + { + return _timeStart; + } + std::shared_ptr ClothoidSplineSegmentImpl::GetPositionStart() const + { + return _positionStart; + } + + + void ClothoidSplineSegmentImpl::SetCurvatureEnd(const double curvatureEnd) + { + _curvatureEnd = curvatureEnd; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END); + _isSetCurvatureEnd = true; + } + + void ClothoidSplineSegmentImpl::SetCurvatureStart(const double curvatureStart) + { + _curvatureStart = curvatureStart; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START); + _isSetCurvatureStart = true; + } + + void ClothoidSplineSegmentImpl::SetHOffset(const double hOffset) + { + _hOffset = hOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET); + _isSetHOffset = true; + } + + void ClothoidSplineSegmentImpl::SetLength(const double length) + { + _length = length; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH); + _isSetLength = true; + } + + void ClothoidSplineSegmentImpl::SetTimeStart(const double timeStart) + { + _timeStart = timeStart; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_START); + _isSetTimeStart = true; + } + + void ClothoidSplineSegmentImpl::SetPositionStart(std::shared_ptr positionStart) + { + _positionStart = positionStart; + _isSetPositionStart = true; + } + + std::shared_ptr ClothoidSplineSegmentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ClothoidSplineSegmentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IClothoidSplineSegment).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IClothoidSplineSegmentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ClothoidSplineSegmentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ClothoidSplineSegmentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ClothoidSplineSegmentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ClothoidSplineSegmentImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END) + { + return GetCurvatureEnd(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START) + { + return GetCurvatureStart(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__H_OFFSET) + { + return GetHOffset(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + return GetLength(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME_START) + { + return GetTimeStart(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ClothoidSplineSegmentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ClothoidSplineSegmentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ClothoidSplineSegmentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ClothoidSplineSegmentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ClothoidSplineSegmentImpl::GetModelType() const + { + return "ClothoidSplineSegment"; + } + + void ClothoidSplineSegmentImpl::WriteParameterToCurvatureEnd(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, parameterName, nullTextMarker /*no textmarker*/); + _curvatureEnd = {}; + } + + void ClothoidSplineSegmentImpl::WriteParameterToCurvatureStart(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, parameterName, nullTextMarker /*no textmarker*/); + _curvatureStart = {}; + } + + void ClothoidSplineSegmentImpl::WriteParameterToHOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _hOffset = {}; + } + + void ClothoidSplineSegmentImpl::WriteParameterToLength(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, parameterName, nullTextMarker /*no textmarker*/); + _length = {}; + } + + void ClothoidSplineSegmentImpl::WriteParameterToTimeStart(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_START, parameterName, nullTextMarker /*no textmarker*/); + _timeStart = {}; + } + + std::string ClothoidSplineSegmentImpl::GetParameterFromCurvatureEnd() const + { + auto curvatureEnd = OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END; + return GetParameterNameFromAttribute(curvatureEnd); + } + + std::string ClothoidSplineSegmentImpl::GetParameterFromCurvatureStart() const + { + auto curvatureStart = OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START; + return GetParameterNameFromAttribute(curvatureStart); + } + + std::string ClothoidSplineSegmentImpl::GetParameterFromHOffset() const + { + auto hOffset = OSC_CONSTANTS::ATTRIBUTE__H_OFFSET; + return GetParameterNameFromAttribute(hOffset); + } + + std::string ClothoidSplineSegmentImpl::GetParameterFromLength() const + { + auto length = OSC_CONSTANTS::ATTRIBUTE__LENGTH; + return GetParameterNameFromAttribute(length); + } + + std::string ClothoidSplineSegmentImpl::GetParameterFromTimeStart() const + { + auto timeStart = OSC_CONSTANTS::ATTRIBUTE__TIME_START; + return GetParameterNameFromAttribute(timeStart); + } + + bool ClothoidSplineSegmentImpl::IsCurvatureEndParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidSplineSegmentImpl::IsCurvatureStartParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidSplineSegmentImpl::IsHOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__H_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidSplineSegmentImpl::IsLengthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LENGTH); + if (kIt != keys.end()) + return true; + return false; + } + + bool ClothoidSplineSegmentImpl::IsTimeStartParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME_START); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ClothoidSplineSegmentImpl::GetWriterPositionStart() const + { + return std::dynamic_pointer_cast(_positionStart); + } + + ClothoidSplineSegmentImpl::ClothoidSplineSegmentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LENGTH, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME_START, SimpleType::DOUBLE); + } + + void ClothoidSplineSegmentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END) + { + // Simple type + _curvatureEnd = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCurvatureEnd = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START) + { + // Simple type + _curvatureStart = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCurvatureStart = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H_OFFSET) + { + // Simple type + _hOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetHOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_START) + { + // Simple type + _timeStart = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTimeStart = true; + } + } + + SimpleType ClothoidSplineSegmentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ClothoidSplineSegmentImpl::GetChildren() const + { + std::vector> result; + + const auto kPositionStart = GetWriterPositionStart(); + if (kPositionStart) + { + result.push_back(std::dynamic_pointer_cast(kPositionStart)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ClothoidSplineSegmentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_curvatureEnd = GetCurvatureEnd(); + // Simple type + clonedObject->_curvatureStart = GetCurvatureStart(); + // Simple type + clonedObject->_hOffset = GetHOffset(); + // Simple type + clonedObject->_length = GetLength(); + // Simple type + clonedObject->_timeStart = GetTimeStart(); + // clone indicators + clonedObject->_isSetHOffset = _isSetHOffset; + clonedObject->_isSetTimeStart = _isSetTimeStart; + // clone children + const auto kPositionStart = GetWriterPositionStart(); + if (kPositionStart) + { + auto clonedChild = std::dynamic_pointer_cast(kPositionStart)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPositionStart(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string ClothoidSplineSegmentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidSplineSegmentImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION_START) + { + return std::dynamic_pointer_cast(GetPositionStart()); + } + throw KeyNotSupportedException(); + } + + std::vector> ClothoidSplineSegmentImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ClothoidSplineSegmentImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ClothoidSplineSegmentImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ClothoidSplineSegmentImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END) + { + // Simple type + _curvatureEnd = value; + AddResolvedParameter(attributeKey); + _isSetCurvatureEnd = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START) + { + // Simple type + _curvatureStart = value; + AddResolvedParameter(attributeKey); + _isSetCurvatureStart = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H_OFFSET) + { + // Simple type + _hOffset = value; + AddResolvedParameter(attributeKey); + _isSetHOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = value; + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_START) + { + // Simple type + _timeStart = value; + AddResolvedParameter(attributeKey); + _isSetTimeStart = true; + } + + } + + + bool ClothoidSplineSegmentImpl::IsSetCurvatureEnd() const + { + return _isSetCurvatureEnd; + } + bool ClothoidSplineSegmentImpl::IsSetCurvatureStart() const + { + return _isSetCurvatureStart; + } + void ClothoidSplineSegmentImpl::ResetHOffset() + { + _isSetHOffset = false; + _hOffset = {}; + + } + bool ClothoidSplineSegmentImpl::IsSetHOffset() const + { + return _isSetHOffset; + } + bool ClothoidSplineSegmentImpl::IsSetLength() const + { + return _isSetLength; + } + void ClothoidSplineSegmentImpl::ResetTimeStart() + { + _isSetTimeStart = false; + _timeStart = {}; + + } + bool ClothoidSplineSegmentImpl::IsSetTimeStart() const + { + return _isSetTimeStart; + } + void ClothoidSplineSegmentImpl::ResetPositionStart() + { + _isSetPositionStart = false; + _positionStart = {}; + + } + bool ClothoidSplineSegmentImpl::IsSetPositionStart() const + { + return _isSetPositionStart; + } + + IOpenScenarioFlexElement* CollisionConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr CollisionConditionImpl::GetEntityRef() const + { + return _entityRef; + } + std::shared_ptr CollisionConditionImpl::GetByType() const + { + return _byType; + } + + + void CollisionConditionImpl::SetEntityRef(std::shared_ptr entityRef) + { + _entityRef = entityRef; + _byType = {}; + _isSetEntityRef = true; + } + + void CollisionConditionImpl::SetByType(std::shared_ptr byType) + { + _byType = byType; + _entityRef = {}; + _isSetByType = true; + } + + std::shared_ptr CollisionConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CollisionConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICollisionCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICollisionConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CollisionConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CollisionConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CollisionConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CollisionConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CollisionConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CollisionConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CollisionConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CollisionConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CollisionConditionImpl::GetModelType() const + { + return "CollisionCondition"; + } + + // children + std::shared_ptr CollisionConditionImpl::GetWriterEntityRef() const + { + return std::dynamic_pointer_cast(_entityRef); + } + std::shared_ptr CollisionConditionImpl::GetWriterByType() const + { + return std::dynamic_pointer_cast(_byType); + } + + CollisionConditionImpl::CollisionConditionImpl() + { + /** + * Filling the property to type map + */ + } + + void CollisionConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType CollisionConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CollisionConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kEntityRef = GetWriterEntityRef(); + if (kEntityRef) + { + result.push_back(std::dynamic_pointer_cast(kEntityRef)); + } + const auto kByType = GetWriterByType(); + if (kByType) + { + result.push_back(std::dynamic_pointer_cast(kByType)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CollisionConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEntityRef = GetWriterEntityRef(); + if (kEntityRef) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityRef)->Clone(); + auto clonedChildIEntityRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityRef(std::dynamic_pointer_cast(clonedChildIEntityRef)); + } + const auto kByType = GetWriterByType(); + if (kByType) + { + auto clonedChild = std::dynamic_pointer_cast(kByType)->Clone(); + auto clonedChildIByObjectType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetByType(std::dynamic_pointer_cast(clonedChildIByObjectType)); + } + return clonedObject; + } + + std::string CollisionConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr CollisionConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + return std::dynamic_pointer_cast(GetEntityRef()); + } + + if (key == OSC_CONSTANTS::ELEMENT__BY_TYPE) + { + return std::dynamic_pointer_cast(GetByType()); + } + throw KeyNotSupportedException(); + } + + std::vector> CollisionConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CollisionConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CollisionConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool CollisionConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool CollisionConditionImpl::IsSetByType() const + { + return _isSetByType; + } + + IOpenScenarioFlexElement* ColorImpl::GetOpenScenarioFlexElement() + { + return this; + } + ColorType ColorImpl::GetColorType() const + { + return _colorType; + } + std::shared_ptr ColorImpl::GetColorRgb() const + { + return _colorRgb; + } + std::shared_ptr ColorImpl::GetColorCmyk() const + { + return _colorCmyk; + } + + + void ColorImpl::SetColorType(const ColorType colorType) + { + _colorType = colorType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE); + _isSetColorType = true; + } + + void ColorImpl::SetColorRgb(std::shared_ptr colorRgb) + { + _colorRgb = colorRgb; + _colorCmyk = {}; + _isSetColorRgb = true; + } + + void ColorImpl::SetColorCmyk(std::shared_ptr colorCmyk) + { + _colorCmyk = colorCmyk; + _colorRgb = {}; + _isSetColorCmyk = true; + } + + std::shared_ptr ColorImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ColorImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IColor).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IColorWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ColorImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ColorImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ColorImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ColorImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ColorImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ColorImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ColorImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ColorImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ColorImpl::GetModelType() const + { + return "Color"; + } + + void ColorImpl::WriteParameterToColorType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _colorType = {}; + } + + std::string ColorImpl::GetParameterFromColorType() const + { + auto colorType = OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE; + return GetParameterNameFromAttribute(colorType); + } + + bool ColorImpl::IsColorTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ColorImpl::GetWriterColorRgb() const + { + return std::dynamic_pointer_cast(_colorRgb); + } + std::shared_ptr ColorImpl::GetWriterColorCmyk() const + { + return std::dynamic_pointer_cast(_colorCmyk); + } + + ColorImpl::ColorImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, SimpleType::ENUM_TYPE); + } + + void ColorImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE) + { + // Enumeration Type + const auto kResult = ColorType::GetFromLiteral(parameterLiteralValue); + if (kResult != ColorType::UNKNOWN) + { + _colorType = kResult; + AddResolvedParameter(attributeKey); + _isSetColorType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType ColorImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ColorImpl::GetChildren() const + { + std::vector> result; + + const auto kColorRgb = GetWriterColorRgb(); + if (kColorRgb) + { + result.push_back(std::dynamic_pointer_cast(kColorRgb)); + } + const auto kColorCmyk = GetWriterColorCmyk(); + if (kColorCmyk) + { + result.push_back(std::dynamic_pointer_cast(kColorCmyk)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ColorImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kColorType = GetColorType(); + if ( kColorType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_colorType = ColorType::GetFromLiteral(kColorType.GetLiteral()); + } + // clone indicators + // clone children + const auto kColorRgb = GetWriterColorRgb(); + if (kColorRgb) + { + auto clonedChild = std::dynamic_pointer_cast(kColorRgb)->Clone(); + auto clonedChildIColorRgb = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetColorRgb(std::dynamic_pointer_cast(clonedChildIColorRgb)); + } + const auto kColorCmyk = GetWriterColorCmyk(); + if (kColorCmyk) + { + auto clonedChild = std::dynamic_pointer_cast(kColorCmyk)->Clone(); + auto clonedChildIColorCmyk = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetColorCmyk(std::dynamic_pointer_cast(clonedChildIColorCmyk)); + } + return clonedObject; + } + + std::string ColorImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__COLOR_RGB) + { + return std::dynamic_pointer_cast(GetColorRgb()); + } + + if (key == OSC_CONSTANTS::ELEMENT__COLOR_CMYK) + { + return std::dynamic_pointer_cast(GetColorCmyk()); + } + throw KeyNotSupportedException(); + } + + std::vector> ColorImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ColorImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE) + { + auto colorType = GetColorType(); + return colorType.GetLiteral() != "UNKNOWN" ? colorType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool ColorImpl::IsSetColorType() const + { + return _isSetColorType; + } + bool ColorImpl::IsSetColorRgb() const + { + return _isSetColorRgb; + } + bool ColorImpl::IsSetColorCmyk() const + { + return _isSetColorCmyk; + } + + IOpenScenarioFlexElement* ColorCmykImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ColorCmykImpl::GetCyan() const + { + return _cyan; + } + double ColorCmykImpl::GetKey() const + { + return _key; + } + double ColorCmykImpl::GetMagenta() const + { + return _magenta; + } + double ColorCmykImpl::GetYellow() const + { + return _yellow; + } + + + void ColorCmykImpl::SetCyan(const double cyan) + { + _cyan = cyan; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CYAN); + _isSetCyan = true; + } + + void ColorCmykImpl::SetKey(const double key) + { + _key = key; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__KEY); + _isSetKey = true; + } + + void ColorCmykImpl::SetMagenta(const double magenta) + { + _magenta = magenta; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + _isSetMagenta = true; + } + + void ColorCmykImpl::SetYellow(const double yellow) + { + _yellow = yellow; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__YELLOW); + _isSetYellow = true; + } + + std::shared_ptr ColorCmykImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ColorCmykImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IColorCmyk).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IColorCmykWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ColorCmykImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ColorCmykImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ColorCmykImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ColorCmykImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CYAN) + { + return GetCyan(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__KEY) + { + return GetKey(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAGENTA) + { + return GetMagenta(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__YELLOW) + { + return GetYellow(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ColorCmykImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ColorCmykImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ColorCmykImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ColorCmykImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ColorCmykImpl::GetModelType() const + { + return "ColorCmyk"; + } + + void ColorCmykImpl::WriteParameterToCyan(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CYAN, parameterName, nullTextMarker /*no textmarker*/); + _cyan = {}; + } + + void ColorCmykImpl::WriteParameterToKey(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__KEY, parameterName, nullTextMarker /*no textmarker*/); + _key = {}; + } + + void ColorCmykImpl::WriteParameterToMagenta(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, parameterName, nullTextMarker /*no textmarker*/); + _magenta = {}; + } + + void ColorCmykImpl::WriteParameterToYellow(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__YELLOW, parameterName, nullTextMarker /*no textmarker*/); + _yellow = {}; + } + + std::string ColorCmykImpl::GetParameterFromCyan() const + { + auto cyan = OSC_CONSTANTS::ATTRIBUTE__CYAN; + return GetParameterNameFromAttribute(cyan); + } + + std::string ColorCmykImpl::GetParameterFromKey() const + { + auto key = OSC_CONSTANTS::ATTRIBUTE__KEY; + return GetParameterNameFromAttribute(key); + } + + std::string ColorCmykImpl::GetParameterFromMagenta() const + { + auto magenta = OSC_CONSTANTS::ATTRIBUTE__MAGENTA; + return GetParameterNameFromAttribute(magenta); + } + + std::string ColorCmykImpl::GetParameterFromYellow() const + { + auto yellow = OSC_CONSTANTS::ATTRIBUTE__YELLOW; + return GetParameterNameFromAttribute(yellow); + } + + bool ColorCmykImpl::IsCyanParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CYAN); + if (kIt != keys.end()) + return true; + return false; + } + + bool ColorCmykImpl::IsKeyParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__KEY); + if (kIt != keys.end()) + return true; + return false; + } + + bool ColorCmykImpl::IsMagentaParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAGENTA); + if (kIt != keys.end()) + return true; + return false; + } + + bool ColorCmykImpl::IsYellowParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__YELLOW); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ColorCmykImpl::ColorCmykImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CYAN, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__KEY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__YELLOW, SimpleType::DOUBLE); + } + + void ColorCmykImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CYAN) + { + // Simple type + _cyan = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetCyan = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__KEY) + { + // Simple type + _key = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetKey = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAGENTA) + { + // Simple type + _magenta = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMagenta = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__YELLOW) + { + // Simple type + _yellow = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetYellow = true; + } + } + + SimpleType ColorCmykImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ColorCmykImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ColorCmykImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_cyan = GetCyan(); + // Simple type + clonedObject->_key = GetKey(); + // Simple type + clonedObject->_magenta = GetMagenta(); + // Simple type + clonedObject->_yellow = GetYellow(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ColorCmykImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorCmykImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ColorCmykImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorCmykImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ColorCmykImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ColorCmykImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CYAN) + { + // Simple type + _cyan = value; + AddResolvedParameter(attributeKey); + _isSetCyan = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__KEY) + { + // Simple type + _key = value; + AddResolvedParameter(attributeKey); + _isSetKey = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAGENTA) + { + // Simple type + _magenta = value; + AddResolvedParameter(attributeKey); + _isSetMagenta = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__YELLOW) + { + // Simple type + _yellow = value; + AddResolvedParameter(attributeKey); + _isSetYellow = true; + } + + } + + + bool ColorCmykImpl::IsSetCyan() const + { + return _isSetCyan; + } + bool ColorCmykImpl::IsSetKey() const + { + return _isSetKey; + } + bool ColorCmykImpl::IsSetMagenta() const + { + return _isSetMagenta; + } + bool ColorCmykImpl::IsSetYellow() const + { + return _isSetYellow; + } + + IOpenScenarioFlexElement* ColorRgbImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ColorRgbImpl::GetBlue() const + { + return _blue; + } + double ColorRgbImpl::GetGreen() const + { + return _green; + } + double ColorRgbImpl::GetRed() const + { + return _red; + } + + + void ColorRgbImpl::SetBlue(const double blue) + { + _blue = blue; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__BLUE); + _isSetBlue = true; + } + + void ColorRgbImpl::SetGreen(const double green) + { + _green = green; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GREEN); + _isSetGreen = true; + } + + void ColorRgbImpl::SetRed(const double red) + { + _red = red; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RED); + _isSetRed = true; + } + + std::shared_ptr ColorRgbImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ColorRgbImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IColorRgb).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IColorRgbWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ColorRgbImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ColorRgbImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ColorRgbImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ColorRgbImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__BLUE) + { + return GetBlue(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__GREEN) + { + return GetGreen(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RED) + { + return GetRed(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ColorRgbImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ColorRgbImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ColorRgbImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ColorRgbImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ColorRgbImpl::GetModelType() const + { + return "ColorRgb"; + } + + void ColorRgbImpl::WriteParameterToBlue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__BLUE, parameterName, nullTextMarker /*no textmarker*/); + _blue = {}; + } + + void ColorRgbImpl::WriteParameterToGreen(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GREEN, parameterName, nullTextMarker /*no textmarker*/); + _green = {}; + } + + void ColorRgbImpl::WriteParameterToRed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RED, parameterName, nullTextMarker /*no textmarker*/); + _red = {}; + } + + std::string ColorRgbImpl::GetParameterFromBlue() const + { + auto blue = OSC_CONSTANTS::ATTRIBUTE__BLUE; + return GetParameterNameFromAttribute(blue); + } + + std::string ColorRgbImpl::GetParameterFromGreen() const + { + auto green = OSC_CONSTANTS::ATTRIBUTE__GREEN; + return GetParameterNameFromAttribute(green); + } + + std::string ColorRgbImpl::GetParameterFromRed() const + { + auto red = OSC_CONSTANTS::ATTRIBUTE__RED; + return GetParameterNameFromAttribute(red); + } + + bool ColorRgbImpl::IsBlueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__BLUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ColorRgbImpl::IsGreenParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__GREEN); + if (kIt != keys.end()) + return true; + return false; + } + + bool ColorRgbImpl::IsRedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RED); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ColorRgbImpl::ColorRgbImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__BLUE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__GREEN, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RED, SimpleType::DOUBLE); + } + + void ColorRgbImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__BLUE) + { + // Simple type + _blue = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetBlue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GREEN) + { + // Simple type + _green = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetGreen = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RED) + { + // Simple type + _red = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRed = true; + } + } + + SimpleType ColorRgbImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ColorRgbImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ColorRgbImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_blue = GetBlue(); + // Simple type + clonedObject->_green = GetGreen(); + // Simple type + clonedObject->_red = GetRed(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ColorRgbImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorRgbImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ColorRgbImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ColorRgbImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ColorRgbImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ColorRgbImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__BLUE) + { + // Simple type + _blue = value; + AddResolvedParameter(attributeKey); + _isSetBlue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GREEN) + { + // Simple type + _green = value; + AddResolvedParameter(attributeKey); + _isSetGreen = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RED) + { + // Simple type + _red = value; + AddResolvedParameter(attributeKey); + _isSetRed = true; + } + + } + + + bool ColorRgbImpl::IsSetBlue() const + { + return _isSetBlue; + } + bool ColorRgbImpl::IsSetGreen() const + { + return _isSetGreen; + } + bool ColorRgbImpl::IsSetRed() const + { + return _isSetRed; + } + + IOpenScenarioFlexElement* ComponentAnimationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ComponentAnimationImpl::GetVehicleComponent() const + { + return _vehicleComponent; + } + std::shared_ptr ComponentAnimationImpl::GetUserDefinedComponent() const + { + return _userDefinedComponent; + } + + + void ComponentAnimationImpl::SetVehicleComponent(std::shared_ptr vehicleComponent) + { + _vehicleComponent = vehicleComponent; + _userDefinedComponent = {}; + _isSetVehicleComponent = true; + } + + void ComponentAnimationImpl::SetUserDefinedComponent(std::shared_ptr userDefinedComponent) + { + _userDefinedComponent = userDefinedComponent; + _vehicleComponent = {}; + _isSetUserDefinedComponent = true; + } + + std::shared_ptr ComponentAnimationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ComponentAnimationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IComponentAnimation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IComponentAnimationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ComponentAnimationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ComponentAnimationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ComponentAnimationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ComponentAnimationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ComponentAnimationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ComponentAnimationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ComponentAnimationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ComponentAnimationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ComponentAnimationImpl::GetModelType() const + { + return "ComponentAnimation"; + } + + // children + std::shared_ptr ComponentAnimationImpl::GetWriterVehicleComponent() const + { + return std::dynamic_pointer_cast(_vehicleComponent); + } + std::shared_ptr ComponentAnimationImpl::GetWriterUserDefinedComponent() const + { + return std::dynamic_pointer_cast(_userDefinedComponent); + } + + ComponentAnimationImpl::ComponentAnimationImpl() + { + /** + * Filling the property to type map + */ + } + + void ComponentAnimationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ComponentAnimationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ComponentAnimationImpl::GetChildren() const + { + std::vector> result; + + const auto kVehicleComponent = GetWriterVehicleComponent(); + if (kVehicleComponent) + { + result.push_back(std::dynamic_pointer_cast(kVehicleComponent)); + } + const auto kUserDefinedComponent = GetWriterUserDefinedComponent(); + if (kUserDefinedComponent) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedComponent)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ComponentAnimationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVehicleComponent = GetWriterVehicleComponent(); + if (kVehicleComponent) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicleComponent)->Clone(); + auto clonedChildIVehicleComponent = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicleComponent(std::dynamic_pointer_cast(clonedChildIVehicleComponent)); + } + const auto kUserDefinedComponent = GetWriterUserDefinedComponent(); + if (kUserDefinedComponent) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedComponent)->Clone(); + auto clonedChildIUserDefinedComponent = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedComponent(std::dynamic_pointer_cast(clonedChildIUserDefinedComponent)); + } + return clonedObject; + } + + std::string ComponentAnimationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ComponentAnimationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT) + { + return std::dynamic_pointer_cast(GetVehicleComponent()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT) + { + return std::dynamic_pointer_cast(GetUserDefinedComponent()); + } + throw KeyNotSupportedException(); + } + + std::vector> ComponentAnimationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ComponentAnimationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ComponentAnimationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ComponentAnimationImpl::IsSetVehicleComponent() const + { + return _isSetVehicleComponent; + } + bool ComponentAnimationImpl::IsSetUserDefinedComponent() const + { + return _isSetUserDefinedComponent; + } + + IOpenScenarioFlexElement* ConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + ConditionEdge ConditionImpl::GetConditionEdge() const + { + return _conditionEdge; + } + double ConditionImpl::GetDelay() const + { + return _delay; + } + std::string ConditionImpl::GetName() const + { + return _name; + } + std::shared_ptr ConditionImpl::GetByEntityCondition() const + { + return _byEntityCondition; + } + std::shared_ptr ConditionImpl::GetByValueCondition() const + { + return _byValueCondition; + } + + + void ConditionImpl::SetConditionEdge(const ConditionEdge conditionEdge) + { + _conditionEdge = conditionEdge; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE); + _isSetConditionEdge = true; + } + + void ConditionImpl::SetDelay(const double delay) + { + _delay = delay; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY); + _isSetDelay = true; + } + + void ConditionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ConditionImpl::SetByEntityCondition(std::shared_ptr byEntityCondition) + { + _byEntityCondition = byEntityCondition; + _byValueCondition = {}; + _isSetByEntityCondition = true; + } + + void ConditionImpl::SetByValueCondition(std::shared_ptr byValueCondition) + { + _byValueCondition = byValueCondition; + _byEntityCondition = {}; + _isSetByValueCondition = true; + } + + std::shared_ptr ConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + return GetDelay(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ConditionImpl::GetModelType() const + { + return "Condition"; + } + + void ConditionImpl::WriteParameterToConditionEdge(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, parameterName, nullTextMarker /*no textmarker*/); + _conditionEdge = {}; + } + + void ConditionImpl::WriteParameterToDelay(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, parameterName, nullTextMarker /*no textmarker*/); + _delay = {}; + } + + void ConditionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ConditionImpl::GetParameterFromConditionEdge() const + { + auto conditionEdge = OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE; + return GetParameterNameFromAttribute(conditionEdge); + } + + std::string ConditionImpl::GetParameterFromDelay() const + { + auto delay = OSC_CONSTANTS::ATTRIBUTE__DELAY; + return GetParameterNameFromAttribute(delay); + } + + std::string ConditionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ConditionImpl::IsConditionEdgeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ConditionImpl::IsDelayParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DELAY); + if (kIt != keys.end()) + return true; + return false; + } + + bool ConditionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ConditionImpl::GetWriterByEntityCondition() const + { + return std::dynamic_pointer_cast(_byEntityCondition); + } + std::shared_ptr ConditionImpl::GetWriterByValueCondition() const + { + return std::dynamic_pointer_cast(_byValueCondition); + } + + ConditionImpl::ConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DELAY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE) + { + // Enumeration Type + const auto kResult = ConditionEdge::GetFromLiteral(parameterLiteralValue); + if (kResult != ConditionEdge::UNKNOWN) + { + _conditionEdge = kResult; + AddResolvedParameter(attributeKey); + _isSetConditionEdge = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + // Simple type + _delay = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDelay = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kByEntityCondition = GetWriterByEntityCondition(); + if (kByEntityCondition) + { + result.push_back(std::dynamic_pointer_cast(kByEntityCondition)); + } + const auto kByValueCondition = GetWriterByValueCondition(); + if (kByValueCondition) + { + result.push_back(std::dynamic_pointer_cast(kByValueCondition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kConditionEdge = GetConditionEdge(); + if ( kConditionEdge.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_conditionEdge = ConditionEdge::GetFromLiteral(kConditionEdge.GetLiteral()); + } + // Simple type + clonedObject->_delay = GetDelay(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kByEntityCondition = GetWriterByEntityCondition(); + if (kByEntityCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kByEntityCondition)->Clone(); + auto clonedChildIByEntityCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetByEntityCondition(std::dynamic_pointer_cast(clonedChildIByEntityCondition)); + } + const auto kByValueCondition = GetWriterByValueCondition(); + if (kByValueCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kByValueCondition)->Clone(); + auto clonedChildIByValueCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetByValueCondition(std::dynamic_pointer_cast(clonedChildIByValueCondition)); + } + return clonedObject; + } + + std::string ConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION) + { + return std::dynamic_pointer_cast(GetByEntityCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION) + { + return std::dynamic_pointer_cast(GetByValueCondition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE) + { + auto conditionEdge = GetConditionEdge(); + return conditionEdge.GetLiteral() != "UNKNOWN" ? conditionEdge.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void ConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + void ConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + // Simple type + _delay = value; + AddResolvedParameter(attributeKey); + _isSetDelay = true; + } + + } + + + bool ConditionImpl::IsSetConditionEdge() const + { + return _isSetConditionEdge; + } + bool ConditionImpl::IsSetDelay() const + { + return _isSetDelay; + } + bool ConditionImpl::IsSetName() const + { + return _isSetName; + } + bool ConditionImpl::IsSetByEntityCondition() const + { + return _isSetByEntityCondition; + } + bool ConditionImpl::IsSetByValueCondition() const + { + return _isSetByValueCondition; + } + + IOpenScenarioFlexElement* ConditionGroupImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ConditionGroupImpl::GetConditions() const + { + std::vector> temp; + for(auto&& elm: _conditions) + temp.push_back(elm); + return temp; + } + std::vector> ConditionGroupImpl::GetWriterConditions() const + { + return _conditions; + } + + int ConditionGroupImpl::GetConditionsSize() const + { + return static_cast(_conditions.size()); + } + + std::shared_ptr ConditionGroupImpl::GetConditionsAtIndex(unsigned int index) const + { + if (index >= 0 && _conditions.size() > index) + { + return _conditions[index]; + } + return nullptr; + } + + + void ConditionGroupImpl::SetConditions(std::vector>& conditions) + { + _conditions = conditions; + _isSetConditions = true; + } + + std::shared_ptr ConditionGroupImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ConditionGroupImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IConditionGroup).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IConditionGroupWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ConditionGroupImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ConditionGroupImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ConditionGroupImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ConditionGroupImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ConditionGroupImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ConditionGroupImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ConditionGroupImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ConditionGroupImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ConditionGroupImpl::GetModelType() const + { + return "ConditionGroup"; + } + + // children + + ConditionGroupImpl::ConditionGroupImpl() + { + /** + * Filling the property to type map + */ + } + + void ConditionGroupImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ConditionGroupImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ConditionGroupImpl::GetChildren() const + { + std::vector> result; + + auto conditions = GetWriterConditions(); + if (!conditions.empty()) + { + for(auto&& item : conditions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ConditionGroupImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kConditions = GetWriterConditions(); + if (!kConditions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kConditions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetConditions(clonedList); + } + return clonedObject; + } + + std::string ConditionGroupImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ConditionGroupImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ConditionGroupImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONDITION) + { + std::vector> vect; + for (auto&& elem : GetConditions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ConditionGroupImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ConditionGroupImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ConditionGroupImpl::IsSetConditions() const + { + return _isSetConditions; + } + + IOpenScenarioFlexElement* ConnectTrailerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> ConnectTrailerActionImpl::GetTrailerRef() const + { + return _trailerRef; + } + + + void ConnectTrailerActionImpl::SetTrailerRef(std::shared_ptr> trailerRef) + { + _trailerRef = trailerRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF); + _isSetTrailerRef = true; + } + + std::shared_ptr ConnectTrailerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ConnectTrailerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IConnectTrailerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IConnectTrailerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ConnectTrailerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ConnectTrailerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ConnectTrailerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ConnectTrailerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ConnectTrailerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ConnectTrailerActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ConnectTrailerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ConnectTrailerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ConnectTrailerActionImpl::GetModelType() const + { + return "ConnectTrailerAction"; + } + + void ConnectTrailerActionImpl::WriteParameterToTrailerRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, parameterName, nullTextMarker /*no textmarker*/); + _trailerRef = {}; + } + + std::string ConnectTrailerActionImpl::GetParameterFromTrailerRef() const + { + auto trailerRef = OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF; + return GetParameterNameFromAttribute(trailerRef); + } + + bool ConnectTrailerActionImpl::IsTrailerRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ConnectTrailerActionImpl::ConnectTrailerActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, SimpleType::STRING); + } + + void ConnectTrailerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _trailerRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetTrailerRef = true; + } + } + + SimpleType ConnectTrailerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ConnectTrailerActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ConnectTrailerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetTrailerRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_trailerRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string ConnectTrailerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF) + { + // Get the Proxy + auto trailerRef = GetTrailerRef(); + return trailerRef!= nullptr ? trailerRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ConnectTrailerActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ConnectTrailerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ConnectTrailerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF) + { + // Get the Proxy + auto trailerRef = GetTrailerRef(); + return trailerRef != nullptr ? std::dynamic_pointer_cast(trailerRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string ConnectTrailerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ConnectTrailerActionImpl::IsSetTrailerRef() const + { + return _isSetTrailerRef; + } + + IOpenScenarioFlexElement* ControlPointImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ControlPointImpl::GetTime() const + { + return _time; + } + double ControlPointImpl::GetWeight() const + { + return _weight; + } + std::shared_ptr ControlPointImpl::GetPosition() const + { + return _position; + } + + + void ControlPointImpl::SetTime(const double time) + { + _time = time; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME); + _isSetTime = true; + } + + void ControlPointImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + void ControlPointImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr ControlPointImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControlPointImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IControlPoint).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControlPointWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControlPointImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControlPointImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControlPointImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControlPointImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + return GetTime(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ControlPointImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControlPointImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControlPointImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControlPointImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControlPointImpl::GetModelType() const + { + return "ControlPoint"; + } + + void ControlPointImpl::WriteParameterToTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, parameterName, nullTextMarker /*no textmarker*/); + _time = {}; + } + + void ControlPointImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string ControlPointImpl::GetParameterFromTime() const + { + auto time = OSC_CONSTANTS::ATTRIBUTE__TIME; + return GetParameterNameFromAttribute(time); + } + + std::string ControlPointImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool ControlPointImpl::IsTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME); + if (kIt != keys.end()) + return true; + return false; + } + + bool ControlPointImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ControlPointImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + ControlPointImpl::ControlPointImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void ControlPointImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType ControlPointImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControlPointImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControlPointImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_time = GetTime(); + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + clonedObject->_isSetTime = _isSetTime; + clonedObject->_isSetWeight = _isSetWeight; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string ControlPointImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ControlPointImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ControlPointImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ControlPointImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControlPointImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ControlPointImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = value; + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + void ControlPointImpl::ResetTime() + { + _isSetTime = false; + _time = {}; + + } + bool ControlPointImpl::IsSetTime() const + { + return _isSetTime; + } + void ControlPointImpl::ResetWeight() + { + _isSetWeight = false; + _weight = {}; + + } + bool ControlPointImpl::IsSetWeight() const + { + return _isSetWeight; + } + bool ControlPointImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* ControllerImpl::GetOpenScenarioFlexElement() + { + return this; + } + ControllerType ControllerImpl::GetControllerType() const + { + return _controllerType; + } + std::string ControllerImpl::GetName() const + { + return _name; + } + std::vector> ControllerImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> ControllerImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int ControllerImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr ControllerImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr ControllerImpl::GetProperties() const + { + return _properties; + } + + + void ControllerImpl::SetControllerType(const ControllerType controllerType) + { + _controllerType = controllerType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE); + _isSetControllerType = true; + } + + void ControllerImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ControllerImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void ControllerImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr ControllerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControllerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IController).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControllerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControllerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControllerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControllerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControllerImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ControllerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControllerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControllerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControllerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControllerImpl::GetModelType() const + { + return "Controller"; + } + + void ControllerImpl::WriteParameterToControllerType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _controllerType = {}; + } + + void ControllerImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ControllerImpl::GetParameterFromControllerType() const + { + auto controllerType = OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE; + return GetParameterNameFromAttribute(controllerType); + } + + std::string ControllerImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ControllerImpl::IsControllerTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ControllerImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ControllerImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + ControllerImpl::ControllerImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ControllerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE) + { + // Enumeration Type + const auto kResult = ControllerType::GetFromLiteral(parameterLiteralValue); + if (kResult != ControllerType::UNKNOWN) + { + _controllerType = kResult; + AddResolvedParameter(attributeKey); + _isSetControllerType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ControllerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool ControllerImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> ControllerImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControllerImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControllerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kControllerType = GetControllerType(); + if ( kControllerType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_controllerType = ControllerType::GetFromLiteral(kControllerType.GetLiteral()); + } + // Simple type + clonedObject->_name = GetName(); + // clone indicators + clonedObject->_isSetControllerType = _isSetControllerType; + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string ControllerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> ControllerImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControllerImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE) + { + auto controllerType = GetControllerType(); + return controllerType.GetLiteral() != "UNKNOWN" ? controllerType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void ControllerImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + void ControllerImpl::ResetControllerType() + { + _isSetControllerType = false; + _controllerType = {ControllerType::ControllerTypeEnum::MOVEMENT}; + + } + bool ControllerImpl::IsSetControllerType() const + { + return _isSetControllerType; + } + bool ControllerImpl::IsSetName() const + { + return _isSetName; + } + void ControllerImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool ControllerImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + void ControllerImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool ControllerImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* ControllerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ControllerActionImpl::GetAssignControllerAction() const + { + return _assignControllerAction; + } + std::shared_ptr ControllerActionImpl::GetOverrideControllerValueAction() const + { + return _overrideControllerValueAction; + } + std::shared_ptr ControllerActionImpl::GetActivateControllerAction() const + { + return _activateControllerAction; + } + + + void ControllerActionImpl::SetAssignControllerAction(std::shared_ptr assignControllerAction) + { + _assignControllerAction = assignControllerAction; + _overrideControllerValueAction = {}; + _activateControllerAction = {}; + _isSetAssignControllerAction = true; + } + + void ControllerActionImpl::SetOverrideControllerValueAction(std::shared_ptr overrideControllerValueAction) + { + _overrideControllerValueAction = overrideControllerValueAction; + _assignControllerAction = {}; + _activateControllerAction = {}; + _isSetOverrideControllerValueAction = true; + } + + void ControllerActionImpl::SetActivateControllerAction(std::shared_ptr activateControllerAction) + { + _activateControllerAction = activateControllerAction; + _assignControllerAction = {}; + _overrideControllerValueAction = {}; + _isSetActivateControllerAction = true; + } + + std::shared_ptr ControllerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControllerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IControllerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControllerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControllerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControllerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControllerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControllerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ControllerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControllerActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControllerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControllerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControllerActionImpl::GetModelType() const + { + return "ControllerAction"; + } + + // children + std::shared_ptr ControllerActionImpl::GetWriterAssignControllerAction() const + { + return std::dynamic_pointer_cast(_assignControllerAction); + } + std::shared_ptr ControllerActionImpl::GetWriterOverrideControllerValueAction() const + { + return std::dynamic_pointer_cast(_overrideControllerValueAction); + } + std::shared_ptr ControllerActionImpl::GetWriterActivateControllerAction() const + { + return std::dynamic_pointer_cast(_activateControllerAction); + } + + ControllerActionImpl::ControllerActionImpl() + { + /** + * Filling the property to type map + */ + } + + void ControllerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ControllerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControllerActionImpl::GetChildren() const + { + std::vector> result; + + const auto kAssignControllerAction = GetWriterAssignControllerAction(); + if (kAssignControllerAction) + { + result.push_back(std::dynamic_pointer_cast(kAssignControllerAction)); + } + const auto kOverrideControllerValueAction = GetWriterOverrideControllerValueAction(); + if (kOverrideControllerValueAction) + { + result.push_back(std::dynamic_pointer_cast(kOverrideControllerValueAction)); + } + const auto kActivateControllerAction = GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + result.push_back(std::dynamic_pointer_cast(kActivateControllerAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControllerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kAssignControllerAction = GetWriterAssignControllerAction(); + if (kAssignControllerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAssignControllerAction)->Clone(); + auto clonedChildIAssignControllerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAssignControllerAction(std::dynamic_pointer_cast(clonedChildIAssignControllerAction)); + } + const auto kOverrideControllerValueAction = GetWriterOverrideControllerValueAction(); + if (kOverrideControllerValueAction) + { + auto clonedChild = std::dynamic_pointer_cast(kOverrideControllerValueAction)->Clone(); + auto clonedChildIOverrideControllerValueAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOverrideControllerValueAction(std::dynamic_pointer_cast(clonedChildIOverrideControllerValueAction)); + } + const auto kActivateControllerAction = GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kActivateControllerAction)->Clone(); + auto clonedChildIActivateControllerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetActivateControllerAction(std::dynamic_pointer_cast(clonedChildIActivateControllerAction)); + } + return clonedObject; + } + + std::string ControllerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ASSIGN_CONTROLLER_ACTION) + { + return std::dynamic_pointer_cast(GetAssignControllerAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION) + { + return std::dynamic_pointer_cast(GetOverrideControllerValueAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION) + { + return std::dynamic_pointer_cast(GetActivateControllerAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> ControllerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControllerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ControllerActionImpl::IsSetAssignControllerAction() const + { + return _isSetAssignControllerAction; + } + bool ControllerActionImpl::IsSetOverrideControllerValueAction() const + { + return _isSetOverrideControllerValueAction; + } + bool ControllerActionImpl::IsSetActivateControllerAction() const + { + return _isSetActivateControllerAction; + } + + IOpenScenarioFlexElement* ControllerCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ControllerCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void ControllerCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr ControllerCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControllerCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IControllerCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControllerCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControllerCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControllerCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControllerCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControllerCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ControllerCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControllerCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControllerCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControllerCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControllerCatalogLocationImpl::GetModelType() const + { + return "ControllerCatalogLocation"; + } + + // children + std::shared_ptr ControllerCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + ControllerCatalogLocationImpl::ControllerCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void ControllerCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ControllerCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControllerCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControllerCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string ControllerCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> ControllerCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControllerCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ControllerCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* ControllerDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ControllerDistributionImpl::GetControllerDistributionEntries() const + { + std::vector> temp; + for(auto&& elm: _controllerDistributionEntries) + temp.push_back(elm); + return temp; + } + std::vector> ControllerDistributionImpl::GetWriterControllerDistributionEntries() const + { + return _controllerDistributionEntries; + } + + int ControllerDistributionImpl::GetControllerDistributionEntriesSize() const + { + return static_cast(_controllerDistributionEntries.size()); + } + + std::shared_ptr ControllerDistributionImpl::GetControllerDistributionEntriesAtIndex(unsigned int index) const + { + if (index >= 0 && _controllerDistributionEntries.size() > index) + { + return _controllerDistributionEntries[index]; + } + return nullptr; + } + + + void ControllerDistributionImpl::SetControllerDistributionEntries(std::vector>& controllerDistributionEntries) + { + _controllerDistributionEntries = controllerDistributionEntries; + _isSetControllerDistributionEntries = true; + } + + std::shared_ptr ControllerDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControllerDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IControllerDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControllerDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControllerDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControllerDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControllerDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControllerDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ControllerDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControllerDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControllerDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControllerDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControllerDistributionImpl::GetModelType() const + { + return "ControllerDistribution"; + } + + // children + + ControllerDistributionImpl::ControllerDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void ControllerDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ControllerDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControllerDistributionImpl::GetChildren() const + { + std::vector> result; + + auto controllerDistributionEntries = GetWriterControllerDistributionEntries(); + if (!controllerDistributionEntries.empty()) + { + for(auto&& item : controllerDistributionEntries) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControllerDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kControllerDistributionEntries = GetWriterControllerDistributionEntries(); + if (!kControllerDistributionEntries.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kControllerDistributionEntries) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetControllerDistributionEntries(clonedList); + } + return clonedObject; + } + + std::string ControllerDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ControllerDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetControllerDistributionEntries()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControllerDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ControllerDistributionImpl::IsSetControllerDistributionEntries() const + { + return _isSetControllerDistributionEntries; + } + + IOpenScenarioFlexElement* ControllerDistributionEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ControllerDistributionEntryImpl::GetWeight() const + { + return _weight; + } + std::shared_ptr ControllerDistributionEntryImpl::GetController() const + { + return _controller; + } + std::shared_ptr ControllerDistributionEntryImpl::GetCatalogReference() const + { + return _catalogReference; + } + + + void ControllerDistributionEntryImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + void ControllerDistributionEntryImpl::SetController(std::shared_ptr controller) + { + _controller = controller; + _catalogReference = {}; + _isSetController = true; + } + + void ControllerDistributionEntryImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _controller = {}; + _isSetCatalogReference = true; + } + + std::shared_ptr ControllerDistributionEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ControllerDistributionEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IControllerDistributionEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IControllerDistributionEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ControllerDistributionEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ControllerDistributionEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ControllerDistributionEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ControllerDistributionEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ControllerDistributionEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ControllerDistributionEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ControllerDistributionEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ControllerDistributionEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ControllerDistributionEntryImpl::GetModelType() const + { + return "ControllerDistributionEntry"; + } + + void ControllerDistributionEntryImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string ControllerDistributionEntryImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool ControllerDistributionEntryImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ControllerDistributionEntryImpl::GetWriterController() const + { + return std::dynamic_pointer_cast(_controller); + } + std::shared_ptr ControllerDistributionEntryImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + + ControllerDistributionEntryImpl::ControllerDistributionEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void ControllerDistributionEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType ControllerDistributionEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ControllerDistributionEntryImpl::GetChildren() const + { + std::vector> result; + + const auto kController = GetWriterController(); + if (kController) + { + result.push_back(std::dynamic_pointer_cast(kController)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ControllerDistributionEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + const auto kController = GetWriterController(); + if (kController) + { + auto clonedChild = std::dynamic_pointer_cast(kController)->Clone(); + auto clonedChildIController = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetController(std::dynamic_pointer_cast(clonedChildIController)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + return clonedObject; + } + + std::string ControllerDistributionEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerDistributionEntryImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER) + { + return std::dynamic_pointer_cast(GetController()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> ControllerDistributionEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ControllerDistributionEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ControllerDistributionEntryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ControllerDistributionEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool ControllerDistributionEntryImpl::IsSetWeight() const + { + return _isSetWeight; + } + bool ControllerDistributionEntryImpl::IsSetController() const + { + return _isSetController; + } + bool ControllerDistributionEntryImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + + IOpenScenarioFlexElement* CustomCommandActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string CustomCommandActionImpl::GetContent() const + { + return _content; + } + std::string CustomCommandActionImpl::GetType() const + { + return _type; + } + + + void CustomCommandActionImpl::SetContent(const std::string content) + { + _content = content; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT); + _isSetContent = true; + } + + void CustomCommandActionImpl::SetType(const std::string type) + { + _type = type; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE); + _isSetType = true; + } + + std::shared_ptr CustomCommandActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CustomCommandActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICustomCommandAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICustomCommandActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CustomCommandActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CustomCommandActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CustomCommandActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CustomCommandActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CustomCommandActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CustomCommandActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CustomCommandActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CustomCommandActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CustomCommandActionImpl::GetModelType() const + { + return "CustomCommandAction"; + } + + void CustomCommandActionImpl::WriteParameterToContent(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT, parameterName, nullTextMarker /*no textmarker*/); + _content = {}; + } + + void CustomCommandActionImpl::WriteParameterToType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, parameterName, nullTextMarker /*no textmarker*/); + _type = {}; + } + + std::string CustomCommandActionImpl::GetParameterFromContent() const + { + auto content = OSC_CONSTANTS::ATTRIBUTE__CONTENT; + return GetParameterNameFromAttribute(content); + } + + std::string CustomCommandActionImpl::GetParameterFromType() const + { + auto type = OSC_CONSTANTS::ATTRIBUTE__TYPE; + return GetParameterNameFromAttribute(type); + } + + bool CustomCommandActionImpl::IsContentParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTENT); + if (kIt != keys.end()) + return true; + return false; + } + + bool CustomCommandActionImpl::IsTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CustomCommandActionImpl::CustomCommandActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTENT, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TYPE, SimpleType::STRING); + } + + void CustomCommandActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Simple type + _type = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetType = true; + } + } + + SimpleType CustomCommandActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CustomCommandActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CustomCommandActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_type = GetType(); + // clone indicators + // clone children + return clonedObject; + } + + std::string CustomCommandActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + return GetContent(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + return GetType(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CustomCommandActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CustomCommandActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CustomCommandActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CustomCommandActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void CustomCommandActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = value; + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Simple type + _type = value; + AddResolvedParameter(attributeKey); + _isSetType = true; + } + + } + + + bool CustomCommandActionImpl::IsSetContent() const + { + return _isSetContent; + } + bool CustomCommandActionImpl::IsSetType() const + { + return _isSetType; + } + + IOpenScenarioFlexElement* CustomContentImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string CustomContentImpl::GetContent() const + { + return _content; + } + + + void CustomContentImpl::SetContent(const std::string content) + { + _content = content; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT); + _isSetContent = true; + } + + std::shared_ptr CustomContentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(CustomContentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ICustomContent).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ICustomContentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr CustomContentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t CustomContentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int CustomContentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double CustomContentImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t CustomContentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool CustomContentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime CustomContentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr CustomContentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string CustomContentImpl::GetModelType() const + { + return "CustomContent"; + } + + void CustomContentImpl::WriteParameterToContent(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT, parameterName, nullTextMarker /*no textmarker*/); + _content = {}; + } + + std::string CustomContentImpl::GetParameterFromContent() const + { + auto content = OSC_CONSTANTS::ATTRIBUTE__CONTENT; + return GetParameterNameFromAttribute(content); + } + + bool CustomContentImpl::IsContentParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTENT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + CustomContentImpl::CustomContentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTENT, SimpleType::STRING); + } + + void CustomContentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + } + + SimpleType CustomContentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> CustomContentImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr CustomContentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string CustomContentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + return GetContent(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr CustomContentImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> CustomContentImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr CustomContentImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string CustomContentImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void CustomContentImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = value; + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + + } + + + bool CustomContentImpl::IsSetContent() const + { + return _isSetContent; + } + + IOpenScenarioFlexElement* DeleteEntityActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + + + std::shared_ptr DeleteEntityActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeleteEntityActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeleteEntityAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeleteEntityActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeleteEntityActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeleteEntityActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeleteEntityActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeleteEntityActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeleteEntityActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeleteEntityActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeleteEntityActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeleteEntityActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeleteEntityActionImpl::GetModelType() const + { + return "DeleteEntityAction"; + } + + // children + + DeleteEntityActionImpl::DeleteEntityActionImpl() + { + /** + * Filling the property to type map + */ + } + + void DeleteEntityActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeleteEntityActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeleteEntityActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeleteEntityActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string DeleteEntityActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeleteEntityActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DeleteEntityActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeleteEntityActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeleteEntityActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + + IOpenScenarioFlexElement* DeterministicImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> DeterministicImpl::GetDeterministicParameterDistributions() const + { + std::vector> temp; + for(auto&& elm: _deterministicParameterDistributions) + temp.push_back(elm); + return temp; + } + std::vector> DeterministicImpl::GetWriterDeterministicParameterDistributions() const + { + return _deterministicParameterDistributions; + } + + int DeterministicImpl::GetDeterministicParameterDistributionsSize() const + { + return static_cast(_deterministicParameterDistributions.size()); + } + + std::shared_ptr DeterministicImpl::GetDeterministicParameterDistributionsAtIndex(unsigned int index) const + { + if (index >= 0 && _deterministicParameterDistributions.size() > index) + { + return _deterministicParameterDistributions[index]; + } + return nullptr; + } + + + void DeterministicImpl::SetDeterministicParameterDistributions(std::vector>& deterministicParameterDistributions) + { + _deterministicParameterDistributions = deterministicParameterDistributions; + _isSetDeterministicParameterDistributions = true; + } + + std::shared_ptr DeterministicImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministic).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicImpl::GetModelType() const + { + return "Deterministic"; + } + + // children + + DeterministicImpl::DeterministicImpl() + { + /** + * Filling the property to type map + */ + } + + void DeterministicImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeterministicImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicImpl::GetChildren() const + { + std::vector> result; + + auto deterministicParameterDistributions = GetWriterDeterministicParameterDistributions(); + if (!deterministicParameterDistributions.empty()) + { + for(auto&& item : deterministicParameterDistributions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDeterministicParameterDistributions = GetWriterDeterministicParameterDistributions(); + if (!kDeterministicParameterDistributions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kDeterministicParameterDistributions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetDeterministicParameterDistributions(clonedList); + } + return clonedObject; + } + + std::string DeterministicImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DeterministicImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_PARAMETER_DISTRIBUTIONS) + { + std::vector> vect; + for (auto&& elem : GetDeterministicParameterDistributions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void DeterministicImpl::ResetDeterministicParameterDistributions() + { + _isSetDeterministicParameterDistributions = false; + _deterministicParameterDistributions = {}; + + } + bool DeterministicImpl::IsSetDeterministicParameterDistributions() const + { + return _isSetDeterministicParameterDistributions; + } + + IOpenScenarioFlexElement* DeterministicMultiParameterDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr DeterministicMultiParameterDistributionImpl::GetDeterministicMultiParameterDistributionType() const + { + return _deterministicMultiParameterDistributionType; + } + + + void DeterministicMultiParameterDistributionImpl::SetDeterministicMultiParameterDistributionType(std::shared_ptr deterministicMultiParameterDistributionType) + { + _deterministicMultiParameterDistributionType = deterministicMultiParameterDistributionType; + _isSetDeterministicMultiParameterDistributionType = true; + } + + std::shared_ptr DeterministicMultiParameterDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicMultiParameterDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministicMultiParameterDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicMultiParameterDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicMultiParameterDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicMultiParameterDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicMultiParameterDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicMultiParameterDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicMultiParameterDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicMultiParameterDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicMultiParameterDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicMultiParameterDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicMultiParameterDistributionImpl::GetModelType() const + { + return "DeterministicMultiParameterDistribution"; + } + + // children + std::shared_ptr DeterministicMultiParameterDistributionImpl::GetWriterDeterministicMultiParameterDistributionType() const + { + return std::dynamic_pointer_cast(_deterministicMultiParameterDistributionType); + } + + DeterministicMultiParameterDistributionImpl::DeterministicMultiParameterDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void DeterministicMultiParameterDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeterministicMultiParameterDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicMultiParameterDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kDeterministicMultiParameterDistributionType = GetWriterDeterministicMultiParameterDistributionType(); + if (kDeterministicMultiParameterDistributionType) + { + result.push_back(std::dynamic_pointer_cast(kDeterministicMultiParameterDistributionType)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicMultiParameterDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDeterministicMultiParameterDistributionType = GetWriterDeterministicMultiParameterDistributionType(); + if (kDeterministicMultiParameterDistributionType) + { + auto clonedChild = std::dynamic_pointer_cast(kDeterministicMultiParameterDistributionType)->Clone(); + auto clonedChildIDeterministicMultiParameterDistributionType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeterministicMultiParameterDistributionType(std::dynamic_pointer_cast(clonedChildIDeterministicMultiParameterDistributionType)); + } + return clonedObject; + } + + std::string DeterministicMultiParameterDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicMultiParameterDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION_TYPE) + { + return std::dynamic_pointer_cast(GetDeterministicMultiParameterDistributionType()); + } + throw KeyNotSupportedException(); + } + + std::vector> DeterministicMultiParameterDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicMultiParameterDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicMultiParameterDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DeterministicMultiParameterDistributionImpl::IsSetDeterministicMultiParameterDistributionType() const + { + return _isSetDeterministicMultiParameterDistributionType; + } + + IOpenScenarioFlexElement* DeterministicMultiParameterDistributionTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::GetValueSetDistribution() const + { + return _valueSetDistribution; + } + + + void DeterministicMultiParameterDistributionTypeImpl::SetValueSetDistribution(std::shared_ptr valueSetDistribution) + { + _valueSetDistribution = valueSetDistribution; + _isSetValueSetDistribution = true; + } + + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicMultiParameterDistributionTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministicMultiParameterDistributionType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicMultiParameterDistributionTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicMultiParameterDistributionTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicMultiParameterDistributionTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicMultiParameterDistributionTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicMultiParameterDistributionTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicMultiParameterDistributionTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicMultiParameterDistributionTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicMultiParameterDistributionTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicMultiParameterDistributionTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicMultiParameterDistributionTypeImpl::GetModelType() const + { + return "DeterministicMultiParameterDistributionType"; + } + + // children + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::GetWriterValueSetDistribution() const + { + return std::dynamic_pointer_cast(_valueSetDistribution); + } + + DeterministicMultiParameterDistributionTypeImpl::DeterministicMultiParameterDistributionTypeImpl() + { + /** + * Filling the property to type map + */ + } + + void DeterministicMultiParameterDistributionTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeterministicMultiParameterDistributionTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicMultiParameterDistributionTypeImpl::GetChildren() const + { + std::vector> result; + + const auto kValueSetDistribution = GetWriterValueSetDistribution(); + if (kValueSetDistribution) + { + result.push_back(std::dynamic_pointer_cast(kValueSetDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kValueSetDistribution = GetWriterValueSetDistribution(); + if (kValueSetDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kValueSetDistribution)->Clone(); + auto clonedChildIValueSetDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetValueSetDistribution(std::dynamic_pointer_cast(clonedChildIValueSetDistribution)); + } + return clonedObject; + } + + std::string DeterministicMultiParameterDistributionTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetValueSetDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> DeterministicMultiParameterDistributionTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicMultiParameterDistributionTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicMultiParameterDistributionTypeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DeterministicMultiParameterDistributionTypeImpl::IsSetValueSetDistribution() const + { + return _isSetValueSetDistribution; + } + + IOpenScenarioFlexElement* DeterministicParameterDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr DeterministicParameterDistributionImpl::GetDeterministicMultiParameterDistribution() const + { + return _deterministicMultiParameterDistribution; + } + std::shared_ptr DeterministicParameterDistributionImpl::GetDeterministicSingleParameterDistribution() const + { + return _deterministicSingleParameterDistribution; + } + + + void DeterministicParameterDistributionImpl::SetDeterministicMultiParameterDistribution(std::shared_ptr deterministicMultiParameterDistribution) + { + _deterministicMultiParameterDistribution = deterministicMultiParameterDistribution; + _deterministicSingleParameterDistribution = {}; + _isSetDeterministicMultiParameterDistribution = true; + } + + void DeterministicParameterDistributionImpl::SetDeterministicSingleParameterDistribution(std::shared_ptr deterministicSingleParameterDistribution) + { + _deterministicSingleParameterDistribution = deterministicSingleParameterDistribution; + _deterministicMultiParameterDistribution = {}; + _isSetDeterministicSingleParameterDistribution = true; + } + + std::shared_ptr DeterministicParameterDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicParameterDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministicParameterDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicParameterDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicParameterDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicParameterDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicParameterDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicParameterDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicParameterDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicParameterDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicParameterDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicParameterDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicParameterDistributionImpl::GetModelType() const + { + return "DeterministicParameterDistribution"; + } + + // children + std::shared_ptr DeterministicParameterDistributionImpl::GetWriterDeterministicMultiParameterDistribution() const + { + return std::dynamic_pointer_cast(_deterministicMultiParameterDistribution); + } + std::shared_ptr DeterministicParameterDistributionImpl::GetWriterDeterministicSingleParameterDistribution() const + { + return std::dynamic_pointer_cast(_deterministicSingleParameterDistribution); + } + + DeterministicParameterDistributionImpl::DeterministicParameterDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void DeterministicParameterDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeterministicParameterDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicParameterDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kDeterministicMultiParameterDistribution = GetWriterDeterministicMultiParameterDistribution(); + if (kDeterministicMultiParameterDistribution) + { + result.push_back(std::dynamic_pointer_cast(kDeterministicMultiParameterDistribution)); + } + const auto kDeterministicSingleParameterDistribution = GetWriterDeterministicSingleParameterDistribution(); + if (kDeterministicSingleParameterDistribution) + { + result.push_back(std::dynamic_pointer_cast(kDeterministicSingleParameterDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicParameterDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDeterministicMultiParameterDistribution = GetWriterDeterministicMultiParameterDistribution(); + if (kDeterministicMultiParameterDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kDeterministicMultiParameterDistribution)->Clone(); + auto clonedChildIDeterministicMultiParameterDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeterministicMultiParameterDistribution(std::dynamic_pointer_cast(clonedChildIDeterministicMultiParameterDistribution)); + } + const auto kDeterministicSingleParameterDistribution = GetWriterDeterministicSingleParameterDistribution(); + if (kDeterministicSingleParameterDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kDeterministicSingleParameterDistribution)->Clone(); + auto clonedChildIDeterministicSingleParameterDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeterministicSingleParameterDistribution(std::dynamic_pointer_cast(clonedChildIDeterministicSingleParameterDistribution)); + } + return clonedObject; + } + + std::string DeterministicParameterDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicParameterDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetDeterministicMultiParameterDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetDeterministicSingleParameterDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> DeterministicParameterDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicParameterDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicParameterDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DeterministicParameterDistributionImpl::IsSetDeterministicMultiParameterDistribution() const + { + return _isSetDeterministicMultiParameterDistribution; + } + bool DeterministicParameterDistributionImpl::IsSetDeterministicSingleParameterDistribution() const + { + return _isSetDeterministicSingleParameterDistribution; + } + + IOpenScenarioFlexElement* DeterministicSingleParameterDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string DeterministicSingleParameterDistributionImpl::GetParameterName() const + { + return _parameterName; + } + std::shared_ptr DeterministicSingleParameterDistributionImpl::GetDeterministicSingleParameterDistributionType() const + { + return _deterministicSingleParameterDistributionType; + } + + + void DeterministicSingleParameterDistributionImpl::SetParameterName(const std::string parameterName) + { + _parameterName = parameterName; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME); + _isSetParameterName = true; + } + + void DeterministicSingleParameterDistributionImpl::SetDeterministicSingleParameterDistributionType(std::shared_ptr deterministicSingleParameterDistributionType) + { + _deterministicSingleParameterDistributionType = deterministicSingleParameterDistributionType; + _isSetDeterministicSingleParameterDistributionType = true; + } + + std::shared_ptr DeterministicSingleParameterDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicSingleParameterDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministicSingleParameterDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicSingleParameterDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicSingleParameterDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicSingleParameterDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicSingleParameterDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicSingleParameterDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicSingleParameterDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicSingleParameterDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicSingleParameterDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicSingleParameterDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicSingleParameterDistributionImpl::GetModelType() const + { + return "DeterministicSingleParameterDistribution"; + } + + void DeterministicSingleParameterDistributionImpl::WriteParameterToParameterName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, parameterName, nullTextMarker /*no textmarker*/); + _parameterName = {}; + } + + std::string DeterministicSingleParameterDistributionImpl::GetParameterFromParameterName() const + { + auto parameterName = OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME; + return GetParameterNameFromAttribute(parameterName); + } + + bool DeterministicSingleParameterDistributionImpl::IsParameterNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr DeterministicSingleParameterDistributionImpl::GetWriterDeterministicSingleParameterDistributionType() const + { + return std::dynamic_pointer_cast(_deterministicSingleParameterDistributionType); + } + + DeterministicSingleParameterDistributionImpl::DeterministicSingleParameterDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, SimpleType::STRING); + } + + void DeterministicSingleParameterDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + // Simple type + _parameterName = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetParameterName = true; + } + } + + SimpleType DeterministicSingleParameterDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicSingleParameterDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kDeterministicSingleParameterDistributionType = GetWriterDeterministicSingleParameterDistributionType(); + if (kDeterministicSingleParameterDistributionType) + { + result.push_back(std::dynamic_pointer_cast(kDeterministicSingleParameterDistributionType)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicSingleParameterDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_parameterName = GetParameterName(); + // clone indicators + // clone children + const auto kDeterministicSingleParameterDistributionType = GetWriterDeterministicSingleParameterDistributionType(); + if (kDeterministicSingleParameterDistributionType) + { + auto clonedChild = std::dynamic_pointer_cast(kDeterministicSingleParameterDistributionType)->Clone(); + auto clonedChildIDeterministicSingleParameterDistributionType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeterministicSingleParameterDistributionType(std::dynamic_pointer_cast(clonedChildIDeterministicSingleParameterDistributionType)); + } + return clonedObject; + } + + std::string DeterministicSingleParameterDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + return GetParameterName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicSingleParameterDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION_TYPE) + { + return std::dynamic_pointer_cast(GetDeterministicSingleParameterDistributionType()); + } + throw KeyNotSupportedException(); + } + + std::vector> DeterministicSingleParameterDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicSingleParameterDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicSingleParameterDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DeterministicSingleParameterDistributionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + // Simple type + _parameterName = value; + AddResolvedParameter(attributeKey); + _isSetParameterName = true; + } + + } + + + bool DeterministicSingleParameterDistributionImpl::IsSetParameterName() const + { + return _isSetParameterName; + } + bool DeterministicSingleParameterDistributionImpl::IsSetDeterministicSingleParameterDistributionType() const + { + return _isSetDeterministicSingleParameterDistributionType; + } + + IOpenScenarioFlexElement* DeterministicSingleParameterDistributionTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetDistributionSet() const + { + return _distributionSet; + } + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetDistributionRange() const + { + return _distributionRange; + } + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetUserDefinedDistribution() const + { + return _userDefinedDistribution; + } + + + void DeterministicSingleParameterDistributionTypeImpl::SetDistributionSet(std::shared_ptr distributionSet) + { + _distributionSet = distributionSet; + _distributionRange = {}; + _userDefinedDistribution = {}; + _isSetDistributionSet = true; + } + + void DeterministicSingleParameterDistributionTypeImpl::SetDistributionRange(std::shared_ptr distributionRange) + { + _distributionRange = distributionRange; + _distributionSet = {}; + _userDefinedDistribution = {}; + _isSetDistributionRange = true; + } + + void DeterministicSingleParameterDistributionTypeImpl::SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) + { + _userDefinedDistribution = userDefinedDistribution; + _distributionSet = {}; + _distributionRange = {}; + _isSetUserDefinedDistribution = true; + } + + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DeterministicSingleParameterDistributionTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDeterministicSingleParameterDistributionType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDeterministicSingleParameterDistributionTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DeterministicSingleParameterDistributionTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DeterministicSingleParameterDistributionTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DeterministicSingleParameterDistributionTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DeterministicSingleParameterDistributionTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DeterministicSingleParameterDistributionTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DeterministicSingleParameterDistributionTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DeterministicSingleParameterDistributionTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DeterministicSingleParameterDistributionTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DeterministicSingleParameterDistributionTypeImpl::GetModelType() const + { + return "DeterministicSingleParameterDistributionType"; + } + + // children + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetWriterDistributionSet() const + { + return std::dynamic_pointer_cast(_distributionSet); + } + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetWriterDistributionRange() const + { + return std::dynamic_pointer_cast(_distributionRange); + } + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetWriterUserDefinedDistribution() const + { + return std::dynamic_pointer_cast(_userDefinedDistribution); + } + + DeterministicSingleParameterDistributionTypeImpl::DeterministicSingleParameterDistributionTypeImpl() + { + /** + * Filling the property to type map + */ + } + + void DeterministicSingleParameterDistributionTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DeterministicSingleParameterDistributionTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DeterministicSingleParameterDistributionTypeImpl::GetChildren() const + { + std::vector> result; + + const auto kDistributionSet = GetWriterDistributionSet(); + if (kDistributionSet) + { + result.push_back(std::dynamic_pointer_cast(kDistributionSet)); + } + const auto kDistributionRange = GetWriterDistributionRange(); + if (kDistributionRange) + { + result.push_back(std::dynamic_pointer_cast(kDistributionRange)); + } + const auto kUserDefinedDistribution = GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDistributionSet = GetWriterDistributionSet(); + if (kDistributionSet) + { + auto clonedChild = std::dynamic_pointer_cast(kDistributionSet)->Clone(); + auto clonedChildIDistributionSet = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDistributionSet(std::dynamic_pointer_cast(clonedChildIDistributionSet)); + } + const auto kDistributionRange = GetWriterDistributionRange(); + if (kDistributionRange) + { + auto clonedChild = std::dynamic_pointer_cast(kDistributionRange)->Clone(); + auto clonedChildIDistributionRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDistributionRange(std::dynamic_pointer_cast(clonedChildIDistributionRange)); + } + const auto kUserDefinedDistribution = GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedDistribution)->Clone(); + auto clonedChildIUserDefinedDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedDistribution(std::dynamic_pointer_cast(clonedChildIUserDefinedDistribution)); + } + return clonedObject; + } + + std::string DeterministicSingleParameterDistributionTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET) + { + return std::dynamic_pointer_cast(GetDistributionSet()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE) + { + return std::dynamic_pointer_cast(GetDistributionRange()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetUserDefinedDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> DeterministicSingleParameterDistributionTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DeterministicSingleParameterDistributionTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DeterministicSingleParameterDistributionTypeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DeterministicSingleParameterDistributionTypeImpl::IsSetDistributionSet() const + { + return _isSetDistributionSet; + } + bool DeterministicSingleParameterDistributionTypeImpl::IsSetDistributionRange() const + { + return _isSetDistributionRange; + } + bool DeterministicSingleParameterDistributionTypeImpl::IsSetUserDefinedDistribution() const + { + return _isSetUserDefinedDistribution; + } + + IOpenScenarioFlexElement* DimensionsImpl::GetOpenScenarioFlexElement() + { + return this; + } + double DimensionsImpl::GetHeight() const + { + return _height; + } + double DimensionsImpl::GetLength() const + { + return _length; + } + double DimensionsImpl::GetWidth() const + { + return _width; + } + + + void DimensionsImpl::SetHeight(const double height) + { + _height = height; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + _isSetHeight = true; + } + + void DimensionsImpl::SetLength(const double length) + { + _length = length; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH); + _isSetLength = true; + } + + void DimensionsImpl::SetWidth(const double width) + { + _width = width; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WIDTH); + _isSetWidth = true; + } + + std::shared_ptr DimensionsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DimensionsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDimensions).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDimensionsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DimensionsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DimensionsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DimensionsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DimensionsImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + return GetHeight(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + return GetLength(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__WIDTH) + { + return GetWidth(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DimensionsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DimensionsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DimensionsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DimensionsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DimensionsImpl::GetModelType() const + { + return "Dimensions"; + } + + void DimensionsImpl::WriteParameterToHeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _height = {}; + } + + void DimensionsImpl::WriteParameterToLength(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, parameterName, nullTextMarker /*no textmarker*/); + _length = {}; + } + + void DimensionsImpl::WriteParameterToWidth(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WIDTH, parameterName, nullTextMarker /*no textmarker*/); + _width = {}; + } + + std::string DimensionsImpl::GetParameterFromHeight() const + { + auto height = OSC_CONSTANTS::ATTRIBUTE__HEIGHT; + return GetParameterNameFromAttribute(height); + } + + std::string DimensionsImpl::GetParameterFromLength() const + { + auto length = OSC_CONSTANTS::ATTRIBUTE__LENGTH; + return GetParameterNameFromAttribute(length); + } + + std::string DimensionsImpl::GetParameterFromWidth() const + { + auto width = OSC_CONSTANTS::ATTRIBUTE__WIDTH; + return GetParameterNameFromAttribute(width); + } + + bool DimensionsImpl::IsHeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + bool DimensionsImpl::IsLengthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LENGTH); + if (kIt != keys.end()) + return true; + return false; + } + + bool DimensionsImpl::IsWidthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WIDTH); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + DimensionsImpl::DimensionsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LENGTH, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WIDTH, SimpleType::DOUBLE); + } + + void DimensionsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + // Simple type + _height = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetHeight = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WIDTH) + { + // Simple type + _width = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWidth = true; + } + } + + SimpleType DimensionsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DimensionsImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DimensionsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_height = GetHeight(); + // Simple type + clonedObject->_length = GetLength(); + // Simple type + clonedObject->_width = GetWidth(); + // clone indicators + // clone children + return clonedObject; + } + + std::string DimensionsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DimensionsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DimensionsImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DimensionsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DimensionsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DimensionsImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + // Simple type + _height = value; + AddResolvedParameter(attributeKey); + _isSetHeight = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = value; + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WIDTH) + { + // Simple type + _width = value; + AddResolvedParameter(attributeKey); + _isSetWidth = true; + } + + } + + + bool DimensionsImpl::IsSetHeight() const + { + return _isSetHeight; + } + bool DimensionsImpl::IsSetLength() const + { + return _isSetLength; + } + bool DimensionsImpl::IsSetWidth() const + { + return _isSetWidth; + } + + IOpenScenarioFlexElement* DirectionOfTravelDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double DirectionOfTravelDistributionImpl::GetOpposite() const + { + return _opposite; + } + double DirectionOfTravelDistributionImpl::GetSame() const + { + return _same; + } + + + void DirectionOfTravelDistributionImpl::SetOpposite(const double opposite) + { + _opposite = opposite; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE); + _isSetOpposite = true; + } + + void DirectionOfTravelDistributionImpl::SetSame(const double same) + { + _same = same; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SAME); + _isSetSame = true; + } + + std::shared_ptr DirectionOfTravelDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DirectionOfTravelDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDirectionOfTravelDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDirectionOfTravelDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DirectionOfTravelDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DirectionOfTravelDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DirectionOfTravelDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DirectionOfTravelDistributionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE) + { + return GetOpposite(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SAME) + { + return GetSame(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DirectionOfTravelDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DirectionOfTravelDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DirectionOfTravelDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DirectionOfTravelDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DirectionOfTravelDistributionImpl::GetModelType() const + { + return "DirectionOfTravelDistribution"; + } + + void DirectionOfTravelDistributionImpl::WriteParameterToOpposite(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, parameterName, nullTextMarker /*no textmarker*/); + _opposite = {}; + } + + void DirectionOfTravelDistributionImpl::WriteParameterToSame(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SAME, parameterName, nullTextMarker /*no textmarker*/); + _same = {}; + } + + std::string DirectionOfTravelDistributionImpl::GetParameterFromOpposite() const + { + auto opposite = OSC_CONSTANTS::ATTRIBUTE__OPPOSITE; + return GetParameterNameFromAttribute(opposite); + } + + std::string DirectionOfTravelDistributionImpl::GetParameterFromSame() const + { + auto same = OSC_CONSTANTS::ATTRIBUTE__SAME; + return GetParameterNameFromAttribute(same); + } + + bool DirectionOfTravelDistributionImpl::IsOppositeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OPPOSITE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DirectionOfTravelDistributionImpl::IsSameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + DirectionOfTravelDistributionImpl::DirectionOfTravelDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SAME, SimpleType::DOUBLE); + } + + void DirectionOfTravelDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE) + { + // Simple type + _opposite = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOpposite = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SAME) + { + // Simple type + _same = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSame = true; + } + } + + SimpleType DirectionOfTravelDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DirectionOfTravelDistributionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DirectionOfTravelDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_opposite = GetOpposite(); + // Simple type + clonedObject->_same = GetSame(); + // clone indicators + // clone children + return clonedObject; + } + + std::string DirectionOfTravelDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DirectionOfTravelDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DirectionOfTravelDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DirectionOfTravelDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DirectionOfTravelDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DirectionOfTravelDistributionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE) + { + // Simple type + _opposite = value; + AddResolvedParameter(attributeKey); + _isSetOpposite = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SAME) + { + // Simple type + _same = value; + AddResolvedParameter(attributeKey); + _isSetSame = true; + } + + } + + + bool DirectionOfTravelDistributionImpl::IsSetOpposite() const + { + return _isSetOpposite; + } + bool DirectionOfTravelDistributionImpl::IsSetSame() const + { + return _isSetSame; + } + + IOpenScenarioFlexElement* DirectoryImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string DirectoryImpl::GetPath() const + { + return _path; + } + + + void DirectoryImpl::SetPath(const std::string path) + { + _path = path; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH); + _isSetPath = true; + } + + std::shared_ptr DirectoryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DirectoryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDirectory).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDirectoryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DirectoryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DirectoryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DirectoryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DirectoryImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DirectoryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DirectoryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DirectoryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DirectoryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DirectoryImpl::GetModelType() const + { + return "Directory"; + } + + void DirectoryImpl::WriteParameterToPath(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH, parameterName, nullTextMarker /*no textmarker*/); + _path = {}; + } + + std::string DirectoryImpl::GetParameterFromPath() const + { + auto path = OSC_CONSTANTS::ATTRIBUTE__PATH; + return GetParameterNameFromAttribute(path); + } + + bool DirectoryImpl::IsPathParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PATH); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + DirectoryImpl::DirectoryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PATH, SimpleType::STRING); + } + + void DirectoryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH) + { + // Simple type + _path = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPath = true; + } + } + + SimpleType DirectoryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DirectoryImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DirectoryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_path = GetPath(); + // clone indicators + // clone children + return clonedObject; + } + + std::string DirectoryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PATH) + { + return GetPath(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr DirectoryImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DirectoryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DirectoryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DirectoryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DirectoryImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH) + { + // Simple type + _path = value; + AddResolvedParameter(attributeKey); + _isSetPath = true; + } + + } + + + bool DirectoryImpl::IsSetPath() const + { + return _isSetPath; + } + + IOpenScenarioFlexElement* DisconnectTrailerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + + + std::shared_ptr DisconnectTrailerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DisconnectTrailerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDisconnectTrailerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDisconnectTrailerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DisconnectTrailerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DisconnectTrailerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DisconnectTrailerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DisconnectTrailerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DisconnectTrailerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DisconnectTrailerActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DisconnectTrailerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DisconnectTrailerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DisconnectTrailerActionImpl::GetModelType() const + { + return "DisconnectTrailerAction"; + } + + // children + + DisconnectTrailerActionImpl::DisconnectTrailerActionImpl() + { + /** + * Filling the property to type map + */ + } + + void DisconnectTrailerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DisconnectTrailerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DisconnectTrailerActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DisconnectTrailerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string DisconnectTrailerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DisconnectTrailerActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DisconnectTrailerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DisconnectTrailerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DisconnectTrailerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + + IOpenScenarioFlexElement* DistanceConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool DistanceConditionImpl::GetAlongRoute() const + { + return _alongRoute; + } + CoordinateSystem DistanceConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + bool DistanceConditionImpl::GetFreespace() const + { + return _freespace; + } + RelativeDistanceType DistanceConditionImpl::GetRelativeDistanceType() const + { + return _relativeDistanceType; + } + RoutingAlgorithm DistanceConditionImpl::GetRoutingAlgorithm() const + { + return _routingAlgorithm; + } + Rule DistanceConditionImpl::GetRule() const + { + return _rule; + } + double DistanceConditionImpl::GetValue() const + { + return _value; + } + std::shared_ptr DistanceConditionImpl::GetPosition() const + { + return _position; + } + + + void DistanceConditionImpl::SetAlongRoute(const bool alongRoute) + { + _alongRoute = alongRoute; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + _isSetAlongRoute = true; + } + + void DistanceConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void DistanceConditionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void DistanceConditionImpl::SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) + { + _relativeDistanceType = relativeDistanceType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + _isSetRelativeDistanceType = true; + } + + void DistanceConditionImpl::SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) + { + _routingAlgorithm = routingAlgorithm; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + _isSetRoutingAlgorithm = true; + } + + void DistanceConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void DistanceConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void DistanceConditionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr DistanceConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DistanceConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDistanceCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDistanceConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DistanceConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DistanceConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DistanceConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DistanceConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DistanceConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DistanceConditionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + return GetAlongRoute(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime DistanceConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DistanceConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DistanceConditionImpl::GetModelType() const + { + return "DistanceCondition"; + } + + void DistanceConditionImpl::WriteParameterToAlongRoute(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, parameterName, nullTextMarker /*no textmarker*/); + _alongRoute = {}; + } + + void DistanceConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void DistanceConditionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + void DistanceConditionImpl::WriteParameterToRelativeDistanceType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _relativeDistanceType = {}; + } + + void DistanceConditionImpl::WriteParameterToRoutingAlgorithm(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, parameterName, nullTextMarker /*no textmarker*/); + _routingAlgorithm = {}; + } + + void DistanceConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void DistanceConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string DistanceConditionImpl::GetParameterFromAlongRoute() const + { + auto alongRoute = OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE; + return GetParameterNameFromAttribute(alongRoute); + } + + std::string DistanceConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string DistanceConditionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + std::string DistanceConditionImpl::GetParameterFromRelativeDistanceType() const + { + auto relativeDistanceType = OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE; + return GetParameterNameFromAttribute(relativeDistanceType); + } + + std::string DistanceConditionImpl::GetParameterFromRoutingAlgorithm() const + { + auto routingAlgorithm = OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM; + return GetParameterNameFromAttribute(routingAlgorithm); + } + + std::string DistanceConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string DistanceConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool DistanceConditionImpl::IsAlongRouteParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsRelativeDistanceTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsRoutingAlgorithmParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DistanceConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr DistanceConditionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + DistanceConditionImpl::DistanceConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void DistanceConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(parameterLiteralValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + _relativeDistanceType = kResult; + AddResolvedParameter(attributeKey); + _isSetRelativeDistanceType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(parameterLiteralValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + _routingAlgorithm = kResult; + AddResolvedParameter(attributeKey); + _isSetRoutingAlgorithm = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType DistanceConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DistanceConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DistanceConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_alongRoute = GetAlongRoute(); + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Simple type + clonedObject->_freespace = GetFreespace(); + // Enumeration Type + const auto kRelativeDistanceType = GetRelativeDistanceType(); + if ( kRelativeDistanceType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_relativeDistanceType = RelativeDistanceType::GetFromLiteral(kRelativeDistanceType.GetLiteral()); + } + // Enumeration Type + const auto kRoutingAlgorithm = GetRoutingAlgorithm(); + if ( kRoutingAlgorithm.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_routingAlgorithm = RoutingAlgorithm::GetFromLiteral(kRoutingAlgorithm.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetAlongRoute = _isSetAlongRoute; + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetRelativeDistanceType = _isSetRelativeDistanceType; + clonedObject->_isSetRoutingAlgorithm = _isSetRoutingAlgorithm; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string DistanceConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DistanceConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> DistanceConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DistanceConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DistanceConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + auto relativeDistanceType = GetRelativeDistanceType(); + return relativeDistanceType.GetLiteral() != "UNKNOWN" ? relativeDistanceType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + auto routingAlgorithm = GetRoutingAlgorithm(); + return routingAlgorithm.GetLiteral() != "UNKNOWN" ? routingAlgorithm.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void DistanceConditionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = value; + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void DistanceConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void DistanceConditionImpl::ResetAlongRoute() + { + _isSetAlongRoute = false; + _alongRoute = {}; + + } + bool DistanceConditionImpl::IsSetAlongRoute() const + { + return _isSetAlongRoute; + } + void DistanceConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool DistanceConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + bool DistanceConditionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + void DistanceConditionImpl::ResetRelativeDistanceType() + { + _isSetRelativeDistanceType = false; + _relativeDistanceType = {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + + } + bool DistanceConditionImpl::IsSetRelativeDistanceType() const + { + return _isSetRelativeDistanceType; + } + void DistanceConditionImpl::ResetRoutingAlgorithm() + { + _isSetRoutingAlgorithm = false; + _routingAlgorithm = {RoutingAlgorithm::RoutingAlgorithmEnum::UNDEFINED}; + + } + bool DistanceConditionImpl::IsSetRoutingAlgorithm() const + { + return _isSetRoutingAlgorithm; + } + bool DistanceConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool DistanceConditionImpl::IsSetValue() const + { + return _isSetValue; + } + bool DistanceConditionImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* DistributionDefinitionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr DistributionDefinitionImpl::GetDeterministic() const + { + return _deterministic; + } + std::shared_ptr DistributionDefinitionImpl::GetStochastic() const + { + return _stochastic; + } + + + void DistributionDefinitionImpl::SetDeterministic(std::shared_ptr deterministic) + { + _deterministic = deterministic; + _stochastic = {}; + _isSetDeterministic = true; + } + + void DistributionDefinitionImpl::SetStochastic(std::shared_ptr stochastic) + { + _stochastic = stochastic; + _deterministic = {}; + _isSetStochastic = true; + } + + std::shared_ptr DistributionDefinitionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DistributionDefinitionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDistributionDefinition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDistributionDefinitionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DistributionDefinitionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DistributionDefinitionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DistributionDefinitionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DistributionDefinitionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DistributionDefinitionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DistributionDefinitionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DistributionDefinitionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DistributionDefinitionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DistributionDefinitionImpl::GetModelType() const + { + return "DistributionDefinition"; + } + + // children + std::shared_ptr DistributionDefinitionImpl::GetWriterDeterministic() const + { + return std::dynamic_pointer_cast(_deterministic); + } + std::shared_ptr DistributionDefinitionImpl::GetWriterStochastic() const + { + return std::dynamic_pointer_cast(_stochastic); + } + + DistributionDefinitionImpl::DistributionDefinitionImpl() + { + /** + * Filling the property to type map + */ + } + + void DistributionDefinitionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DistributionDefinitionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DistributionDefinitionImpl::GetChildren() const + { + std::vector> result; + + const auto kDeterministic = GetWriterDeterministic(); + if (kDeterministic) + { + result.push_back(std::dynamic_pointer_cast(kDeterministic)); + } + const auto kStochastic = GetWriterStochastic(); + if (kStochastic) + { + result.push_back(std::dynamic_pointer_cast(kStochastic)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DistributionDefinitionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDeterministic = GetWriterDeterministic(); + if (kDeterministic) + { + auto clonedChild = std::dynamic_pointer_cast(kDeterministic)->Clone(); + auto clonedChildIDeterministic = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeterministic(std::dynamic_pointer_cast(clonedChildIDeterministic)); + } + const auto kStochastic = GetWriterStochastic(); + if (kStochastic) + { + auto clonedChild = std::dynamic_pointer_cast(kStochastic)->Clone(); + auto clonedChildIStochastic = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStochastic(std::dynamic_pointer_cast(clonedChildIStochastic)); + } + return clonedObject; + } + + std::string DistributionDefinitionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionDefinitionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DETERMINISTIC) + { + return std::dynamic_pointer_cast(GetDeterministic()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STOCHASTIC) + { + return std::dynamic_pointer_cast(GetStochastic()); + } + throw KeyNotSupportedException(); + } + + std::vector> DistributionDefinitionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionDefinitionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DistributionDefinitionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DistributionDefinitionImpl::IsSetDeterministic() const + { + return _isSetDeterministic; + } + bool DistributionDefinitionImpl::IsSetStochastic() const + { + return _isSetStochastic; + } + + IOpenScenarioFlexElement* DistributionRangeImpl::GetOpenScenarioFlexElement() + { + return this; + } + double DistributionRangeImpl::GetStepWidth() const + { + return _stepWidth; + } + std::shared_ptr DistributionRangeImpl::GetRange() const + { + return _range; + } + + + void DistributionRangeImpl::SetStepWidth(const double stepWidth) + { + _stepWidth = stepWidth; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH); + _isSetStepWidth = true; + } + + void DistributionRangeImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr DistributionRangeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DistributionRangeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDistributionRange).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDistributionRangeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DistributionRangeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DistributionRangeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DistributionRangeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DistributionRangeImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH) + { + return GetStepWidth(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DistributionRangeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DistributionRangeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DistributionRangeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DistributionRangeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DistributionRangeImpl::GetModelType() const + { + return "DistributionRange"; + } + + void DistributionRangeImpl::WriteParameterToStepWidth(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, parameterName, nullTextMarker /*no textmarker*/); + _stepWidth = {}; + } + + std::string DistributionRangeImpl::GetParameterFromStepWidth() const + { + auto stepWidth = OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH; + return GetParameterNameFromAttribute(stepWidth); + } + + bool DistributionRangeImpl::IsStepWidthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr DistributionRangeImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + DistributionRangeImpl::DistributionRangeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, SimpleType::DOUBLE); + } + + void DistributionRangeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH) + { + // Simple type + _stepWidth = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetStepWidth = true; + } + } + + SimpleType DistributionRangeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DistributionRangeImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DistributionRangeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_stepWidth = GetStepWidth(); + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string DistributionRangeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionRangeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> DistributionRangeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionRangeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DistributionRangeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DistributionRangeImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH) + { + // Simple type + _stepWidth = value; + AddResolvedParameter(attributeKey); + _isSetStepWidth = true; + } + + } + + + bool DistributionRangeImpl::IsSetStepWidth() const + { + return _isSetStepWidth; + } + bool DistributionRangeImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* DistributionSetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> DistributionSetImpl::GetElements() const + { + std::vector> temp; + for(auto&& elm: _elements) + temp.push_back(elm); + return temp; + } + std::vector> DistributionSetImpl::GetWriterElements() const + { + return _elements; + } + + int DistributionSetImpl::GetElementsSize() const + { + return static_cast(_elements.size()); + } + + std::shared_ptr DistributionSetImpl::GetElementsAtIndex(unsigned int index) const + { + if (index >= 0 && _elements.size() > index) + { + return _elements[index]; + } + return nullptr; + } + + + void DistributionSetImpl::SetElements(std::vector>& elements) + { + _elements = elements; + _isSetElements = true; + } + + std::shared_ptr DistributionSetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DistributionSetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDistributionSet).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDistributionSetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DistributionSetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DistributionSetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DistributionSetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DistributionSetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DistributionSetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DistributionSetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DistributionSetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DistributionSetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DistributionSetImpl::GetModelType() const + { + return "DistributionSet"; + } + + // children + + DistributionSetImpl::DistributionSetImpl() + { + /** + * Filling the property to type map + */ + } + + void DistributionSetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType DistributionSetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DistributionSetImpl::GetChildren() const + { + std::vector> result; + + auto elements = GetWriterElements(); + if (!elements.empty()) + { + for(auto&& item : elements) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DistributionSetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kElements = GetWriterElements(); + if (!kElements.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kElements) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetElements(clonedList); + } + return clonedObject; + } + + std::string DistributionSetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionSetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DistributionSetImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ELEMENT) + { + std::vector> vect; + for (auto&& elem : GetElements()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionSetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DistributionSetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool DistributionSetImpl::IsSetElements() const + { + return _isSetElements; + } + + IOpenScenarioFlexElement* DistributionSetElementImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string DistributionSetElementImpl::GetValue() const + { + return _value; + } + + + void DistributionSetElementImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr DistributionSetElementImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DistributionSetElementImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDistributionSetElement).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDistributionSetElementWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DistributionSetElementImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DistributionSetElementImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DistributionSetElementImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DistributionSetElementImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t DistributionSetElementImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DistributionSetElementImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DistributionSetElementImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DistributionSetElementImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DistributionSetElementImpl::GetModelType() const + { + return "DistributionSetElement"; + } + + void DistributionSetElementImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string DistributionSetElementImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool DistributionSetElementImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + DistributionSetElementImpl::DistributionSetElementImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void DistributionSetElementImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType DistributionSetElementImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DistributionSetElementImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DistributionSetElementImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string DistributionSetElementImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionSetElementImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DistributionSetElementImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DistributionSetElementImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DistributionSetElementImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DistributionSetElementImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool DistributionSetElementImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* DomeImageImpl::GetOpenScenarioFlexElement() + { + return this; + } + double DomeImageImpl::GetAzimuthOffset() const + { + return _azimuthOffset; + } + std::shared_ptr DomeImageImpl::GetDomeFile() const + { + return _domeFile; + } + + + void DomeImageImpl::SetAzimuthOffset(const double azimuthOffset) + { + _azimuthOffset = azimuthOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + _isSetAzimuthOffset = true; + } + + void DomeImageImpl::SetDomeFile(std::shared_ptr domeFile) + { + _domeFile = domeFile; + _isSetDomeFile = true; + } + + std::shared_ptr DomeImageImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DomeImageImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDomeImage).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDomeImageWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DomeImageImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DomeImageImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DomeImageImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DomeImageImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET) + { + return GetAzimuthOffset(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DomeImageImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DomeImageImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DomeImageImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DomeImageImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DomeImageImpl::GetModelType() const + { + return "DomeImage"; + } + + void DomeImageImpl::WriteParameterToAzimuthOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _azimuthOffset = {}; + } + + std::string DomeImageImpl::GetParameterFromAzimuthOffset() const + { + auto azimuthOffset = OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET; + return GetParameterNameFromAttribute(azimuthOffset); + } + + bool DomeImageImpl::IsAzimuthOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr DomeImageImpl::GetWriterDomeFile() const + { + return std::dynamic_pointer_cast(_domeFile); + } + + DomeImageImpl::DomeImageImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, SimpleType::DOUBLE); + } + + void DomeImageImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET) + { + // Simple type + _azimuthOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAzimuthOffset = true; + } + } + + SimpleType DomeImageImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DomeImageImpl::GetChildren() const + { + std::vector> result; + + const auto kDomeFile = GetWriterDomeFile(); + if (kDomeFile) + { + result.push_back(std::dynamic_pointer_cast(kDomeFile)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DomeImageImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_azimuthOffset = GetAzimuthOffset(); + // clone indicators + clonedObject->_isSetAzimuthOffset = _isSetAzimuthOffset; + // clone children + const auto kDomeFile = GetWriterDomeFile(); + if (kDomeFile) + { + auto clonedChild = std::dynamic_pointer_cast(kDomeFile)->Clone(); + auto clonedChildIFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDomeFile(std::dynamic_pointer_cast(clonedChildIFile)); + } + return clonedObject; + } + + std::string DomeImageImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DomeImageImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DOME_FILE) + { + return std::dynamic_pointer_cast(GetDomeFile()); + } + throw KeyNotSupportedException(); + } + + std::vector> DomeImageImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DomeImageImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DomeImageImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DomeImageImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET) + { + // Simple type + _azimuthOffset = value; + AddResolvedParameter(attributeKey); + _isSetAzimuthOffset = true; + } + + } + + + void DomeImageImpl::ResetAzimuthOffset() + { + _isSetAzimuthOffset = false; + _azimuthOffset = {0}; + + } + bool DomeImageImpl::IsSetAzimuthOffset() const + { + return _isSetAzimuthOffset; + } + bool DomeImageImpl::IsSetDomeFile() const + { + return _isSetDomeFile; + } + + IOpenScenarioFlexElement* DynamicConstraintsImpl::GetOpenScenarioFlexElement() + { + return this; + } + double DynamicConstraintsImpl::GetMaxAcceleration() const + { + return _maxAcceleration; + } + double DynamicConstraintsImpl::GetMaxAccelerationRate() const + { + return _maxAccelerationRate; + } + double DynamicConstraintsImpl::GetMaxDeceleration() const + { + return _maxDeceleration; + } + double DynamicConstraintsImpl::GetMaxDecelerationRate() const + { + return _maxDecelerationRate; + } + double DynamicConstraintsImpl::GetMaxSpeed() const + { + return _maxSpeed; + } + + + void DynamicConstraintsImpl::SetMaxAcceleration(const double maxAcceleration) + { + _maxAcceleration = maxAcceleration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + _isSetMaxAcceleration = true; + } + + void DynamicConstraintsImpl::SetMaxAccelerationRate(const double maxAccelerationRate) + { + _maxAccelerationRate = maxAccelerationRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + _isSetMaxAccelerationRate = true; + } + + void DynamicConstraintsImpl::SetMaxDeceleration(const double maxDeceleration) + { + _maxDeceleration = maxDeceleration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + _isSetMaxDeceleration = true; + } + + void DynamicConstraintsImpl::SetMaxDecelerationRate(const double maxDecelerationRate) + { + _maxDecelerationRate = maxDecelerationRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + _isSetMaxDecelerationRate = true; + } + + void DynamicConstraintsImpl::SetMaxSpeed(const double maxSpeed) + { + _maxSpeed = maxSpeed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + _isSetMaxSpeed = true; + } + + std::shared_ptr DynamicConstraintsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(DynamicConstraintsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IDynamicConstraints).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IDynamicConstraintsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr DynamicConstraintsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t DynamicConstraintsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int DynamicConstraintsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double DynamicConstraintsImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + return GetMaxAcceleration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + return GetMaxAccelerationRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + return GetMaxDeceleration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + return GetMaxDecelerationRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + return GetMaxSpeed(); + } + throw KeyNotSupportedException(); + + } + + uint16_t DynamicConstraintsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool DynamicConstraintsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime DynamicConstraintsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr DynamicConstraintsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string DynamicConstraintsImpl::GetModelType() const + { + return "DynamicConstraints"; + } + + void DynamicConstraintsImpl::WriteParameterToMaxAcceleration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, parameterName, nullTextMarker /*no textmarker*/); + _maxAcceleration = {}; + } + + void DynamicConstraintsImpl::WriteParameterToMaxAccelerationRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxAccelerationRate = {}; + } + + void DynamicConstraintsImpl::WriteParameterToMaxDeceleration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, parameterName, nullTextMarker /*no textmarker*/); + _maxDeceleration = {}; + } + + void DynamicConstraintsImpl::WriteParameterToMaxDecelerationRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxDecelerationRate = {}; + } + + void DynamicConstraintsImpl::WriteParameterToMaxSpeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, parameterName, nullTextMarker /*no textmarker*/); + _maxSpeed = {}; + } + + std::string DynamicConstraintsImpl::GetParameterFromMaxAcceleration() const + { + auto maxAcceleration = OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION; + return GetParameterNameFromAttribute(maxAcceleration); + } + + std::string DynamicConstraintsImpl::GetParameterFromMaxAccelerationRate() const + { + auto maxAccelerationRate = OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE; + return GetParameterNameFromAttribute(maxAccelerationRate); + } + + std::string DynamicConstraintsImpl::GetParameterFromMaxDeceleration() const + { + auto maxDeceleration = OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION; + return GetParameterNameFromAttribute(maxDeceleration); + } + + std::string DynamicConstraintsImpl::GetParameterFromMaxDecelerationRate() const + { + auto maxDecelerationRate = OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE; + return GetParameterNameFromAttribute(maxDecelerationRate); + } + + std::string DynamicConstraintsImpl::GetParameterFromMaxSpeed() const + { + auto maxSpeed = OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED; + return GetParameterNameFromAttribute(maxSpeed); + } + + bool DynamicConstraintsImpl::IsMaxAccelerationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool DynamicConstraintsImpl::IsMaxAccelerationRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DynamicConstraintsImpl::IsMaxDecelerationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool DynamicConstraintsImpl::IsMaxDecelerationRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool DynamicConstraintsImpl::IsMaxSpeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + DynamicConstraintsImpl::DynamicConstraintsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, SimpleType::DOUBLE); + } + + void DynamicConstraintsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + // Simple type + _maxAcceleration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxAcceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + // Simple type + _maxAccelerationRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxAccelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + // Simple type + _maxDeceleration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxDeceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + // Simple type + _maxDecelerationRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxDecelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + // Simple type + _maxSpeed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxSpeed = true; + } + } + + SimpleType DynamicConstraintsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> DynamicConstraintsImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr DynamicConstraintsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maxAcceleration = GetMaxAcceleration(); + // Simple type + clonedObject->_maxAccelerationRate = GetMaxAccelerationRate(); + // Simple type + clonedObject->_maxDeceleration = GetMaxDeceleration(); + // Simple type + clonedObject->_maxDecelerationRate = GetMaxDecelerationRate(); + // Simple type + clonedObject->_maxSpeed = GetMaxSpeed(); + // clone indicators + clonedObject->_isSetMaxAcceleration = _isSetMaxAcceleration; + clonedObject->_isSetMaxAccelerationRate = _isSetMaxAccelerationRate; + clonedObject->_isSetMaxDeceleration = _isSetMaxDeceleration; + clonedObject->_isSetMaxDecelerationRate = _isSetMaxDecelerationRate; + clonedObject->_isSetMaxSpeed = _isSetMaxSpeed; + // clone children + return clonedObject; + } + + std::string DynamicConstraintsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr DynamicConstraintsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> DynamicConstraintsImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr DynamicConstraintsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string DynamicConstraintsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void DynamicConstraintsImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + // Simple type + _maxAcceleration = value; + AddResolvedParameter(attributeKey); + _isSetMaxAcceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + // Simple type + _maxAccelerationRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxAccelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + // Simple type + _maxDeceleration = value; + AddResolvedParameter(attributeKey); + _isSetMaxDeceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + // Simple type + _maxDecelerationRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxDecelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + // Simple type + _maxSpeed = value; + AddResolvedParameter(attributeKey); + _isSetMaxSpeed = true; + } + + } + + + void DynamicConstraintsImpl::ResetMaxAcceleration() + { + _isSetMaxAcceleration = false; + _maxAcceleration = {}; + + } + bool DynamicConstraintsImpl::IsSetMaxAcceleration() const + { + return _isSetMaxAcceleration; + } + void DynamicConstraintsImpl::ResetMaxAccelerationRate() + { + _isSetMaxAccelerationRate = false; + _maxAccelerationRate = {}; + + } + bool DynamicConstraintsImpl::IsSetMaxAccelerationRate() const + { + return _isSetMaxAccelerationRate; + } + void DynamicConstraintsImpl::ResetMaxDeceleration() + { + _isSetMaxDeceleration = false; + _maxDeceleration = {}; + + } + bool DynamicConstraintsImpl::IsSetMaxDeceleration() const + { + return _isSetMaxDeceleration; + } + void DynamicConstraintsImpl::ResetMaxDecelerationRate() + { + _isSetMaxDecelerationRate = false; + _maxDecelerationRate = {}; + + } + bool DynamicConstraintsImpl::IsSetMaxDecelerationRate() const + { + return _isSetMaxDecelerationRate; + } + void DynamicConstraintsImpl::ResetMaxSpeed() + { + _isSetMaxSpeed = false; + _maxSpeed = {}; + + } + bool DynamicConstraintsImpl::IsSetMaxSpeed() const + { + return _isSetMaxSpeed; + } + + IOpenScenarioFlexElement* EndOfRoadConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double EndOfRoadConditionImpl::GetDuration() const + { + return _duration; + } + + + void EndOfRoadConditionImpl::SetDuration(const double duration) + { + _duration = duration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION); + _isSetDuration = true; + } + + std::shared_ptr EndOfRoadConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EndOfRoadConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEndOfRoadCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEndOfRoadConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EndOfRoadConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EndOfRoadConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EndOfRoadConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EndOfRoadConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + return GetDuration(); + } + throw KeyNotSupportedException(); + + } + + uint16_t EndOfRoadConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EndOfRoadConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EndOfRoadConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EndOfRoadConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EndOfRoadConditionImpl::GetModelType() const + { + return "EndOfRoadCondition"; + } + + void EndOfRoadConditionImpl::WriteParameterToDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, parameterName, nullTextMarker /*no textmarker*/); + _duration = {}; + } + + std::string EndOfRoadConditionImpl::GetParameterFromDuration() const + { + auto duration = OSC_CONSTANTS::ATTRIBUTE__DURATION; + return GetParameterNameFromAttribute(duration); + } + + bool EndOfRoadConditionImpl::IsDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + EndOfRoadConditionImpl::EndOfRoadConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DURATION, SimpleType::DOUBLE); + } + + void EndOfRoadConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + } + + SimpleType EndOfRoadConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EndOfRoadConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EndOfRoadConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_duration = GetDuration(); + // clone indicators + // clone children + return clonedObject; + } + + std::string EndOfRoadConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EndOfRoadConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> EndOfRoadConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EndOfRoadConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EndOfRoadConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void EndOfRoadConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = value; + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + + } + + + bool EndOfRoadConditionImpl::IsSetDuration() const + { + return _isSetDuration; + } + + IOpenScenarioFlexElement* EntitiesImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> EntitiesImpl::GetScenarioObjects() const + { + std::vector> temp; + for(auto&& elm: _scenarioObjects) + temp.push_back(elm); + return temp; + } + std::vector> EntitiesImpl::GetWriterScenarioObjects() const + { + return _scenarioObjects; + } + + int EntitiesImpl::GetScenarioObjectsSize() const + { + return static_cast(_scenarioObjects.size()); + } + + std::shared_ptr EntitiesImpl::GetScenarioObjectsAtIndex(unsigned int index) const + { + if (index >= 0 && _scenarioObjects.size() > index) + { + return _scenarioObjects[index]; + } + return nullptr; + } + std::vector> EntitiesImpl::GetEntitySelections() const + { + std::vector> temp; + for(auto&& elm: _entitySelections) + temp.push_back(elm); + return temp; + } + std::vector> EntitiesImpl::GetWriterEntitySelections() const + { + return _entitySelections; + } + + int EntitiesImpl::GetEntitySelectionsSize() const + { + return static_cast(_entitySelections.size()); + } + + std::shared_ptr EntitiesImpl::GetEntitySelectionsAtIndex(unsigned int index) const + { + if (index >= 0 && _entitySelections.size() > index) + { + return _entitySelections[index]; + } + return nullptr; + } + + + void EntitiesImpl::SetScenarioObjects(std::vector>& scenarioObjects) + { + _scenarioObjects = scenarioObjects; + _isSetScenarioObjects = true; + } + + void EntitiesImpl::SetEntitySelections(std::vector>& entitySelections) + { + _entitySelections = entitySelections; + _isSetEntitySelections = true; + } + + std::shared_ptr EntitiesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntitiesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntities).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntitiesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntitiesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntitiesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntitiesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntitiesImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntitiesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntitiesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntitiesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntitiesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntitiesImpl::GetModelType() const + { + return "Entities"; + } + + // children + + EntitiesImpl::EntitiesImpl() + { + /** + * Filling the property to type map + */ + } + + void EntitiesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EntitiesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntitiesImpl::GetChildren() const + { + std::vector> result; + + auto scenarioObjects = GetWriterScenarioObjects(); + if (!scenarioObjects.empty()) + { + for(auto&& item : scenarioObjects) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto entitySelections = GetWriterEntitySelections(); + if (!entitySelections.empty()) + { + for(auto&& item : entitySelections) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntitiesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kScenarioObjects = GetWriterScenarioObjects(); + if (!kScenarioObjects.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kScenarioObjects) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetScenarioObjects(clonedList); + } + const auto kEntitySelections = GetWriterEntitySelections(); + if (!kEntitySelections.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntitySelections) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntitySelections(clonedList); + } + return clonedObject; + } + + std::string EntitiesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EntitiesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> EntitiesImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT) + { + std::vector> vect; + for (auto&& elem : GetScenarioObjects()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_SELECTION) + { + std::vector> vect; + for (auto&& elem : GetEntitySelections()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EntitiesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntitiesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void EntitiesImpl::ResetScenarioObjects() + { + _isSetScenarioObjects = false; + _scenarioObjects = {}; + + } + bool EntitiesImpl::IsSetScenarioObjects() const + { + return _isSetScenarioObjects; + } + void EntitiesImpl::ResetEntitySelections() + { + _isSetEntitySelections = false; + _entitySelections = {}; + + } + bool EntitiesImpl::IsSetEntitySelections() const + { + return _isSetEntitySelections; + } + + IOpenScenarioFlexElement* EntityActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> EntityActionImpl::GetEntityRef() const + { + return _entityRef; + } + std::shared_ptr EntityActionImpl::GetAddEntityAction() const + { + return _addEntityAction; + } + std::shared_ptr EntityActionImpl::GetDeleteEntityAction() const + { + return _deleteEntityAction; + } + + + void EntityActionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void EntityActionImpl::SetAddEntityAction(std::shared_ptr addEntityAction) + { + _addEntityAction = addEntityAction; + _deleteEntityAction = {}; + _isSetAddEntityAction = true; + } + + void EntityActionImpl::SetDeleteEntityAction(std::shared_ptr deleteEntityAction) + { + _deleteEntityAction = deleteEntityAction; + _addEntityAction = {}; + _isSetDeleteEntityAction = true; + } + + std::shared_ptr EntityActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntityActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityActionImpl::GetModelType() const + { + return "EntityAction"; + } + + void EntityActionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string EntityActionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool EntityActionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr EntityActionImpl::GetWriterAddEntityAction() const + { + return std::dynamic_pointer_cast(_addEntityAction); + } + std::shared_ptr EntityActionImpl::GetWriterDeleteEntityAction() const + { + return std::dynamic_pointer_cast(_deleteEntityAction); + } + + EntityActionImpl::EntityActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void EntityActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType EntityActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityActionImpl::GetChildren() const + { + std::vector> result; + + const auto kAddEntityAction = GetWriterAddEntityAction(); + if (kAddEntityAction) + { + result.push_back(std::dynamic_pointer_cast(kAddEntityAction)); + } + const auto kDeleteEntityAction = GetWriterDeleteEntityAction(); + if (kDeleteEntityAction) + { + result.push_back(std::dynamic_pointer_cast(kDeleteEntityAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + const auto kAddEntityAction = GetWriterAddEntityAction(); + if (kAddEntityAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAddEntityAction)->Clone(); + auto clonedChildIAddEntityAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAddEntityAction(std::dynamic_pointer_cast(clonedChildIAddEntityAction)); + } + const auto kDeleteEntityAction = GetWriterDeleteEntityAction(); + if (kDeleteEntityAction) + { + auto clonedChild = std::dynamic_pointer_cast(kDeleteEntityAction)->Clone(); + auto clonedChildIDeleteEntityAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDeleteEntityAction(std::dynamic_pointer_cast(clonedChildIDeleteEntityAction)); + } + return clonedObject; + } + + std::string EntityActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION) + { + return std::dynamic_pointer_cast(GetAddEntityAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION) + { + return std::dynamic_pointer_cast(GetDeleteEntityAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> EntityActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string EntityActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EntityActionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool EntityActionImpl::IsSetAddEntityAction() const + { + return _isSetAddEntityAction; + } + bool EntityActionImpl::IsSetDeleteEntityAction() const + { + return _isSetDeleteEntityAction; + } + + IOpenScenarioFlexElement* EntityConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr EntityConditionImpl::GetEndOfRoadCondition() const + { + return _endOfRoadCondition; + } + std::shared_ptr EntityConditionImpl::GetCollisionCondition() const + { + return _collisionCondition; + } + std::shared_ptr EntityConditionImpl::GetOffroadCondition() const + { + return _offroadCondition; + } + std::shared_ptr EntityConditionImpl::GetTimeHeadwayCondition() const + { + return _timeHeadwayCondition; + } + std::shared_ptr EntityConditionImpl::GetTimeToCollisionCondition() const + { + return _timeToCollisionCondition; + } + std::shared_ptr EntityConditionImpl::GetAccelerationCondition() const + { + return _accelerationCondition; + } + std::shared_ptr EntityConditionImpl::GetStandStillCondition() const + { + return _standStillCondition; + } + std::shared_ptr EntityConditionImpl::GetSpeedCondition() const + { + return _speedCondition; + } + std::shared_ptr EntityConditionImpl::GetRelativeSpeedCondition() const + { + return _relativeSpeedCondition; + } + std::shared_ptr EntityConditionImpl::GetTraveledDistanceCondition() const + { + return _traveledDistanceCondition; + } + std::shared_ptr EntityConditionImpl::GetReachPositionCondition() const + { + return _reachPositionCondition; + } + std::shared_ptr EntityConditionImpl::GetDistanceCondition() const + { + return _distanceCondition; + } + std::shared_ptr EntityConditionImpl::GetRelativeDistanceCondition() const + { + return _relativeDistanceCondition; + } + std::shared_ptr EntityConditionImpl::GetRelativeClearanceCondition() const + { + return _relativeClearanceCondition; + } + std::shared_ptr EntityConditionImpl::GetAngleCondition() const + { + return _angleCondition; + } + std::shared_ptr EntityConditionImpl::GetRelativeAngleCondition() const + { + return _relativeAngleCondition; + } + + + void EntityConditionImpl::SetEndOfRoadCondition(std::shared_ptr endOfRoadCondition) + { + _endOfRoadCondition = endOfRoadCondition; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetEndOfRoadCondition = true; + } + + void EntityConditionImpl::SetCollisionCondition(std::shared_ptr collisionCondition) + { + _collisionCondition = collisionCondition; + _endOfRoadCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetCollisionCondition = true; + } + + void EntityConditionImpl::SetOffroadCondition(std::shared_ptr offroadCondition) + { + _offroadCondition = offroadCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetOffroadCondition = true; + } + + void EntityConditionImpl::SetTimeHeadwayCondition(std::shared_ptr timeHeadwayCondition) + { + _timeHeadwayCondition = timeHeadwayCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetTimeHeadwayCondition = true; + } + + void EntityConditionImpl::SetTimeToCollisionCondition(std::shared_ptr timeToCollisionCondition) + { + _timeToCollisionCondition = timeToCollisionCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetTimeToCollisionCondition = true; + } + + void EntityConditionImpl::SetAccelerationCondition(std::shared_ptr accelerationCondition) + { + _accelerationCondition = accelerationCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetAccelerationCondition = true; + } + + void EntityConditionImpl::SetStandStillCondition(std::shared_ptr standStillCondition) + { + _standStillCondition = standStillCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetStandStillCondition = true; + } + + void EntityConditionImpl::SetSpeedCondition(std::shared_ptr speedCondition) + { + _speedCondition = speedCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetSpeedCondition = true; + } + + void EntityConditionImpl::SetRelativeSpeedCondition(std::shared_ptr relativeSpeedCondition) + { + _relativeSpeedCondition = relativeSpeedCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetRelativeSpeedCondition = true; + } + + void EntityConditionImpl::SetTraveledDistanceCondition(std::shared_ptr traveledDistanceCondition) + { + _traveledDistanceCondition = traveledDistanceCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetTraveledDistanceCondition = true; + } + + void EntityConditionImpl::SetReachPositionCondition(std::shared_ptr reachPositionCondition) + { + _reachPositionCondition = reachPositionCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetReachPositionCondition = true; + } + + void EntityConditionImpl::SetDistanceCondition(std::shared_ptr distanceCondition) + { + _distanceCondition = distanceCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetDistanceCondition = true; + } + + void EntityConditionImpl::SetRelativeDistanceCondition(std::shared_ptr relativeDistanceCondition) + { + _relativeDistanceCondition = relativeDistanceCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetRelativeDistanceCondition = true; + } + + void EntityConditionImpl::SetRelativeClearanceCondition(std::shared_ptr relativeClearanceCondition) + { + _relativeClearanceCondition = relativeClearanceCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _angleCondition = {}; + _relativeAngleCondition = {}; + _isSetRelativeClearanceCondition = true; + } + + void EntityConditionImpl::SetAngleCondition(std::shared_ptr angleCondition) + { + _angleCondition = angleCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _relativeAngleCondition = {}; + _isSetAngleCondition = true; + } + + void EntityConditionImpl::SetRelativeAngleCondition(std::shared_ptr relativeAngleCondition) + { + _relativeAngleCondition = relativeAngleCondition; + _endOfRoadCondition = {}; + _collisionCondition = {}; + _offroadCondition = {}; + _timeHeadwayCondition = {}; + _timeToCollisionCondition = {}; + _accelerationCondition = {}; + _standStillCondition = {}; + _speedCondition = {}; + _relativeSpeedCondition = {}; + _traveledDistanceCondition = {}; + _reachPositionCondition = {}; + _distanceCondition = {}; + _relativeDistanceCondition = {}; + _relativeClearanceCondition = {}; + _angleCondition = {}; + _isSetRelativeAngleCondition = true; + } + + std::shared_ptr EntityConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntityConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityConditionImpl::GetModelType() const + { + return "EntityCondition"; + } + + // children + std::shared_ptr EntityConditionImpl::GetWriterEndOfRoadCondition() const + { + return std::dynamic_pointer_cast(_endOfRoadCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterCollisionCondition() const + { + return std::dynamic_pointer_cast(_collisionCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterOffroadCondition() const + { + return std::dynamic_pointer_cast(_offroadCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterTimeHeadwayCondition() const + { + return std::dynamic_pointer_cast(_timeHeadwayCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterTimeToCollisionCondition() const + { + return std::dynamic_pointer_cast(_timeToCollisionCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterAccelerationCondition() const + { + return std::dynamic_pointer_cast(_accelerationCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterStandStillCondition() const + { + return std::dynamic_pointer_cast(_standStillCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterSpeedCondition() const + { + return std::dynamic_pointer_cast(_speedCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterRelativeSpeedCondition() const + { + return std::dynamic_pointer_cast(_relativeSpeedCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterTraveledDistanceCondition() const + { + return std::dynamic_pointer_cast(_traveledDistanceCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterReachPositionCondition() const + { + return std::dynamic_pointer_cast(_reachPositionCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterDistanceCondition() const + { + return std::dynamic_pointer_cast(_distanceCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterRelativeDistanceCondition() const + { + return std::dynamic_pointer_cast(_relativeDistanceCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterRelativeClearanceCondition() const + { + return std::dynamic_pointer_cast(_relativeClearanceCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterAngleCondition() const + { + return std::dynamic_pointer_cast(_angleCondition); + } + std::shared_ptr EntityConditionImpl::GetWriterRelativeAngleCondition() const + { + return std::dynamic_pointer_cast(_relativeAngleCondition); + } + + EntityConditionImpl::EntityConditionImpl() + { + /** + * Filling the property to type map + */ + } + + void EntityConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EntityConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kEndOfRoadCondition = GetWriterEndOfRoadCondition(); + if (kEndOfRoadCondition) + { + result.push_back(std::dynamic_pointer_cast(kEndOfRoadCondition)); + } + const auto kCollisionCondition = GetWriterCollisionCondition(); + if (kCollisionCondition) + { + result.push_back(std::dynamic_pointer_cast(kCollisionCondition)); + } + const auto kOffroadCondition = GetWriterOffroadCondition(); + if (kOffroadCondition) + { + result.push_back(std::dynamic_pointer_cast(kOffroadCondition)); + } + const auto kTimeHeadwayCondition = GetWriterTimeHeadwayCondition(); + if (kTimeHeadwayCondition) + { + result.push_back(std::dynamic_pointer_cast(kTimeHeadwayCondition)); + } + const auto kTimeToCollisionCondition = GetWriterTimeToCollisionCondition(); + if (kTimeToCollisionCondition) + { + result.push_back(std::dynamic_pointer_cast(kTimeToCollisionCondition)); + } + const auto kAccelerationCondition = GetWriterAccelerationCondition(); + if (kAccelerationCondition) + { + result.push_back(std::dynamic_pointer_cast(kAccelerationCondition)); + } + const auto kStandStillCondition = GetWriterStandStillCondition(); + if (kStandStillCondition) + { + result.push_back(std::dynamic_pointer_cast(kStandStillCondition)); + } + const auto kSpeedCondition = GetWriterSpeedCondition(); + if (kSpeedCondition) + { + result.push_back(std::dynamic_pointer_cast(kSpeedCondition)); + } + const auto kRelativeSpeedCondition = GetWriterRelativeSpeedCondition(); + if (kRelativeSpeedCondition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeSpeedCondition)); + } + const auto kTraveledDistanceCondition = GetWriterTraveledDistanceCondition(); + if (kTraveledDistanceCondition) + { + result.push_back(std::dynamic_pointer_cast(kTraveledDistanceCondition)); + } + const auto kReachPositionCondition = GetWriterReachPositionCondition(); + if (kReachPositionCondition) + { + result.push_back(std::dynamic_pointer_cast(kReachPositionCondition)); + } + const auto kDistanceCondition = GetWriterDistanceCondition(); + if (kDistanceCondition) + { + result.push_back(std::dynamic_pointer_cast(kDistanceCondition)); + } + const auto kRelativeDistanceCondition = GetWriterRelativeDistanceCondition(); + if (kRelativeDistanceCondition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeDistanceCondition)); + } + const auto kRelativeClearanceCondition = GetWriterRelativeClearanceCondition(); + if (kRelativeClearanceCondition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeClearanceCondition)); + } + const auto kAngleCondition = GetWriterAngleCondition(); + if (kAngleCondition) + { + result.push_back(std::dynamic_pointer_cast(kAngleCondition)); + } + const auto kRelativeAngleCondition = GetWriterRelativeAngleCondition(); + if (kRelativeAngleCondition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeAngleCondition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEndOfRoadCondition = GetWriterEndOfRoadCondition(); + if (kEndOfRoadCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kEndOfRoadCondition)->Clone(); + auto clonedChildIEndOfRoadCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEndOfRoadCondition(std::dynamic_pointer_cast(clonedChildIEndOfRoadCondition)); + } + const auto kCollisionCondition = GetWriterCollisionCondition(); + if (kCollisionCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kCollisionCondition)->Clone(); + auto clonedChildICollisionCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCollisionCondition(std::dynamic_pointer_cast(clonedChildICollisionCondition)); + } + const auto kOffroadCondition = GetWriterOffroadCondition(); + if (kOffroadCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kOffroadCondition)->Clone(); + auto clonedChildIOffroadCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOffroadCondition(std::dynamic_pointer_cast(clonedChildIOffroadCondition)); + } + const auto kTimeHeadwayCondition = GetWriterTimeHeadwayCondition(); + if (kTimeHeadwayCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeHeadwayCondition)->Clone(); + auto clonedChildITimeHeadwayCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeHeadwayCondition(std::dynamic_pointer_cast(clonedChildITimeHeadwayCondition)); + } + const auto kTimeToCollisionCondition = GetWriterTimeToCollisionCondition(); + if (kTimeToCollisionCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeToCollisionCondition)->Clone(); + auto clonedChildITimeToCollisionCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeToCollisionCondition(std::dynamic_pointer_cast(clonedChildITimeToCollisionCondition)); + } + const auto kAccelerationCondition = GetWriterAccelerationCondition(); + if (kAccelerationCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kAccelerationCondition)->Clone(); + auto clonedChildIAccelerationCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAccelerationCondition(std::dynamic_pointer_cast(clonedChildIAccelerationCondition)); + } + const auto kStandStillCondition = GetWriterStandStillCondition(); + if (kStandStillCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kStandStillCondition)->Clone(); + auto clonedChildIStandStillCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStandStillCondition(std::dynamic_pointer_cast(clonedChildIStandStillCondition)); + } + const auto kSpeedCondition = GetWriterSpeedCondition(); + if (kSpeedCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kSpeedCondition)->Clone(); + auto clonedChildISpeedCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSpeedCondition(std::dynamic_pointer_cast(clonedChildISpeedCondition)); + } + const auto kRelativeSpeedCondition = GetWriterRelativeSpeedCondition(); + if (kRelativeSpeedCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeSpeedCondition)->Clone(); + auto clonedChildIRelativeSpeedCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeSpeedCondition(std::dynamic_pointer_cast(clonedChildIRelativeSpeedCondition)); + } + const auto kTraveledDistanceCondition = GetWriterTraveledDistanceCondition(); + if (kTraveledDistanceCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kTraveledDistanceCondition)->Clone(); + auto clonedChildITraveledDistanceCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTraveledDistanceCondition(std::dynamic_pointer_cast(clonedChildITraveledDistanceCondition)); + } + const auto kReachPositionCondition = GetWriterReachPositionCondition(); + if (kReachPositionCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kReachPositionCondition)->Clone(); + auto clonedChildIReachPositionCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetReachPositionCondition(std::dynamic_pointer_cast(clonedChildIReachPositionCondition)); + } + const auto kDistanceCondition = GetWriterDistanceCondition(); + if (kDistanceCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kDistanceCondition)->Clone(); + auto clonedChildIDistanceCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDistanceCondition(std::dynamic_pointer_cast(clonedChildIDistanceCondition)); + } + const auto kRelativeDistanceCondition = GetWriterRelativeDistanceCondition(); + if (kRelativeDistanceCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeDistanceCondition)->Clone(); + auto clonedChildIRelativeDistanceCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeDistanceCondition(std::dynamic_pointer_cast(clonedChildIRelativeDistanceCondition)); + } + const auto kRelativeClearanceCondition = GetWriterRelativeClearanceCondition(); + if (kRelativeClearanceCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeClearanceCondition)->Clone(); + auto clonedChildIRelativeClearanceCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeClearanceCondition(std::dynamic_pointer_cast(clonedChildIRelativeClearanceCondition)); + } + const auto kAngleCondition = GetWriterAngleCondition(); + if (kAngleCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kAngleCondition)->Clone(); + auto clonedChildIAngleCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAngleCondition(std::dynamic_pointer_cast(clonedChildIAngleCondition)); + } + const auto kRelativeAngleCondition = GetWriterRelativeAngleCondition(); + if (kRelativeAngleCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeAngleCondition)->Clone(); + auto clonedChildIRelativeAngleCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeAngleCondition(std::dynamic_pointer_cast(clonedChildIRelativeAngleCondition)); + } + return clonedObject; + } + + std::string EntityConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION) + { + return std::dynamic_pointer_cast(GetEndOfRoadCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION) + { + return std::dynamic_pointer_cast(GetCollisionCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION) + { + return std::dynamic_pointer_cast(GetOffroadCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION) + { + return std::dynamic_pointer_cast(GetTimeHeadwayCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION) + { + return std::dynamic_pointer_cast(GetTimeToCollisionCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION) + { + return std::dynamic_pointer_cast(GetAccelerationCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION) + { + return std::dynamic_pointer_cast(GetStandStillCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_CONDITION) + { + return std::dynamic_pointer_cast(GetSpeedCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION) + { + return std::dynamic_pointer_cast(GetRelativeSpeedCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION) + { + return std::dynamic_pointer_cast(GetTraveledDistanceCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION) + { + return std::dynamic_pointer_cast(GetReachPositionCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION) + { + return std::dynamic_pointer_cast(GetDistanceCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION) + { + return std::dynamic_pointer_cast(GetRelativeDistanceCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION) + { + return std::dynamic_pointer_cast(GetRelativeClearanceCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION) + { + return std::dynamic_pointer_cast(GetAngleCondition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION) + { + return std::dynamic_pointer_cast(GetRelativeAngleCondition()); + } + throw KeyNotSupportedException(); + } + + std::vector> EntityConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntityConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EntityConditionImpl::IsSetEndOfRoadCondition() const + { + return _isSetEndOfRoadCondition; + } + bool EntityConditionImpl::IsSetCollisionCondition() const + { + return _isSetCollisionCondition; + } + bool EntityConditionImpl::IsSetOffroadCondition() const + { + return _isSetOffroadCondition; + } + bool EntityConditionImpl::IsSetTimeHeadwayCondition() const + { + return _isSetTimeHeadwayCondition; + } + bool EntityConditionImpl::IsSetTimeToCollisionCondition() const + { + return _isSetTimeToCollisionCondition; + } + bool EntityConditionImpl::IsSetAccelerationCondition() const + { + return _isSetAccelerationCondition; + } + bool EntityConditionImpl::IsSetStandStillCondition() const + { + return _isSetStandStillCondition; + } + bool EntityConditionImpl::IsSetSpeedCondition() const + { + return _isSetSpeedCondition; + } + bool EntityConditionImpl::IsSetRelativeSpeedCondition() const + { + return _isSetRelativeSpeedCondition; + } + bool EntityConditionImpl::IsSetTraveledDistanceCondition() const + { + return _isSetTraveledDistanceCondition; + } + bool EntityConditionImpl::IsSetReachPositionCondition() const + { + return _isSetReachPositionCondition; + } + bool EntityConditionImpl::IsSetDistanceCondition() const + { + return _isSetDistanceCondition; + } + bool EntityConditionImpl::IsSetRelativeDistanceCondition() const + { + return _isSetRelativeDistanceCondition; + } + bool EntityConditionImpl::IsSetRelativeClearanceCondition() const + { + return _isSetRelativeClearanceCondition; + } + bool EntityConditionImpl::IsSetAngleCondition() const + { + return _isSetAngleCondition; + } + bool EntityConditionImpl::IsSetRelativeAngleCondition() const + { + return _isSetRelativeAngleCondition; + } + + IOpenScenarioFlexElement* EntityDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> EntityDistributionImpl::GetEntityDistributionEntry() const + { + std::vector> temp; + for(auto&& elm: _entityDistributionEntry) + temp.push_back(elm); + return temp; + } + std::vector> EntityDistributionImpl::GetWriterEntityDistributionEntry() const + { + return _entityDistributionEntry; + } + + int EntityDistributionImpl::GetEntityDistributionEntrySize() const + { + return static_cast(_entityDistributionEntry.size()); + } + + std::shared_ptr EntityDistributionImpl::GetEntityDistributionEntryAtIndex(unsigned int index) const + { + if (index >= 0 && _entityDistributionEntry.size() > index) + { + return _entityDistributionEntry[index]; + } + return nullptr; + } + + + void EntityDistributionImpl::SetEntityDistributionEntry(std::vector>& entityDistributionEntry) + { + _entityDistributionEntry = entityDistributionEntry; + _isSetEntityDistributionEntry = true; + } + + std::shared_ptr EntityDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntityDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityDistributionImpl::GetModelType() const + { + return "EntityDistribution"; + } + + // children + + EntityDistributionImpl::EntityDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void EntityDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EntityDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityDistributionImpl::GetChildren() const + { + std::vector> result; + + auto entityDistributionEntry = GetWriterEntityDistributionEntry(); + if (!entityDistributionEntry.empty()) + { + for(auto&& item : entityDistributionEntry) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEntityDistributionEntry = GetWriterEntityDistributionEntry(); + if (!kEntityDistributionEntry.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntityDistributionEntry) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntityDistributionEntry(clonedList); + } + return clonedObject; + } + + std::string EntityDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> EntityDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetEntityDistributionEntry()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntityDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EntityDistributionImpl::IsSetEntityDistributionEntry() const + { + return _isSetEntityDistributionEntry; + } + + IOpenScenarioFlexElement* EntityDistributionEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + double EntityDistributionEntryImpl::GetWeight() const + { + return _weight; + } + std::shared_ptr EntityDistributionEntryImpl::GetScenarioObjectTemplate() const + { + return _scenarioObjectTemplate; + } + + + void EntityDistributionEntryImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + void EntityDistributionEntryImpl::SetScenarioObjectTemplate(std::shared_ptr scenarioObjectTemplate) + { + _scenarioObjectTemplate = scenarioObjectTemplate; + _isSetScenarioObjectTemplate = true; + } + + std::shared_ptr EntityDistributionEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityDistributionEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityDistributionEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityDistributionEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityDistributionEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityDistributionEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityDistributionEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityDistributionEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t EntityDistributionEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityDistributionEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityDistributionEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityDistributionEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityDistributionEntryImpl::GetModelType() const + { + return "EntityDistributionEntry"; + } + + void EntityDistributionEntryImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string EntityDistributionEntryImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool EntityDistributionEntryImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr EntityDistributionEntryImpl::GetWriterScenarioObjectTemplate() const + { + return std::dynamic_pointer_cast(_scenarioObjectTemplate); + } + + EntityDistributionEntryImpl::EntityDistributionEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void EntityDistributionEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType EntityDistributionEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityDistributionEntryImpl::GetChildren() const + { + std::vector> result; + + const auto kScenarioObjectTemplate = GetWriterScenarioObjectTemplate(); + if (kScenarioObjectTemplate) + { + result.push_back(std::dynamic_pointer_cast(kScenarioObjectTemplate)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityDistributionEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + const auto kScenarioObjectTemplate = GetWriterScenarioObjectTemplate(); + if (kScenarioObjectTemplate) + { + auto clonedChild = std::dynamic_pointer_cast(kScenarioObjectTemplate)->Clone(); + auto clonedChildIScenarioObjectTemplate = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetScenarioObjectTemplate(std::dynamic_pointer_cast(clonedChildIScenarioObjectTemplate)); + } + return clonedObject; + } + + std::string EntityDistributionEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityDistributionEntryImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT_TEMPLATE) + { + return std::dynamic_pointer_cast(GetScenarioObjectTemplate()); + } + throw KeyNotSupportedException(); + } + + std::vector> EntityDistributionEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityDistributionEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntityDistributionEntryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void EntityDistributionEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool EntityDistributionEntryImpl::IsSetWeight() const + { + return _isSetWeight; + } + bool EntityDistributionEntryImpl::IsSetScenarioObjectTemplate() const + { + return _isSetScenarioObjectTemplate; + } + + IOpenScenarioFlexElement* EntityObjectImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr EntityObjectImpl::GetCatalogReference() const + { + return _catalogReference; + } + std::shared_ptr EntityObjectImpl::GetVehicle() const + { + return _vehicle; + } + std::shared_ptr EntityObjectImpl::GetPedestrian() const + { + return _pedestrian; + } + std::shared_ptr EntityObjectImpl::GetMiscObject() const + { + return _miscObject; + } + std::shared_ptr EntityObjectImpl::GetExternalObjectReference() const + { + return _externalObjectReference; + } + + + void EntityObjectImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _vehicle = {}; + _pedestrian = {}; + _miscObject = {}; + _externalObjectReference = {}; + _isSetCatalogReference = true; + } + + void EntityObjectImpl::SetVehicle(std::shared_ptr vehicle) + { + _vehicle = vehicle; + _catalogReference = {}; + _pedestrian = {}; + _miscObject = {}; + _externalObjectReference = {}; + _isSetVehicle = true; + } + + void EntityObjectImpl::SetPedestrian(std::shared_ptr pedestrian) + { + _pedestrian = pedestrian; + _catalogReference = {}; + _vehicle = {}; + _miscObject = {}; + _externalObjectReference = {}; + _isSetPedestrian = true; + } + + void EntityObjectImpl::SetMiscObject(std::shared_ptr miscObject) + { + _miscObject = miscObject; + _catalogReference = {}; + _vehicle = {}; + _pedestrian = {}; + _externalObjectReference = {}; + _isSetMiscObject = true; + } + + void EntityObjectImpl::SetExternalObjectReference(std::shared_ptr externalObjectReference) + { + _externalObjectReference = externalObjectReference; + _catalogReference = {}; + _vehicle = {}; + _pedestrian = {}; + _miscObject = {}; + _isSetExternalObjectReference = true; + } + + std::shared_ptr EntityObjectImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityObjectImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityObject).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityObjectWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityObjectImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityObjectImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityObjectImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityObjectImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntityObjectImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityObjectImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityObjectImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityObjectImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityObjectImpl::GetModelType() const + { + return "EntityObject"; + } + + // children + std::shared_ptr EntityObjectImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + std::shared_ptr EntityObjectImpl::GetWriterVehicle() const + { + return std::dynamic_pointer_cast(_vehicle); + } + std::shared_ptr EntityObjectImpl::GetWriterPedestrian() const + { + return std::dynamic_pointer_cast(_pedestrian); + } + std::shared_ptr EntityObjectImpl::GetWriterMiscObject() const + { + return std::dynamic_pointer_cast(_miscObject); + } + std::shared_ptr EntityObjectImpl::GetWriterExternalObjectReference() const + { + return std::dynamic_pointer_cast(_externalObjectReference); + } + + EntityObjectImpl::EntityObjectImpl() + { + /** + * Filling the property to type map + */ + } + + void EntityObjectImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EntityObjectImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityObjectImpl::GetChildren() const + { + std::vector> result; + + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + const auto kVehicle = GetWriterVehicle(); + if (kVehicle) + { + result.push_back(std::dynamic_pointer_cast(kVehicle)); + } + const auto kPedestrian = GetWriterPedestrian(); + if (kPedestrian) + { + result.push_back(std::dynamic_pointer_cast(kPedestrian)); + } + const auto kMiscObject = GetWriterMiscObject(); + if (kMiscObject) + { + result.push_back(std::dynamic_pointer_cast(kMiscObject)); + } + const auto kExternalObjectReference = GetWriterExternalObjectReference(); + if (kExternalObjectReference) + { + result.push_back(std::dynamic_pointer_cast(kExternalObjectReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityObjectImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + const auto kVehicle = GetWriterVehicle(); + if (kVehicle) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicle)->Clone(); + auto clonedChildIVehicle = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicle(std::dynamic_pointer_cast(clonedChildIVehicle)); + } + const auto kPedestrian = GetWriterPedestrian(); + if (kPedestrian) + { + auto clonedChild = std::dynamic_pointer_cast(kPedestrian)->Clone(); + auto clonedChildIPedestrian = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPedestrian(std::dynamic_pointer_cast(clonedChildIPedestrian)); + } + const auto kMiscObject = GetWriterMiscObject(); + if (kMiscObject) + { + auto clonedChild = std::dynamic_pointer_cast(kMiscObject)->Clone(); + auto clonedChildIMiscObject = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetMiscObject(std::dynamic_pointer_cast(clonedChildIMiscObject)); + } + const auto kExternalObjectReference = GetWriterExternalObjectReference(); + if (kExternalObjectReference) + { + auto clonedChild = std::dynamic_pointer_cast(kExternalObjectReference)->Clone(); + auto clonedChildIExternalObjectReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetExternalObjectReference(std::dynamic_pointer_cast(clonedChildIExternalObjectReference)); + } + return clonedObject; + } + + std::string EntityObjectImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityObjectImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE) + { + return std::dynamic_pointer_cast(GetVehicle()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PEDESTRIAN) + { + return std::dynamic_pointer_cast(GetPedestrian()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MISC_OBJECT) + { + return std::dynamic_pointer_cast(GetMiscObject()); + } + + if (key == OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE) + { + return std::dynamic_pointer_cast(GetExternalObjectReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> EntityObjectImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityObjectImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntityObjectImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EntityObjectImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + bool EntityObjectImpl::IsSetVehicle() const + { + return _isSetVehicle; + } + bool EntityObjectImpl::IsSetPedestrian() const + { + return _isSetPedestrian; + } + bool EntityObjectImpl::IsSetMiscObject() const + { + return _isSetMiscObject; + } + bool EntityObjectImpl::IsSetExternalObjectReference() const + { + return _isSetExternalObjectReference; + } + + IOpenScenarioFlexElement* EntityRefImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> EntityRefImpl::GetEntityRef() const + { + return _entityRef; + } + + + void EntityRefImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + std::shared_ptr EntityRefImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntityRefImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntityRef).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntityRefWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntityRefImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntityRefImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntityRefImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntityRefImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntityRefImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntityRefImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntityRefImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntityRefImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntityRefImpl::GetModelType() const + { + return "EntityRef"; + } + + void EntityRefImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string EntityRefImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool EntityRefImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + EntityRefImpl::EntityRefImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void EntityRefImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType EntityRefImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntityRefImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntityRefImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string EntityRefImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityRefImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> EntityRefImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntityRefImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string EntityRefImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EntityRefImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* EntitySelectionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string EntitySelectionImpl::GetName() const + { + return _name; + } + std::shared_ptr EntitySelectionImpl::GetMembers() const + { + return _members; + } + + + void EntitySelectionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void EntitySelectionImpl::SetMembers(std::shared_ptr members) + { + _members = members; + _isSetMembers = true; + } + + std::shared_ptr EntitySelectionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EntitySelectionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEntitySelection).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEntitySelectionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EntitySelectionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EntitySelectionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EntitySelectionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EntitySelectionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EntitySelectionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EntitySelectionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EntitySelectionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EntitySelectionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EntitySelectionImpl::GetModelType() const + { + return "EntitySelection"; + } + + void EntitySelectionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string EntitySelectionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool EntitySelectionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr EntitySelectionImpl::GetWriterMembers() const + { + return std::dynamic_pointer_cast(_members); + } + + EntitySelectionImpl::EntitySelectionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void EntitySelectionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType EntitySelectionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EntitySelectionImpl::GetChildren() const + { + std::vector> result; + + const auto kMembers = GetWriterMembers(); + if (kMembers) + { + result.push_back(std::dynamic_pointer_cast(kMembers)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EntitySelectionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kMembers = GetWriterMembers(); + if (kMembers) + { + auto clonedChild = std::dynamic_pointer_cast(kMembers)->Clone(); + auto clonedChildISelectedEntities = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetMembers(std::dynamic_pointer_cast(clonedChildISelectedEntities)); + } + return clonedObject; + } + + std::string EntitySelectionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EntitySelectionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__MEMBERS) + { + return std::dynamic_pointer_cast(GetMembers()); + } + throw KeyNotSupportedException(); + } + + std::vector> EntitySelectionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EntitySelectionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EntitySelectionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void EntitySelectionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool EntitySelectionImpl::IsSetName() const + { + return _isSetName; + } + bool EntitySelectionImpl::IsSetMembers() const + { + return _isSetMembers; + } + + IOpenScenarioFlexElement* EnvironmentImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string EnvironmentImpl::GetName() const + { + return _name; + } + std::vector> EnvironmentImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> EnvironmentImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int EnvironmentImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr EnvironmentImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr EnvironmentImpl::GetTimeOfDay() const + { + return _timeOfDay; + } + std::shared_ptr EnvironmentImpl::GetWeather() const + { + return _weather; + } + std::shared_ptr EnvironmentImpl::GetRoadCondition() const + { + return _roadCondition; + } + + + void EnvironmentImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void EnvironmentImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void EnvironmentImpl::SetTimeOfDay(std::shared_ptr timeOfDay) + { + _timeOfDay = timeOfDay; + _isSetTimeOfDay = true; + } + + void EnvironmentImpl::SetWeather(std::shared_ptr weather) + { + _weather = weather; + _isSetWeather = true; + } + + void EnvironmentImpl::SetRoadCondition(std::shared_ptr roadCondition) + { + _roadCondition = roadCondition; + _isSetRoadCondition = true; + } + + std::shared_ptr EnvironmentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EnvironmentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEnvironment).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEnvironmentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EnvironmentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EnvironmentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EnvironmentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EnvironmentImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EnvironmentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EnvironmentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EnvironmentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EnvironmentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EnvironmentImpl::GetModelType() const + { + return "Environment"; + } + + void EnvironmentImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string EnvironmentImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool EnvironmentImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr EnvironmentImpl::GetWriterTimeOfDay() const + { + return std::dynamic_pointer_cast(_timeOfDay); + } + std::shared_ptr EnvironmentImpl::GetWriterWeather() const + { + return std::dynamic_pointer_cast(_weather); + } + std::shared_ptr EnvironmentImpl::GetWriterRoadCondition() const + { + return std::dynamic_pointer_cast(_roadCondition); + } + + EnvironmentImpl::EnvironmentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void EnvironmentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType EnvironmentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool EnvironmentImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> EnvironmentImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EnvironmentImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kTimeOfDay = GetWriterTimeOfDay(); + if (kTimeOfDay) + { + result.push_back(std::dynamic_pointer_cast(kTimeOfDay)); + } + const auto kWeather = GetWriterWeather(); + if (kWeather) + { + result.push_back(std::dynamic_pointer_cast(kWeather)); + } + const auto kRoadCondition = GetWriterRoadCondition(); + if (kRoadCondition) + { + result.push_back(std::dynamic_pointer_cast(kRoadCondition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EnvironmentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kTimeOfDay = GetWriterTimeOfDay(); + if (kTimeOfDay) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeOfDay)->Clone(); + auto clonedChildITimeOfDay = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeOfDay(std::dynamic_pointer_cast(clonedChildITimeOfDay)); + } + const auto kWeather = GetWriterWeather(); + if (kWeather) + { + auto clonedChild = std::dynamic_pointer_cast(kWeather)->Clone(); + auto clonedChildIWeather = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetWeather(std::dynamic_pointer_cast(clonedChildIWeather)); + } + const auto kRoadCondition = GetWriterRoadCondition(); + if (kRoadCondition) + { + auto clonedChild = std::dynamic_pointer_cast(kRoadCondition)->Clone(); + auto clonedChildIRoadCondition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoadCondition(std::dynamic_pointer_cast(clonedChildIRoadCondition)); + } + return clonedObject; + } + + std::string EnvironmentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_OF_DAY) + { + return std::dynamic_pointer_cast(GetTimeOfDay()); + } + + if (key == OSC_CONSTANTS::ELEMENT__WEATHER) + { + return std::dynamic_pointer_cast(GetWeather()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROAD_CONDITION) + { + return std::dynamic_pointer_cast(GetRoadCondition()); + } + throw KeyNotSupportedException(); + } + + std::vector> EnvironmentImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EnvironmentImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void EnvironmentImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool EnvironmentImpl::IsSetName() const + { + return _isSetName; + } + void EnvironmentImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool EnvironmentImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + void EnvironmentImpl::ResetTimeOfDay() + { + _isSetTimeOfDay = false; + _timeOfDay = {}; + + } + bool EnvironmentImpl::IsSetTimeOfDay() const + { + return _isSetTimeOfDay; + } + void EnvironmentImpl::ResetWeather() + { + _isSetWeather = false; + _weather = {}; + + } + bool EnvironmentImpl::IsSetWeather() const + { + return _isSetWeather; + } + void EnvironmentImpl::ResetRoadCondition() + { + _isSetRoadCondition = false; + _roadCondition = {}; + + } + bool EnvironmentImpl::IsSetRoadCondition() const + { + return _isSetRoadCondition; + } + + IOpenScenarioFlexElement* EnvironmentActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr EnvironmentActionImpl::GetEnvironment() const + { + return _environment; + } + std::shared_ptr EnvironmentActionImpl::GetCatalogReference() const + { + return _catalogReference; + } + + + void EnvironmentActionImpl::SetEnvironment(std::shared_ptr environment) + { + _environment = environment; + _catalogReference = {}; + _isSetEnvironment = true; + } + + void EnvironmentActionImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _environment = {}; + _isSetCatalogReference = true; + } + + std::shared_ptr EnvironmentActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EnvironmentActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEnvironmentAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEnvironmentActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EnvironmentActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EnvironmentActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EnvironmentActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EnvironmentActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EnvironmentActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EnvironmentActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EnvironmentActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EnvironmentActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EnvironmentActionImpl::GetModelType() const + { + return "EnvironmentAction"; + } + + // children + std::shared_ptr EnvironmentActionImpl::GetWriterEnvironment() const + { + return std::dynamic_pointer_cast(_environment); + } + std::shared_ptr EnvironmentActionImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + + EnvironmentActionImpl::EnvironmentActionImpl() + { + /** + * Filling the property to type map + */ + } + + void EnvironmentActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EnvironmentActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EnvironmentActionImpl::GetChildren() const + { + std::vector> result; + + const auto kEnvironment = GetWriterEnvironment(); + if (kEnvironment) + { + result.push_back(std::dynamic_pointer_cast(kEnvironment)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EnvironmentActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEnvironment = GetWriterEnvironment(); + if (kEnvironment) + { + auto clonedChild = std::dynamic_pointer_cast(kEnvironment)->Clone(); + auto clonedChildIEnvironment = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEnvironment(std::dynamic_pointer_cast(clonedChildIEnvironment)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + return clonedObject; + } + + std::string EnvironmentActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENVIRONMENT) + { + return std::dynamic_pointer_cast(GetEnvironment()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> EnvironmentActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EnvironmentActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EnvironmentActionImpl::IsSetEnvironment() const + { + return _isSetEnvironment; + } + bool EnvironmentActionImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + + IOpenScenarioFlexElement* EnvironmentCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr EnvironmentCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void EnvironmentCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr EnvironmentCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EnvironmentCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEnvironmentCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEnvironmentCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EnvironmentCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EnvironmentCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int EnvironmentCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EnvironmentCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EnvironmentCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EnvironmentCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EnvironmentCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EnvironmentCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EnvironmentCatalogLocationImpl::GetModelType() const + { + return "EnvironmentCatalogLocation"; + } + + // children + std::shared_ptr EnvironmentCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + EnvironmentCatalogLocationImpl::EnvironmentCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void EnvironmentCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType EnvironmentCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EnvironmentCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EnvironmentCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string EnvironmentCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> EnvironmentCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr EnvironmentCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EnvironmentCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool EnvironmentCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* EventImpl::GetOpenScenarioFlexElement() + { + return this; + } + uint32_t EventImpl::GetMaximumExecutionCount() const + { + return _maximumExecutionCount; + } + std::string EventImpl::GetName() const + { + return _name; + } + Priority EventImpl::GetPriority() const + { + return _priority; + } + std::vector> EventImpl::GetActions() const + { + std::vector> temp; + for(auto&& elm: _actions) + temp.push_back(elm); + return temp; + } + std::vector> EventImpl::GetWriterActions() const + { + return _actions; + } + + int EventImpl::GetActionsSize() const + { + return static_cast(_actions.size()); + } + + std::shared_ptr EventImpl::GetActionsAtIndex(unsigned int index) const + { + if (index >= 0 && _actions.size() > index) + { + return _actions[index]; + } + return nullptr; + } + std::shared_ptr EventImpl::GetStartTrigger() const + { + return _startTrigger; + } + + + void EventImpl::SetMaximumExecutionCount(const uint32_t maximumExecutionCount) + { + _maximumExecutionCount = maximumExecutionCount; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + _isSetMaximumExecutionCount = true; + } + + void EventImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void EventImpl::SetPriority(const Priority priority) + { + _priority = priority; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRIORITY); + _isSetPriority = true; + } + + void EventImpl::SetActions(std::vector>& actions) + { + _actions = actions; + _isSetActions = true; + } + + void EventImpl::SetStartTrigger(std::shared_ptr startTrigger) + { + _startTrigger = startTrigger; + _isSetStartTrigger = true; + } + + std::shared_ptr EventImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(EventImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IEvent).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IEventWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr EventImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t EventImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + return GetMaximumExecutionCount(); + } + throw KeyNotSupportedException(); + + } + + int EventImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double EventImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t EventImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool EventImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime EventImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr EventImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string EventImpl::GetModelType() const + { + return "Event"; + } + + void EventImpl::WriteParameterToMaximumExecutionCount(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, parameterName, nullTextMarker /*no textmarker*/); + _maximumExecutionCount = {}; + } + + void EventImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void EventImpl::WriteParameterToPriority(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, parameterName, nullTextMarker /*no textmarker*/); + _priority = {}; + } + + std::string EventImpl::GetParameterFromMaximumExecutionCount() const + { + auto maximumExecutionCount = OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT; + return GetParameterNameFromAttribute(maximumExecutionCount); + } + + std::string EventImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string EventImpl::GetParameterFromPriority() const + { + auto priority = OSC_CONSTANTS::ATTRIBUTE__PRIORITY; + return GetParameterNameFromAttribute(priority); + } + + bool EventImpl::IsMaximumExecutionCountParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + if (kIt != keys.end()) + return true; + return false; + } + + bool EventImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool EventImpl::IsPriorityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PRIORITY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr EventImpl::GetWriterStartTrigger() const + { + return std::dynamic_pointer_cast(_startTrigger); + } + + EventImpl::EventImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, SimpleType::UNSIGNED_INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, SimpleType::ENUM_TYPE); + } + + void EventImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + // Simple type + _maximumExecutionCount = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaximumExecutionCount = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PRIORITY) + { + // Enumeration Type + const auto kResult = Priority::GetFromLiteral(parameterLiteralValue); + if (kResult != Priority::UNKNOWN) + { + _priority = kResult; + AddResolvedParameter(attributeKey); + _isSetPriority = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType EventImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> EventImpl::GetChildren() const + { + std::vector> result; + + auto actions = GetWriterActions(); + if (!actions.empty()) + { + for(auto&& item : actions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kStartTrigger = GetWriterStartTrigger(); + if (kStartTrigger) + { + result.push_back(std::dynamic_pointer_cast(kStartTrigger)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr EventImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maximumExecutionCount = GetMaximumExecutionCount(); + // Simple type + clonedObject->_name = GetName(); + // Enumeration Type + const auto kPriority = GetPriority(); + if ( kPriority.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_priority = Priority::GetFromLiteral(kPriority.GetLiteral()); + } + // clone indicators + clonedObject->_isSetMaximumExecutionCount = _isSetMaximumExecutionCount; + // clone children + const auto kActions = GetWriterActions(); + if (!kActions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kActions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetActions(clonedList); + } + const auto kStartTrigger = GetWriterStartTrigger(); + if (kStartTrigger) + { + auto clonedChild = std::dynamic_pointer_cast(kStartTrigger)->Clone(); + auto clonedChildITrigger = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStartTrigger(std::dynamic_pointer_cast(clonedChildITrigger)); + } + return clonedObject; + } + + std::string EventImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EventImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__START_TRIGGER) + { + return std::dynamic_pointer_cast(GetStartTrigger()); + } + throw KeyNotSupportedException(); + } + + std::vector> EventImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACTION) + { + std::vector> vect; + for (auto&& elem : GetActions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr EventImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string EventImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PRIORITY) + { + auto priority = GetPriority(); + return priority.GetLiteral() != "UNKNOWN" ? priority.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void EventImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + // Simple type + _maximumExecutionCount = value; + AddResolvedParameter(attributeKey); + _isSetMaximumExecutionCount = true; + } + + } + void EventImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + void EventImpl::ResetMaximumExecutionCount() + { + _isSetMaximumExecutionCount = false; + _maximumExecutionCount = {1}; + + } + bool EventImpl::IsSetMaximumExecutionCount() const + { + return _isSetMaximumExecutionCount; + } + bool EventImpl::IsSetName() const + { + return _isSetName; + } + bool EventImpl::IsSetPriority() const + { + return _isSetPriority; + } + bool EventImpl::IsSetActions() const + { + return _isSetActions; + } + void EventImpl::ResetStartTrigger() + { + _isSetStartTrigger = false; + _startTrigger = {}; + + } + bool EventImpl::IsSetStartTrigger() const + { + return _isSetStartTrigger; + } + + IOpenScenarioFlexElement* ExternalObjectReferenceImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ExternalObjectReferenceImpl::GetName() const + { + return _name; + } + + + void ExternalObjectReferenceImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + std::shared_ptr ExternalObjectReferenceImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ExternalObjectReferenceImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IExternalObjectReference).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IExternalObjectReferenceWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ExternalObjectReferenceImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ExternalObjectReferenceImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ExternalObjectReferenceImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ExternalObjectReferenceImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ExternalObjectReferenceImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ExternalObjectReferenceImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ExternalObjectReferenceImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ExternalObjectReferenceImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ExternalObjectReferenceImpl::GetModelType() const + { + return "ExternalObjectReference"; + } + + void ExternalObjectReferenceImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ExternalObjectReferenceImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ExternalObjectReferenceImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ExternalObjectReferenceImpl::ExternalObjectReferenceImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ExternalObjectReferenceImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ExternalObjectReferenceImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ExternalObjectReferenceImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ExternalObjectReferenceImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ExternalObjectReferenceImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ExternalObjectReferenceImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ExternalObjectReferenceImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ExternalObjectReferenceImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ExternalObjectReferenceImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ExternalObjectReferenceImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ExternalObjectReferenceImpl::IsSetName() const + { + return _isSetName; + } + + IOpenScenarioFlexElement* FileImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string FileImpl::GetFilepath() const + { + return _filepath; + } + + + void FileImpl::SetFilepath(const std::string filepath) + { + _filepath = filepath; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FILEPATH); + _isSetFilepath = true; + } + + std::shared_ptr FileImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(FileImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IFile).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IFileWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr FileImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t FileImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int FileImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double FileImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t FileImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool FileImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime FileImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr FileImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string FileImpl::GetModelType() const + { + return "File"; + } + + void FileImpl::WriteParameterToFilepath(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, parameterName, nullTextMarker /*no textmarker*/); + _filepath = {}; + } + + std::string FileImpl::GetParameterFromFilepath() const + { + auto filepath = OSC_CONSTANTS::ATTRIBUTE__FILEPATH; + return GetParameterNameFromAttribute(filepath); + } + + bool FileImpl::IsFilepathParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FILEPATH); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + FileImpl::FileImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, SimpleType::STRING); + } + + void FileImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FILEPATH) + { + // Simple type + _filepath = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFilepath = true; + } + } + + SimpleType FileImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> FileImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr FileImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_filepath = GetFilepath(); + // clone indicators + // clone children + return clonedObject; + } + + std::string FileImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FILEPATH) + { + return GetFilepath(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr FileImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> FileImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr FileImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string FileImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void FileImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FILEPATH) + { + // Simple type + _filepath = value; + AddResolvedParameter(attributeKey); + _isSetFilepath = true; + } + + } + + + bool FileImpl::IsSetFilepath() const + { + return _isSetFilepath; + } + + IOpenScenarioFlexElement* FileHeaderImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string FileHeaderImpl::GetAuthor() const + { + return _author; + } + DateTime FileHeaderImpl::GetDate() const + { + return _date; + } + std::string FileHeaderImpl::GetDescription() const + { + return _description; + } + uint16_t FileHeaderImpl::GetRevMajor() const + { + return _revMajor; + } + uint16_t FileHeaderImpl::GetRevMinor() const + { + return _revMinor; + } + std::shared_ptr FileHeaderImpl::GetLicense() const + { + return _license; + } + std::shared_ptr FileHeaderImpl::GetProperties() const + { + return _properties; + } + + + void FileHeaderImpl::SetAuthor(const std::string author) + { + _author = author; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AUTHOR); + _isSetAuthor = true; + } + + void FileHeaderImpl::SetDate(const DateTime date) + { + _date = date; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE); + _isSetDate = true; + } + + void FileHeaderImpl::SetDescription(const std::string description) + { + _description = description; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION); + _isSetDescription = true; + } + + void FileHeaderImpl::SetRevMajor(const uint16_t revMajor) + { + _revMajor = revMajor; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR); + _isSetRevMajor = true; + } + + void FileHeaderImpl::SetRevMinor(const uint16_t revMinor) + { + _revMinor = revMinor; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR); + _isSetRevMinor = true; + } + + void FileHeaderImpl::SetLicense(std::shared_ptr license) + { + _license = license; + _isSetLicense = true; + } + + void FileHeaderImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr FileHeaderImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(FileHeaderImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IFileHeader).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IFileHeaderWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr FileHeaderImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t FileHeaderImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int FileHeaderImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double FileHeaderImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t FileHeaderImpl::GetUnsignedShortProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR) + { + return GetRevMajor(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__REV_MINOR) + { + return GetRevMinor(); + } + throw KeyNotSupportedException(); + + } + + bool FileHeaderImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime FileHeaderImpl::GetDateTimeProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DATE) + { + return GetDate(); + } + throw KeyNotSupportedException(); + + } + + + std::weak_ptr FileHeaderImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string FileHeaderImpl::GetModelType() const + { + return "FileHeader"; + } + + void FileHeaderImpl::WriteParameterToAuthor(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, parameterName, nullTextMarker /*no textmarker*/); + _author = {}; + } + + void FileHeaderImpl::WriteParameterToDate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE, parameterName, nullTextMarker /*no textmarker*/); + _date = {}; + } + + void FileHeaderImpl::WriteParameterToDescription(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, parameterName, nullTextMarker /*no textmarker*/); + _description = {}; + } + + void FileHeaderImpl::WriteParameterToRevMajor(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, parameterName, nullTextMarker /*no textmarker*/); + _revMajor = {}; + } + + void FileHeaderImpl::WriteParameterToRevMinor(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, parameterName, nullTextMarker /*no textmarker*/); + _revMinor = {}; + } + + std::string FileHeaderImpl::GetParameterFromAuthor() const + { + auto author = OSC_CONSTANTS::ATTRIBUTE__AUTHOR; + return GetParameterNameFromAttribute(author); + } + + std::string FileHeaderImpl::GetParameterFromDate() const + { + auto date = OSC_CONSTANTS::ATTRIBUTE__DATE; + return GetParameterNameFromAttribute(date); + } + + std::string FileHeaderImpl::GetParameterFromDescription() const + { + auto description = OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION; + return GetParameterNameFromAttribute(description); + } + + std::string FileHeaderImpl::GetParameterFromRevMajor() const + { + auto revMajor = OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR; + return GetParameterNameFromAttribute(revMajor); + } + + std::string FileHeaderImpl::GetParameterFromRevMinor() const + { + auto revMinor = OSC_CONSTANTS::ATTRIBUTE__REV_MINOR; + return GetParameterNameFromAttribute(revMinor); + } + + bool FileHeaderImpl::IsAuthorParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__AUTHOR); + if (kIt != keys.end()) + return true; + return false; + } + + bool FileHeaderImpl::IsDateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool FileHeaderImpl::IsDescriptionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool FileHeaderImpl::IsRevMajorParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR); + if (kIt != keys.end()) + return true; + return false; + } + + bool FileHeaderImpl::IsRevMinorParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__REV_MINOR); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr FileHeaderImpl::GetWriterLicense() const + { + return std::dynamic_pointer_cast(_license); + } + std::shared_ptr FileHeaderImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + FileHeaderImpl::FileHeaderImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DATE, SimpleType::DATE_TIME); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, SimpleType::UNSIGNED_SHORT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, SimpleType::UNSIGNED_SHORT); + } + + void FileHeaderImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AUTHOR) + { + // Simple type + _author = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAuthor = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE) + { + // Simple type + _date = ParserHelper::ParseDateTime(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION) + { + // Simple type + _description = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDescription = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR) + { + // Simple type + _revMajor = ParserHelper::ParseUnsignedShort(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRevMajor = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REV_MINOR) + { + // Simple type + _revMinor = ParserHelper::ParseUnsignedShort(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRevMinor = true; + } + } + + SimpleType FileHeaderImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> FileHeaderImpl::GetChildren() const + { + std::vector> result; + + const auto kLicense = GetWriterLicense(); + if (kLicense) + { + result.push_back(std::dynamic_pointer_cast(kLicense)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr FileHeaderImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_author = GetAuthor(); + // Simple type + clonedObject->_date = GetDate(); + // Simple type + clonedObject->_description = GetDescription(); + // Simple type + clonedObject->_revMajor = GetRevMajor(); + // Simple type + clonedObject->_revMinor = GetRevMinor(); + // clone indicators + // clone children + const auto kLicense = GetWriterLicense(); + if (kLicense) + { + auto clonedChild = std::dynamic_pointer_cast(kLicense)->Clone(); + auto clonedChildILicense = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLicense(std::dynamic_pointer_cast(clonedChildILicense)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string FileHeaderImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__AUTHOR) + { + return GetAuthor(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION) + { + return GetDescription(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr FileHeaderImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LICENSE) + { + return std::dynamic_pointer_cast(GetLicense()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> FileHeaderImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr FileHeaderImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string FileHeaderImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void FileHeaderImpl::ResolveUnsignedShortExpression(std::string& attributeKey, unsigned short& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR) + { + // Simple type + _revMajor = value; + AddResolvedParameter(attributeKey); + _isSetRevMajor = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REV_MINOR) + { + // Simple type + _revMinor = value; + AddResolvedParameter(attributeKey); + _isSetRevMinor = true; + } + + } + void FileHeaderImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AUTHOR) + { + // Simple type + _author = value; + AddResolvedParameter(attributeKey); + _isSetAuthor = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION) + { + // Simple type + _description = value; + AddResolvedParameter(attributeKey); + _isSetDescription = true; + } + + } + void FileHeaderImpl::ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE) + { + // Simple type + _date = value; + AddResolvedParameter(attributeKey); + _isSetDate = true; + } + + } + + + bool FileHeaderImpl::IsSetAuthor() const + { + return _isSetAuthor; + } + bool FileHeaderImpl::IsSetDate() const + { + return _isSetDate; + } + bool FileHeaderImpl::IsSetDescription() const + { + return _isSetDescription; + } + bool FileHeaderImpl::IsSetRevMajor() const + { + return _isSetRevMajor; + } + bool FileHeaderImpl::IsSetRevMinor() const + { + return _isSetRevMinor; + } + void FileHeaderImpl::ResetLicense() + { + _isSetLicense = false; + _license = {}; + + } + bool FileHeaderImpl::IsSetLicense() const + { + return _isSetLicense; + } + void FileHeaderImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool FileHeaderImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* FinalSpeedImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr FinalSpeedImpl::GetAbsoluteSpeed() const + { + return _absoluteSpeed; + } + std::shared_ptr FinalSpeedImpl::GetRelativeSpeedToMaster() const + { + return _relativeSpeedToMaster; + } + + + void FinalSpeedImpl::SetAbsoluteSpeed(std::shared_ptr absoluteSpeed) + { + _absoluteSpeed = absoluteSpeed; + _relativeSpeedToMaster = {}; + _isSetAbsoluteSpeed = true; + } + + void FinalSpeedImpl::SetRelativeSpeedToMaster(std::shared_ptr relativeSpeedToMaster) + { + _relativeSpeedToMaster = relativeSpeedToMaster; + _absoluteSpeed = {}; + _isSetRelativeSpeedToMaster = true; + } + + std::shared_ptr FinalSpeedImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(FinalSpeedImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IFinalSpeed).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IFinalSpeedWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr FinalSpeedImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t FinalSpeedImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int FinalSpeedImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double FinalSpeedImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t FinalSpeedImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool FinalSpeedImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime FinalSpeedImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr FinalSpeedImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string FinalSpeedImpl::GetModelType() const + { + return "FinalSpeed"; + } + + // children + std::shared_ptr FinalSpeedImpl::GetWriterAbsoluteSpeed() const + { + return std::dynamic_pointer_cast(_absoluteSpeed); + } + std::shared_ptr FinalSpeedImpl::GetWriterRelativeSpeedToMaster() const + { + return std::dynamic_pointer_cast(_relativeSpeedToMaster); + } + + FinalSpeedImpl::FinalSpeedImpl() + { + /** + * Filling the property to type map + */ + } + + void FinalSpeedImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType FinalSpeedImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> FinalSpeedImpl::GetChildren() const + { + std::vector> result; + + const auto kAbsoluteSpeed = GetWriterAbsoluteSpeed(); + if (kAbsoluteSpeed) + { + result.push_back(std::dynamic_pointer_cast(kAbsoluteSpeed)); + } + const auto kRelativeSpeedToMaster = GetWriterRelativeSpeedToMaster(); + if (kRelativeSpeedToMaster) + { + result.push_back(std::dynamic_pointer_cast(kRelativeSpeedToMaster)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr FinalSpeedImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kAbsoluteSpeed = GetWriterAbsoluteSpeed(); + if (kAbsoluteSpeed) + { + auto clonedChild = std::dynamic_pointer_cast(kAbsoluteSpeed)->Clone(); + auto clonedChildIAbsoluteSpeed = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAbsoluteSpeed(std::dynamic_pointer_cast(clonedChildIAbsoluteSpeed)); + } + const auto kRelativeSpeedToMaster = GetWriterRelativeSpeedToMaster(); + if (kRelativeSpeedToMaster) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeSpeedToMaster)->Clone(); + auto clonedChildIRelativeSpeedToMaster = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeSpeedToMaster(std::dynamic_pointer_cast(clonedChildIRelativeSpeedToMaster)); + } + return clonedObject; + } + + std::string FinalSpeedImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr FinalSpeedImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED) + { + return std::dynamic_pointer_cast(GetAbsoluteSpeed()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER) + { + return std::dynamic_pointer_cast(GetRelativeSpeedToMaster()); + } + throw KeyNotSupportedException(); + } + + std::vector> FinalSpeedImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr FinalSpeedImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string FinalSpeedImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool FinalSpeedImpl::IsSetAbsoluteSpeed() const + { + return _isSetAbsoluteSpeed; + } + bool FinalSpeedImpl::IsSetRelativeSpeedToMaster() const + { + return _isSetRelativeSpeedToMaster; + } + + IOpenScenarioFlexElement* FogImpl::GetOpenScenarioFlexElement() + { + return this; + } + double FogImpl::GetVisualRange() const + { + return _visualRange; + } + std::shared_ptr FogImpl::GetBoundingBox() const + { + return _boundingBox; + } + + + void FogImpl::SetVisualRange(const double visualRange) + { + _visualRange = visualRange; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE); + _isSetVisualRange = true; + } + + void FogImpl::SetBoundingBox(std::shared_ptr boundingBox) + { + _boundingBox = boundingBox; + _isSetBoundingBox = true; + } + + std::shared_ptr FogImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(FogImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IFog).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IFogWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr FogImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t FogImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int FogImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double FogImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE) + { + return GetVisualRange(); + } + throw KeyNotSupportedException(); + + } + + uint16_t FogImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool FogImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime FogImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr FogImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string FogImpl::GetModelType() const + { + return "Fog"; + } + + void FogImpl::WriteParameterToVisualRange(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, parameterName, nullTextMarker /*no textmarker*/); + _visualRange = {}; + } + + std::string FogImpl::GetParameterFromVisualRange() const + { + auto visualRange = OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE; + return GetParameterNameFromAttribute(visualRange); + } + + bool FogImpl::IsVisualRangeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr FogImpl::GetWriterBoundingBox() const + { + return std::dynamic_pointer_cast(_boundingBox); + } + + FogImpl::FogImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, SimpleType::DOUBLE); + } + + void FogImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE) + { + // Simple type + _visualRange = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVisualRange = true; + } + } + + SimpleType FogImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> FogImpl::GetChildren() const + { + std::vector> result; + + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + result.push_back(std::dynamic_pointer_cast(kBoundingBox)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr FogImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_visualRange = GetVisualRange(); + // clone indicators + // clone children + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + auto clonedChild = std::dynamic_pointer_cast(kBoundingBox)->Clone(); + auto clonedChildIBoundingBox = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBoundingBox(std::dynamic_pointer_cast(clonedChildIBoundingBox)); + } + return clonedObject; + } + + std::string FogImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr FogImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX) + { + return std::dynamic_pointer_cast(GetBoundingBox()); + } + throw KeyNotSupportedException(); + } + + std::vector> FogImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr FogImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string FogImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void FogImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE) + { + // Simple type + _visualRange = value; + AddResolvedParameter(attributeKey); + _isSetVisualRange = true; + } + + } + + + bool FogImpl::IsSetVisualRange() const + { + return _isSetVisualRange; + } + void FogImpl::ResetBoundingBox() + { + _isSetBoundingBox = false; + _boundingBox = {}; + + } + bool FogImpl::IsSetBoundingBox() const + { + return _isSetBoundingBox; + } + + IOpenScenarioFlexElement* FollowTrajectoryActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double FollowTrajectoryActionImpl::GetInitialDistanceOffset() const + { + return _initialDistanceOffset; + } + std::shared_ptr FollowTrajectoryActionImpl::GetTrajectory() const + { + return _trajectory; + } + std::shared_ptr FollowTrajectoryActionImpl::GetCatalogReference() const + { + return _catalogReference; + } + std::shared_ptr FollowTrajectoryActionImpl::GetTimeReference() const + { + return _timeReference; + } + std::shared_ptr FollowTrajectoryActionImpl::GetTrajectoryFollowingMode() const + { + return _trajectoryFollowingMode; + } + std::shared_ptr FollowTrajectoryActionImpl::GetTrajectoryRef() const + { + return _trajectoryRef; + } + + + void FollowTrajectoryActionImpl::SetInitialDistanceOffset(const double initialDistanceOffset) + { + _initialDistanceOffset = initialDistanceOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET); + _isSetInitialDistanceOffset = true; + } + + void FollowTrajectoryActionImpl::SetTrajectory(std::shared_ptr trajectory) + { + _trajectory = trajectory; + _isSetTrajectory = true; + } + + void FollowTrajectoryActionImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _isSetCatalogReference = true; + } + + void FollowTrajectoryActionImpl::SetTimeReference(std::shared_ptr timeReference) + { + _timeReference = timeReference; + _isSetTimeReference = true; + } + + void FollowTrajectoryActionImpl::SetTrajectoryFollowingMode(std::shared_ptr trajectoryFollowingMode) + { + _trajectoryFollowingMode = trajectoryFollowingMode; + _isSetTrajectoryFollowingMode = true; + } + + void FollowTrajectoryActionImpl::SetTrajectoryRef(std::shared_ptr trajectoryRef) + { + _trajectoryRef = trajectoryRef; + _isSetTrajectoryRef = true; + } + + std::shared_ptr FollowTrajectoryActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(FollowTrajectoryActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IFollowTrajectoryAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IFollowTrajectoryActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr FollowTrajectoryActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t FollowTrajectoryActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int FollowTrajectoryActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double FollowTrajectoryActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET) + { + return GetInitialDistanceOffset(); + } + throw KeyNotSupportedException(); + + } + + uint16_t FollowTrajectoryActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool FollowTrajectoryActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime FollowTrajectoryActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr FollowTrajectoryActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string FollowTrajectoryActionImpl::GetModelType() const + { + return "FollowTrajectoryAction"; + } + + void FollowTrajectoryActionImpl::WriteParameterToInitialDistanceOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _initialDistanceOffset = {}; + } + + std::string FollowTrajectoryActionImpl::GetParameterFromInitialDistanceOffset() const + { + auto initialDistanceOffset = OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET; + return GetParameterNameFromAttribute(initialDistanceOffset); + } + + bool FollowTrajectoryActionImpl::IsInitialDistanceOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr FollowTrajectoryActionImpl::GetWriterTrajectory() const + { + return std::dynamic_pointer_cast(_trajectory); + } + std::shared_ptr FollowTrajectoryActionImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + std::shared_ptr FollowTrajectoryActionImpl::GetWriterTimeReference() const + { + return std::dynamic_pointer_cast(_timeReference); + } + std::shared_ptr FollowTrajectoryActionImpl::GetWriterTrajectoryFollowingMode() const + { + return std::dynamic_pointer_cast(_trajectoryFollowingMode); + } + std::shared_ptr FollowTrajectoryActionImpl::GetWriterTrajectoryRef() const + { + return std::dynamic_pointer_cast(_trajectoryRef); + } + + FollowTrajectoryActionImpl::FollowTrajectoryActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, SimpleType::DOUBLE); + } + + void FollowTrajectoryActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET) + { + // Simple type + _initialDistanceOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetInitialDistanceOffset = true; + } + } + + SimpleType FollowTrajectoryActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> FollowTrajectoryActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTrajectory = GetWriterTrajectory(); + if (kTrajectory) + { + result.push_back(std::dynamic_pointer_cast(kTrajectory)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + const auto kTimeReference = GetWriterTimeReference(); + if (kTimeReference) + { + result.push_back(std::dynamic_pointer_cast(kTimeReference)); + } + const auto kTrajectoryFollowingMode = GetWriterTrajectoryFollowingMode(); + if (kTrajectoryFollowingMode) + { + result.push_back(std::dynamic_pointer_cast(kTrajectoryFollowingMode)); + } + const auto kTrajectoryRef = GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + result.push_back(std::dynamic_pointer_cast(kTrajectoryRef)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr FollowTrajectoryActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_initialDistanceOffset = GetInitialDistanceOffset(); + // clone indicators + clonedObject->_isSetInitialDistanceOffset = _isSetInitialDistanceOffset; + // clone children + const auto kTrajectory = GetWriterTrajectory(); + if (kTrajectory) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectory)->Clone(); + auto clonedChildITrajectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectory(std::dynamic_pointer_cast(clonedChildITrajectory)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + const auto kTimeReference = GetWriterTimeReference(); + if (kTimeReference) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeReference)->Clone(); + auto clonedChildITimeReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeReference(std::dynamic_pointer_cast(clonedChildITimeReference)); + } + const auto kTrajectoryFollowingMode = GetWriterTrajectoryFollowingMode(); + if (kTrajectoryFollowingMode) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectoryFollowingMode)->Clone(); + auto clonedChildITrajectoryFollowingMode = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectoryFollowingMode(std::dynamic_pointer_cast(clonedChildITrajectoryFollowingMode)); + } + const auto kTrajectoryRef = GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectoryRef)->Clone(); + auto clonedChildITrajectoryRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectoryRef(std::dynamic_pointer_cast(clonedChildITrajectoryRef)); + } + return clonedObject; + } + + std::string FollowTrajectoryActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr FollowTrajectoryActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY) + { + return std::dynamic_pointer_cast(GetTrajectory()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_REFERENCE) + { + return std::dynamic_pointer_cast(GetTimeReference()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY_FOLLOWING_MODE) + { + return std::dynamic_pointer_cast(GetTrajectoryFollowingMode()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF) + { + return std::dynamic_pointer_cast(GetTrajectoryRef()); + } + throw KeyNotSupportedException(); + } + + std::vector> FollowTrajectoryActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr FollowTrajectoryActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string FollowTrajectoryActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void FollowTrajectoryActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET) + { + // Simple type + _initialDistanceOffset = value; + AddResolvedParameter(attributeKey); + _isSetInitialDistanceOffset = true; + } + + } + + + void FollowTrajectoryActionImpl::ResetInitialDistanceOffset() + { + _isSetInitialDistanceOffset = false; + _initialDistanceOffset = {0}; + + } + bool FollowTrajectoryActionImpl::IsSetInitialDistanceOffset() const + { + return _isSetInitialDistanceOffset; + } + void FollowTrajectoryActionImpl::ResetTrajectory() + { + _isSetTrajectory = false; + _trajectory = {}; + + } + bool FollowTrajectoryActionImpl::IsSetTrajectory() const + { + return _isSetTrajectory; + } + void FollowTrajectoryActionImpl::ResetCatalogReference() + { + _isSetCatalogReference = false; + _catalogReference = {}; + + } + bool FollowTrajectoryActionImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + bool FollowTrajectoryActionImpl::IsSetTimeReference() const + { + return _isSetTimeReference; + } + bool FollowTrajectoryActionImpl::IsSetTrajectoryFollowingMode() const + { + return _isSetTrajectoryFollowingMode; + } + void FollowTrajectoryActionImpl::ResetTrajectoryRef() + { + _isSetTrajectoryRef = false; + _trajectoryRef = {}; + + } + bool FollowTrajectoryActionImpl::IsSetTrajectoryRef() const + { + return _isSetTrajectoryRef; + } + + IOpenScenarioFlexElement* GearImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr GearImpl::GetManualGear() const + { + return _manualGear; + } + std::shared_ptr GearImpl::GetAutomaticGear() const + { + return _automaticGear; + } + + + void GearImpl::SetManualGear(std::shared_ptr manualGear) + { + _manualGear = manualGear; + _automaticGear = {}; + _isSetManualGear = true; + } + + void GearImpl::SetAutomaticGear(std::shared_ptr automaticGear) + { + _automaticGear = automaticGear; + _manualGear = {}; + _isSetAutomaticGear = true; + } + + std::shared_ptr GearImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(GearImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IGear).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IGearWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr GearImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t GearImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int GearImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double GearImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t GearImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool GearImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime GearImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr GearImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string GearImpl::GetModelType() const + { + return "Gear"; + } + + // children + std::shared_ptr GearImpl::GetWriterManualGear() const + { + return std::dynamic_pointer_cast(_manualGear); + } + std::shared_ptr GearImpl::GetWriterAutomaticGear() const + { + return std::dynamic_pointer_cast(_automaticGear); + } + + GearImpl::GearImpl() + { + /** + * Filling the property to type map + */ + } + + void GearImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType GearImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> GearImpl::GetChildren() const + { + std::vector> result; + + const auto kManualGear = GetWriterManualGear(); + if (kManualGear) + { + result.push_back(std::dynamic_pointer_cast(kManualGear)); + } + const auto kAutomaticGear = GetWriterAutomaticGear(); + if (kAutomaticGear) + { + result.push_back(std::dynamic_pointer_cast(kAutomaticGear)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr GearImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kManualGear = GetWriterManualGear(); + if (kManualGear) + { + auto clonedChild = std::dynamic_pointer_cast(kManualGear)->Clone(); + auto clonedChildIManualGear = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetManualGear(std::dynamic_pointer_cast(clonedChildIManualGear)); + } + const auto kAutomaticGear = GetWriterAutomaticGear(); + if (kAutomaticGear) + { + auto clonedChild = std::dynamic_pointer_cast(kAutomaticGear)->Clone(); + auto clonedChildIAutomaticGear = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAutomaticGear(std::dynamic_pointer_cast(clonedChildIAutomaticGear)); + } + return clonedObject; + } + + std::string GearImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr GearImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__MANUAL_GEAR) + { + return std::dynamic_pointer_cast(GetManualGear()); + } + + if (key == OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR) + { + return std::dynamic_pointer_cast(GetAutomaticGear()); + } + throw KeyNotSupportedException(); + } + + std::vector> GearImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr GearImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string GearImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool GearImpl::IsSetManualGear() const + { + return _isSetManualGear; + } + bool GearImpl::IsSetAutomaticGear() const + { + return _isSetAutomaticGear; + } + + IOpenScenarioFlexElement* GeoPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double GeoPositionImpl::GetAltitude() const + { + return _altitude; + } + double GeoPositionImpl::GetHeight() const + { + return _height; + } + double GeoPositionImpl::GetLatitude() const + { + return _latitude; + } + double GeoPositionImpl::GetLatitudeDeg() const + { + return _latitudeDeg; + } + double GeoPositionImpl::GetLongitude() const + { + return _longitude; + } + double GeoPositionImpl::GetLongitudeDeg() const + { + return _longitudeDeg; + } + int GeoPositionImpl::GetVerticalRoadSelection() const + { + return _verticalRoadSelection; + } + std::shared_ptr GeoPositionImpl::GetOrientation() const + { + return _orientation; + } + + + void GeoPositionImpl::SetAltitude(const double altitude) + { + _altitude = altitude; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE); + _isSetAltitude = true; + } + + void GeoPositionImpl::SetHeight(const double height) + { + _height = height; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + _isSetHeight = true; + } + + void GeoPositionImpl::SetLatitude(const double latitude) + { + _latitude = latitude; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + _isSetLatitude = true; + } + + void GeoPositionImpl::SetLatitudeDeg(const double latitudeDeg) + { + _latitudeDeg = latitudeDeg; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + _isSetLatitudeDeg = true; + } + + void GeoPositionImpl::SetLongitude(const double longitude) + { + _longitude = longitude; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + _isSetLongitude = true; + } + + void GeoPositionImpl::SetLongitudeDeg(const double longitudeDeg) + { + _longitudeDeg = longitudeDeg; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + _isSetLongitudeDeg = true; + } + + void GeoPositionImpl::SetVerticalRoadSelection(const int verticalRoadSelection) + { + _verticalRoadSelection = verticalRoadSelection; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION); + _isSetVerticalRoadSelection = true; + } + + void GeoPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr GeoPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(GeoPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IGeoPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IGeoPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr GeoPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t GeoPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int GeoPositionImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION) + { + return GetVerticalRoadSelection(); + } + throw KeyNotSupportedException(); + + } + + double GeoPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ALTITUDE) + { + return GetAltitude(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + return GetHeight(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LATITUDE) + { + return GetLatitude(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG) + { + return GetLatitudeDeg(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE) + { + return GetLongitude(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG) + { + return GetLongitudeDeg(); + } + throw KeyNotSupportedException(); + + } + + uint16_t GeoPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool GeoPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime GeoPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr GeoPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string GeoPositionImpl::GetModelType() const + { + return "GeoPosition"; + } + + void GeoPositionImpl::WriteParameterToAltitude(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, parameterName, nullTextMarker /*no textmarker*/); + _altitude = {}; + } + + void GeoPositionImpl::WriteParameterToHeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _height = {}; + } + + void GeoPositionImpl::WriteParameterToLatitude(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, parameterName, nullTextMarker /*no textmarker*/); + _latitude = {}; + } + + void GeoPositionImpl::WriteParameterToLatitudeDeg(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, parameterName, nullTextMarker /*no textmarker*/); + _latitudeDeg = {}; + } + + void GeoPositionImpl::WriteParameterToLongitude(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, parameterName, nullTextMarker /*no textmarker*/); + _longitude = {}; + } + + void GeoPositionImpl::WriteParameterToLongitudeDeg(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, parameterName, nullTextMarker /*no textmarker*/); + _longitudeDeg = {}; + } + + void GeoPositionImpl::WriteParameterToVerticalRoadSelection(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, parameterName, nullTextMarker /*no textmarker*/); + _verticalRoadSelection = {}; + } + + std::string GeoPositionImpl::GetParameterFromAltitude() const + { + auto altitude = OSC_CONSTANTS::ATTRIBUTE__ALTITUDE; + return GetParameterNameFromAttribute(altitude); + } + + std::string GeoPositionImpl::GetParameterFromHeight() const + { + auto height = OSC_CONSTANTS::ATTRIBUTE__HEIGHT; + return GetParameterNameFromAttribute(height); + } + + std::string GeoPositionImpl::GetParameterFromLatitude() const + { + auto latitude = OSC_CONSTANTS::ATTRIBUTE__LATITUDE; + return GetParameterNameFromAttribute(latitude); + } + + std::string GeoPositionImpl::GetParameterFromLatitudeDeg() const + { + auto latitudeDeg = OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG; + return GetParameterNameFromAttribute(latitudeDeg); + } + + std::string GeoPositionImpl::GetParameterFromLongitude() const + { + auto longitude = OSC_CONSTANTS::ATTRIBUTE__LONGITUDE; + return GetParameterNameFromAttribute(longitude); + } + + std::string GeoPositionImpl::GetParameterFromLongitudeDeg() const + { + auto longitudeDeg = OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG; + return GetParameterNameFromAttribute(longitudeDeg); + } + + std::string GeoPositionImpl::GetParameterFromVerticalRoadSelection() const + { + auto verticalRoadSelection = OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION; + return GetParameterNameFromAttribute(verticalRoadSelection); + } + + bool GeoPositionImpl::IsAltitudeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ALTITUDE); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsHeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__HEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsLatitudeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LATITUDE); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsLatitudeDegParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsLongitudeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LONGITUDE); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsLongitudeDegParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG); + if (kIt != keys.end()) + return true; + return false; + } + + bool GeoPositionImpl::IsVerticalRoadSelectionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr GeoPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + GeoPositionImpl::GeoPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, SimpleType::INT); + } + + void GeoPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALTITUDE) + { + // Simple type + _altitude = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAltitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + // Simple type + _height = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetHeight = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATITUDE) + { + // Simple type + _latitude = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLatitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG) + { + // Simple type + _latitudeDeg = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLatitudeDeg = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE) + { + // Simple type + _longitude = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLongitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG) + { + // Simple type + _longitudeDeg = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLongitudeDeg = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION) + { + // Simple type + _verticalRoadSelection = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVerticalRoadSelection = true; + } + } + + SimpleType GeoPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> GeoPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr GeoPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_altitude = GetAltitude(); + // Simple type + clonedObject->_height = GetHeight(); + // Simple type + clonedObject->_latitude = GetLatitude(); + // Simple type + clonedObject->_latitudeDeg = GetLatitudeDeg(); + // Simple type + clonedObject->_longitude = GetLongitude(); + // Simple type + clonedObject->_longitudeDeg = GetLongitudeDeg(); + // Simple type + clonedObject->_verticalRoadSelection = GetVerticalRoadSelection(); + // clone indicators + clonedObject->_isSetAltitude = _isSetAltitude; + clonedObject->_isSetHeight = _isSetHeight; + clonedObject->_isSetLatitude = _isSetLatitude; + clonedObject->_isSetLatitudeDeg = _isSetLatitudeDeg; + clonedObject->_isSetLongitude = _isSetLongitude; + clonedObject->_isSetLongitudeDeg = _isSetLongitudeDeg; + clonedObject->_isSetVerticalRoadSelection = _isSetVerticalRoadSelection; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string GeoPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr GeoPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> GeoPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr GeoPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string GeoPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void GeoPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALTITUDE) + { + // Simple type + _altitude = value; + AddResolvedParameter(attributeKey); + _isSetAltitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__HEIGHT) + { + // Simple type + _height = value; + AddResolvedParameter(attributeKey); + _isSetHeight = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATITUDE) + { + // Simple type + _latitude = value; + AddResolvedParameter(attributeKey); + _isSetLatitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG) + { + // Simple type + _latitudeDeg = value; + AddResolvedParameter(attributeKey); + _isSetLatitudeDeg = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE) + { + // Simple type + _longitude = value; + AddResolvedParameter(attributeKey); + _isSetLongitude = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG) + { + // Simple type + _longitudeDeg = value; + AddResolvedParameter(attributeKey); + _isSetLongitudeDeg = true; + } + + } + void GeoPositionImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION) + { + // Simple type + _verticalRoadSelection = value; + AddResolvedParameter(attributeKey); + _isSetVerticalRoadSelection = true; + } + + } + + + void GeoPositionImpl::ResetAltitude() + { + _isSetAltitude = false; + _altitude = {0}; + + } + bool GeoPositionImpl::IsSetAltitude() const + { + return _isSetAltitude; + } + void GeoPositionImpl::ResetHeight() + { + _isSetHeight = false; + _height = {0}; + + } + bool GeoPositionImpl::IsSetHeight() const + { + return _isSetHeight; + } + void GeoPositionImpl::ResetLatitude() + { + _isSetLatitude = false; + _latitude = {0}; + + } + bool GeoPositionImpl::IsSetLatitude() const + { + return _isSetLatitude; + } + void GeoPositionImpl::ResetLatitudeDeg() + { + _isSetLatitudeDeg = false; + _latitudeDeg = {}; + + } + bool GeoPositionImpl::IsSetLatitudeDeg() const + { + return _isSetLatitudeDeg; + } + void GeoPositionImpl::ResetLongitude() + { + _isSetLongitude = false; + _longitude = {0}; + + } + bool GeoPositionImpl::IsSetLongitude() const + { + return _isSetLongitude; + } + void GeoPositionImpl::ResetLongitudeDeg() + { + _isSetLongitudeDeg = false; + _longitudeDeg = {0}; + + } + bool GeoPositionImpl::IsSetLongitudeDeg() const + { + return _isSetLongitudeDeg; + } + void GeoPositionImpl::ResetVerticalRoadSelection() + { + _isSetVerticalRoadSelection = false; + _verticalRoadSelection = {}; + + } + bool GeoPositionImpl::IsSetVerticalRoadSelection() const + { + return _isSetVerticalRoadSelection; + } + void GeoPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool GeoPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* GlobalActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr GlobalActionImpl::GetEnvironmentAction() const + { + return _environmentAction; + } + std::shared_ptr GlobalActionImpl::GetEntityAction() const + { + return _entityAction; + } + std::shared_ptr GlobalActionImpl::GetInfrastructureAction() const + { + return _infrastructureAction; + } + std::shared_ptr GlobalActionImpl::GetSetMonitorAction() const + { + return _setMonitorAction; + } + std::shared_ptr GlobalActionImpl::GetParameterAction() const + { + return _parameterAction; + } + std::shared_ptr GlobalActionImpl::GetTrafficAction() const + { + return _trafficAction; + } + std::shared_ptr GlobalActionImpl::GetVariableAction() const + { + return _variableAction; + } + + + void GlobalActionImpl::SetEnvironmentAction(std::shared_ptr environmentAction) + { + _environmentAction = environmentAction; + _entityAction = {}; + _infrastructureAction = {}; + _setMonitorAction = {}; + _parameterAction = {}; + _trafficAction = {}; + _variableAction = {}; + _isSetEnvironmentAction = true; + } + + void GlobalActionImpl::SetEntityAction(std::shared_ptr entityAction) + { + _entityAction = entityAction; + _environmentAction = {}; + _infrastructureAction = {}; + _setMonitorAction = {}; + _parameterAction = {}; + _trafficAction = {}; + _variableAction = {}; + _isSetEntityAction = true; + } + + void GlobalActionImpl::SetInfrastructureAction(std::shared_ptr infrastructureAction) + { + _infrastructureAction = infrastructureAction; + _environmentAction = {}; + _entityAction = {}; + _setMonitorAction = {}; + _parameterAction = {}; + _trafficAction = {}; + _variableAction = {}; + _isSetInfrastructureAction = true; + } + + void GlobalActionImpl::SetSetMonitorAction(std::shared_ptr setMonitorAction) + { + _setMonitorAction = setMonitorAction; + _environmentAction = {}; + _entityAction = {}; + _infrastructureAction = {}; + _parameterAction = {}; + _trafficAction = {}; + _variableAction = {}; + _isSetSetMonitorAction = true; + } + + void GlobalActionImpl::SetParameterAction(std::shared_ptr parameterAction) + { + _parameterAction = parameterAction; + _environmentAction = {}; + _entityAction = {}; + _infrastructureAction = {}; + _setMonitorAction = {}; + _trafficAction = {}; + _variableAction = {}; + _isSetParameterAction = true; + } + + void GlobalActionImpl::SetTrafficAction(std::shared_ptr trafficAction) + { + _trafficAction = trafficAction; + _environmentAction = {}; + _entityAction = {}; + _infrastructureAction = {}; + _setMonitorAction = {}; + _parameterAction = {}; + _variableAction = {}; + _isSetTrafficAction = true; + } + + void GlobalActionImpl::SetVariableAction(std::shared_ptr variableAction) + { + _variableAction = variableAction; + _environmentAction = {}; + _entityAction = {}; + _infrastructureAction = {}; + _setMonitorAction = {}; + _parameterAction = {}; + _trafficAction = {}; + _isSetVariableAction = true; + } + + std::shared_ptr GlobalActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(GlobalActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IGlobalAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IGlobalActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr GlobalActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t GlobalActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int GlobalActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double GlobalActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t GlobalActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool GlobalActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime GlobalActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr GlobalActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string GlobalActionImpl::GetModelType() const + { + return "GlobalAction"; + } + + // children + std::shared_ptr GlobalActionImpl::GetWriterEnvironmentAction() const + { + return std::dynamic_pointer_cast(_environmentAction); + } + std::shared_ptr GlobalActionImpl::GetWriterEntityAction() const + { + return std::dynamic_pointer_cast(_entityAction); + } + std::shared_ptr GlobalActionImpl::GetWriterInfrastructureAction() const + { + return std::dynamic_pointer_cast(_infrastructureAction); + } + std::shared_ptr GlobalActionImpl::GetWriterSetMonitorAction() const + { + return std::dynamic_pointer_cast(_setMonitorAction); + } + std::shared_ptr GlobalActionImpl::GetWriterParameterAction() const + { + return std::dynamic_pointer_cast(_parameterAction); + } + std::shared_ptr GlobalActionImpl::GetWriterTrafficAction() const + { + return std::dynamic_pointer_cast(_trafficAction); + } + std::shared_ptr GlobalActionImpl::GetWriterVariableAction() const + { + return std::dynamic_pointer_cast(_variableAction); + } + + GlobalActionImpl::GlobalActionImpl() + { + /** + * Filling the property to type map + */ + } + + void GlobalActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType GlobalActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> GlobalActionImpl::GetChildren() const + { + std::vector> result; + + const auto kEnvironmentAction = GetWriterEnvironmentAction(); + if (kEnvironmentAction) + { + result.push_back(std::dynamic_pointer_cast(kEnvironmentAction)); + } + const auto kEntityAction = GetWriterEntityAction(); + if (kEntityAction) + { + result.push_back(std::dynamic_pointer_cast(kEntityAction)); + } + const auto kInfrastructureAction = GetWriterInfrastructureAction(); + if (kInfrastructureAction) + { + result.push_back(std::dynamic_pointer_cast(kInfrastructureAction)); + } + const auto kSetMonitorAction = GetWriterSetMonitorAction(); + if (kSetMonitorAction) + { + result.push_back(std::dynamic_pointer_cast(kSetMonitorAction)); + } + const auto kParameterAction = GetWriterParameterAction(); + if (kParameterAction) + { + result.push_back(std::dynamic_pointer_cast(kParameterAction)); + } + const auto kTrafficAction = GetWriterTrafficAction(); + if (kTrafficAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficAction)); + } + const auto kVariableAction = GetWriterVariableAction(); + if (kVariableAction) + { + result.push_back(std::dynamic_pointer_cast(kVariableAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr GlobalActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEnvironmentAction = GetWriterEnvironmentAction(); + if (kEnvironmentAction) + { + auto clonedChild = std::dynamic_pointer_cast(kEnvironmentAction)->Clone(); + auto clonedChildIEnvironmentAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEnvironmentAction(std::dynamic_pointer_cast(clonedChildIEnvironmentAction)); + } + const auto kEntityAction = GetWriterEntityAction(); + if (kEntityAction) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityAction)->Clone(); + auto clonedChildIEntityAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityAction(std::dynamic_pointer_cast(clonedChildIEntityAction)); + } + const auto kInfrastructureAction = GetWriterInfrastructureAction(); + if (kInfrastructureAction) + { + auto clonedChild = std::dynamic_pointer_cast(kInfrastructureAction)->Clone(); + auto clonedChildIInfrastructureAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetInfrastructureAction(std::dynamic_pointer_cast(clonedChildIInfrastructureAction)); + } + const auto kSetMonitorAction = GetWriterSetMonitorAction(); + if (kSetMonitorAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSetMonitorAction)->Clone(); + auto clonedChildISetMonitorAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSetMonitorAction(std::dynamic_pointer_cast(clonedChildISetMonitorAction)); + } + const auto kParameterAction = GetWriterParameterAction(); + if (kParameterAction) + { + auto clonedChild = std::dynamic_pointer_cast(kParameterAction)->Clone(); + auto clonedChildIParameterAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetParameterAction(std::dynamic_pointer_cast(clonedChildIParameterAction)); + } + const auto kTrafficAction = GetWriterTrafficAction(); + if (kTrafficAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficAction)->Clone(); + auto clonedChildITrafficAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficAction(std::dynamic_pointer_cast(clonedChildITrafficAction)); + } + const auto kVariableAction = GetWriterVariableAction(); + if (kVariableAction) + { + auto clonedChild = std::dynamic_pointer_cast(kVariableAction)->Clone(); + auto clonedChildIVariableAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVariableAction(std::dynamic_pointer_cast(clonedChildIVariableAction)); + } + return clonedObject; + } + + std::string GlobalActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr GlobalActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION) + { + return std::dynamic_pointer_cast(GetEnvironmentAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_ACTION) + { + return std::dynamic_pointer_cast(GetEntityAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION) + { + return std::dynamic_pointer_cast(GetInfrastructureAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION) + { + return std::dynamic_pointer_cast(GetSetMonitorAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION) + { + return std::dynamic_pointer_cast(GetParameterAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION) + { + return std::dynamic_pointer_cast(GetVariableAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> GlobalActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr GlobalActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string GlobalActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool GlobalActionImpl::IsSetEnvironmentAction() const + { + return _isSetEnvironmentAction; + } + bool GlobalActionImpl::IsSetEntityAction() const + { + return _isSetEntityAction; + } + bool GlobalActionImpl::IsSetInfrastructureAction() const + { + return _isSetInfrastructureAction; + } + bool GlobalActionImpl::IsSetSetMonitorAction() const + { + return _isSetSetMonitorAction; + } + bool GlobalActionImpl::IsSetParameterAction() const + { + return _isSetParameterAction; + } + bool GlobalActionImpl::IsSetTrafficAction() const + { + return _isSetTrafficAction; + } + bool GlobalActionImpl::IsSetVariableAction() const + { + return _isSetVariableAction; + } + + IOpenScenarioFlexElement* HistogramImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> HistogramImpl::GetBins() const + { + std::vector> temp; + for(auto&& elm: _bins) + temp.push_back(elm); + return temp; + } + std::vector> HistogramImpl::GetWriterBins() const + { + return _bins; + } + + int HistogramImpl::GetBinsSize() const + { + return static_cast(_bins.size()); + } + + std::shared_ptr HistogramImpl::GetBinsAtIndex(unsigned int index) const + { + if (index >= 0 && _bins.size() > index) + { + return _bins[index]; + } + return nullptr; + } + + + void HistogramImpl::SetBins(std::vector>& bins) + { + _bins = bins; + _isSetBins = true; + } + + std::shared_ptr HistogramImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(HistogramImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IHistogram).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IHistogramWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr HistogramImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t HistogramImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int HistogramImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double HistogramImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t HistogramImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool HistogramImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime HistogramImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr HistogramImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string HistogramImpl::GetModelType() const + { + return "Histogram"; + } + + // children + + HistogramImpl::HistogramImpl() + { + /** + * Filling the property to type map + */ + } + + void HistogramImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType HistogramImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> HistogramImpl::GetChildren() const + { + std::vector> result; + + auto bins = GetWriterBins(); + if (!bins.empty()) + { + for(auto&& item : bins) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr HistogramImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kBins = GetWriterBins(); + if (!kBins.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kBins) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetBins(clonedList); + } + return clonedObject; + } + + std::string HistogramImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr HistogramImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> HistogramImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BIN) + { + std::vector> vect; + for (auto&& elem : GetBins()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr HistogramImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string HistogramImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool HistogramImpl::IsSetBins() const + { + return _isSetBins; + } + + IOpenScenarioFlexElement* HistogramBinImpl::GetOpenScenarioFlexElement() + { + return this; + } + double HistogramBinImpl::GetWeight() const + { + return _weight; + } + std::shared_ptr HistogramBinImpl::GetRange() const + { + return _range; + } + + + void HistogramBinImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + void HistogramBinImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr HistogramBinImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(HistogramBinImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IHistogramBin).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IHistogramBinWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr HistogramBinImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t HistogramBinImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int HistogramBinImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double HistogramBinImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t HistogramBinImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool HistogramBinImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime HistogramBinImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr HistogramBinImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string HistogramBinImpl::GetModelType() const + { + return "HistogramBin"; + } + + void HistogramBinImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string HistogramBinImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool HistogramBinImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr HistogramBinImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + HistogramBinImpl::HistogramBinImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void HistogramBinImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType HistogramBinImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> HistogramBinImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr HistogramBinImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string HistogramBinImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr HistogramBinImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> HistogramBinImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr HistogramBinImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string HistogramBinImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void HistogramBinImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool HistogramBinImpl::IsSetWeight() const + { + return _isSetWeight; + } + bool HistogramBinImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* InRoutePositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr InRoutePositionImpl::GetFromCurrentEntity() const + { + return _fromCurrentEntity; + } + std::shared_ptr InRoutePositionImpl::GetFromRoadCoordinates() const + { + return _fromRoadCoordinates; + } + std::shared_ptr InRoutePositionImpl::GetFromLaneCoordinates() const + { + return _fromLaneCoordinates; + } + + + void InRoutePositionImpl::SetFromCurrentEntity(std::shared_ptr fromCurrentEntity) + { + _fromCurrentEntity = fromCurrentEntity; + _fromRoadCoordinates = {}; + _fromLaneCoordinates = {}; + _isSetFromCurrentEntity = true; + } + + void InRoutePositionImpl::SetFromRoadCoordinates(std::shared_ptr fromRoadCoordinates) + { + _fromRoadCoordinates = fromRoadCoordinates; + _fromCurrentEntity = {}; + _fromLaneCoordinates = {}; + _isSetFromRoadCoordinates = true; + } + + void InRoutePositionImpl::SetFromLaneCoordinates(std::shared_ptr fromLaneCoordinates) + { + _fromLaneCoordinates = fromLaneCoordinates; + _fromCurrentEntity = {}; + _fromRoadCoordinates = {}; + _isSetFromLaneCoordinates = true; + } + + std::shared_ptr InRoutePositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(InRoutePositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IInRoutePosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IInRoutePositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr InRoutePositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t InRoutePositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int InRoutePositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double InRoutePositionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t InRoutePositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool InRoutePositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime InRoutePositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr InRoutePositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string InRoutePositionImpl::GetModelType() const + { + return "InRoutePosition"; + } + + // children + std::shared_ptr InRoutePositionImpl::GetWriterFromCurrentEntity() const + { + return std::dynamic_pointer_cast(_fromCurrentEntity); + } + std::shared_ptr InRoutePositionImpl::GetWriterFromRoadCoordinates() const + { + return std::dynamic_pointer_cast(_fromRoadCoordinates); + } + std::shared_ptr InRoutePositionImpl::GetWriterFromLaneCoordinates() const + { + return std::dynamic_pointer_cast(_fromLaneCoordinates); + } + + InRoutePositionImpl::InRoutePositionImpl() + { + /** + * Filling the property to type map + */ + } + + void InRoutePositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType InRoutePositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> InRoutePositionImpl::GetChildren() const + { + std::vector> result; + + const auto kFromCurrentEntity = GetWriterFromCurrentEntity(); + if (kFromCurrentEntity) + { + result.push_back(std::dynamic_pointer_cast(kFromCurrentEntity)); + } + const auto kFromRoadCoordinates = GetWriterFromRoadCoordinates(); + if (kFromRoadCoordinates) + { + result.push_back(std::dynamic_pointer_cast(kFromRoadCoordinates)); + } + const auto kFromLaneCoordinates = GetWriterFromLaneCoordinates(); + if (kFromLaneCoordinates) + { + result.push_back(std::dynamic_pointer_cast(kFromLaneCoordinates)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr InRoutePositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kFromCurrentEntity = GetWriterFromCurrentEntity(); + if (kFromCurrentEntity) + { + auto clonedChild = std::dynamic_pointer_cast(kFromCurrentEntity)->Clone(); + auto clonedChildIPositionOfCurrentEntity = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFromCurrentEntity(std::dynamic_pointer_cast(clonedChildIPositionOfCurrentEntity)); + } + const auto kFromRoadCoordinates = GetWriterFromRoadCoordinates(); + if (kFromRoadCoordinates) + { + auto clonedChild = std::dynamic_pointer_cast(kFromRoadCoordinates)->Clone(); + auto clonedChildIPositionInRoadCoordinates = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFromRoadCoordinates(std::dynamic_pointer_cast(clonedChildIPositionInRoadCoordinates)); + } + const auto kFromLaneCoordinates = GetWriterFromLaneCoordinates(); + if (kFromLaneCoordinates) + { + auto clonedChild = std::dynamic_pointer_cast(kFromLaneCoordinates)->Clone(); + auto clonedChildIPositionInLaneCoordinates = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFromLaneCoordinates(std::dynamic_pointer_cast(clonedChildIPositionInLaneCoordinates)); + } + return clonedObject; + } + + std::string InRoutePositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr InRoutePositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY) + { + return std::dynamic_pointer_cast(GetFromCurrentEntity()); + } + + if (key == OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES) + { + return std::dynamic_pointer_cast(GetFromRoadCoordinates()); + } + + if (key == OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES) + { + return std::dynamic_pointer_cast(GetFromLaneCoordinates()); + } + throw KeyNotSupportedException(); + } + + std::vector> InRoutePositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr InRoutePositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string InRoutePositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool InRoutePositionImpl::IsSetFromCurrentEntity() const + { + return _isSetFromCurrentEntity; + } + bool InRoutePositionImpl::IsSetFromRoadCoordinates() const + { + return _isSetFromRoadCoordinates; + } + bool InRoutePositionImpl::IsSetFromLaneCoordinates() const + { + return _isSetFromLaneCoordinates; + } + + IOpenScenarioFlexElement* InfrastructureActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr InfrastructureActionImpl::GetTrafficSignalAction() const + { + return _trafficSignalAction; + } + + + void InfrastructureActionImpl::SetTrafficSignalAction(std::shared_ptr trafficSignalAction) + { + _trafficSignalAction = trafficSignalAction; + _isSetTrafficSignalAction = true; + } + + std::shared_ptr InfrastructureActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(InfrastructureActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IInfrastructureAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IInfrastructureActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr InfrastructureActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t InfrastructureActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int InfrastructureActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double InfrastructureActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t InfrastructureActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool InfrastructureActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime InfrastructureActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr InfrastructureActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string InfrastructureActionImpl::GetModelType() const + { + return "InfrastructureAction"; + } + + // children + std::shared_ptr InfrastructureActionImpl::GetWriterTrafficSignalAction() const + { + return std::dynamic_pointer_cast(_trafficSignalAction); + } + + InfrastructureActionImpl::InfrastructureActionImpl() + { + /** + * Filling the property to type map + */ + } + + void InfrastructureActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType InfrastructureActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> InfrastructureActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTrafficSignalAction = GetWriterTrafficSignalAction(); + if (kTrafficSignalAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr InfrastructureActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTrafficSignalAction = GetWriterTrafficSignalAction(); + if (kTrafficSignalAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalAction)->Clone(); + auto clonedChildITrafficSignalAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalAction(std::dynamic_pointer_cast(clonedChildITrafficSignalAction)); + } + return clonedObject; + } + + std::string InfrastructureActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr InfrastructureActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSignalAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> InfrastructureActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr InfrastructureActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string InfrastructureActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool InfrastructureActionImpl::IsSetTrafficSignalAction() const + { + return _isSetTrafficSignalAction; + } + + IOpenScenarioFlexElement* InitImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr InitImpl::GetActions() const + { + return _actions; + } + + + void InitImpl::SetActions(std::shared_ptr actions) + { + _actions = actions; + _isSetActions = true; + } + + std::shared_ptr InitImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(InitImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IInit).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IInitWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr InitImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t InitImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int InitImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double InitImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t InitImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool InitImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime InitImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr InitImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string InitImpl::GetModelType() const + { + return "Init"; + } + + // children + std::shared_ptr InitImpl::GetWriterActions() const + { + return std::dynamic_pointer_cast(_actions); + } + + InitImpl::InitImpl() + { + /** + * Filling the property to type map + */ + } + + void InitImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType InitImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> InitImpl::GetChildren() const + { + std::vector> result; + + const auto kActions = GetWriterActions(); + if (kActions) + { + result.push_back(std::dynamic_pointer_cast(kActions)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr InitImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kActions = GetWriterActions(); + if (kActions) + { + auto clonedChild = std::dynamic_pointer_cast(kActions)->Clone(); + auto clonedChildIInitActions = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetActions(std::dynamic_pointer_cast(clonedChildIInitActions)); + } + return clonedObject; + } + + std::string InitImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr InitImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACTIONS) + { + return std::dynamic_pointer_cast(GetActions()); + } + throw KeyNotSupportedException(); + } + + std::vector> InitImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr InitImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string InitImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool InitImpl::IsSetActions() const + { + return _isSetActions; + } + + IOpenScenarioFlexElement* InitActionsImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> InitActionsImpl::GetGlobalActions() const + { + std::vector> temp; + for(auto&& elm: _globalActions) + temp.push_back(elm); + return temp; + } + std::vector> InitActionsImpl::GetWriterGlobalActions() const + { + return _globalActions; + } + + int InitActionsImpl::GetGlobalActionsSize() const + { + return static_cast(_globalActions.size()); + } + + std::shared_ptr InitActionsImpl::GetGlobalActionsAtIndex(unsigned int index) const + { + if (index >= 0 && _globalActions.size() > index) + { + return _globalActions[index]; + } + return nullptr; + } + std::vector> InitActionsImpl::GetUserDefinedActions() const + { + std::vector> temp; + for(auto&& elm: _userDefinedActions) + temp.push_back(elm); + return temp; + } + std::vector> InitActionsImpl::GetWriterUserDefinedActions() const + { + return _userDefinedActions; + } + + int InitActionsImpl::GetUserDefinedActionsSize() const + { + return static_cast(_userDefinedActions.size()); + } + + std::shared_ptr InitActionsImpl::GetUserDefinedActionsAtIndex(unsigned int index) const + { + if (index >= 0 && _userDefinedActions.size() > index) + { + return _userDefinedActions[index]; + } + return nullptr; + } + std::vector> InitActionsImpl::GetPrivates() const + { + std::vector> temp; + for(auto&& elm: _privates) + temp.push_back(elm); + return temp; + } + std::vector> InitActionsImpl::GetWriterPrivates() const + { + return _privates; + } + + int InitActionsImpl::GetPrivatesSize() const + { + return static_cast(_privates.size()); + } + + std::shared_ptr InitActionsImpl::GetPrivatesAtIndex(unsigned int index) const + { + if (index >= 0 && _privates.size() > index) + { + return _privates[index]; + } + return nullptr; + } + + + void InitActionsImpl::SetGlobalActions(std::vector>& globalActions) + { + _globalActions = globalActions; + _isSetGlobalActions = true; + } + + void InitActionsImpl::SetUserDefinedActions(std::vector>& userDefinedActions) + { + _userDefinedActions = userDefinedActions; + _isSetUserDefinedActions = true; + } + + void InitActionsImpl::SetPrivates(std::vector>& privates) + { + _privates = privates; + _isSetPrivates = true; + } + + std::shared_ptr InitActionsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(InitActionsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IInitActions).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IInitActionsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr InitActionsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t InitActionsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int InitActionsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double InitActionsImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t InitActionsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool InitActionsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime InitActionsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr InitActionsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string InitActionsImpl::GetModelType() const + { + return "InitActions"; + } + + // children + + InitActionsImpl::InitActionsImpl() + { + /** + * Filling the property to type map + */ + } + + void InitActionsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType InitActionsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> InitActionsImpl::GetChildren() const + { + std::vector> result; + + auto globalActions = GetWriterGlobalActions(); + if (!globalActions.empty()) + { + for(auto&& item : globalActions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto userDefinedActions = GetWriterUserDefinedActions(); + if (!userDefinedActions.empty()) + { + for(auto&& item : userDefinedActions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto privates = GetWriterPrivates(); + if (!privates.empty()) + { + for(auto&& item : privates) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr InitActionsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kGlobalActions = GetWriterGlobalActions(); + if (!kGlobalActions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kGlobalActions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetGlobalActions(clonedList); + } + const auto kUserDefinedActions = GetWriterUserDefinedActions(); + if (!kUserDefinedActions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kUserDefinedActions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetUserDefinedActions(clonedList); + } + const auto kPrivates = GetWriterPrivates(); + if (!kPrivates.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPrivates) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPrivates(clonedList); + } + return clonedObject; + } + + std::string InitActionsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr InitActionsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> InitActionsImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION) + { + std::vector> vect; + for (auto&& elem : GetGlobalActions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION) + { + std::vector> vect; + for (auto&& elem : GetUserDefinedActions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__PRIVATE) + { + std::vector> vect; + for (auto&& elem : GetPrivates()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr InitActionsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string InitActionsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void InitActionsImpl::ResetGlobalActions() + { + _isSetGlobalActions = false; + _globalActions = {}; + + } + bool InitActionsImpl::IsSetGlobalActions() const + { + return _isSetGlobalActions; + } + void InitActionsImpl::ResetUserDefinedActions() + { + _isSetUserDefinedActions = false; + _userDefinedActions = {}; + + } + bool InitActionsImpl::IsSetUserDefinedActions() const + { + return _isSetUserDefinedActions; + } + void InitActionsImpl::ResetPrivates() + { + _isSetPrivates = false; + _privates = {}; + + } + bool InitActionsImpl::IsSetPrivates() const + { + return _isSetPrivates; + } + + IOpenScenarioFlexElement* KnotImpl::GetOpenScenarioFlexElement() + { + return this; + } + double KnotImpl::GetValue() const + { + return _value; + } + + + void KnotImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr KnotImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(KnotImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IKnot).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IKnotWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr KnotImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t KnotImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int KnotImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double KnotImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t KnotImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool KnotImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime KnotImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr KnotImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string KnotImpl::GetModelType() const + { + return "Knot"; + } + + void KnotImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string KnotImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool KnotImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + KnotImpl::KnotImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void KnotImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType KnotImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> KnotImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr KnotImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string KnotImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr KnotImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> KnotImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr KnotImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string KnotImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void KnotImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool KnotImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* LaneImpl::GetOpenScenarioFlexElement() + { + return this; + } + int LaneImpl::GetId() const + { + return _id; + } + + + void LaneImpl::SetId(const int id) + { + _id = id; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ID); + _isSetId = true; + } + + std::shared_ptr LaneImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILane).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ID) + { + return GetId(); + } + throw KeyNotSupportedException(); + + } + + double LaneImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LaneImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LaneImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneImpl::GetModelType() const + { + return "Lane"; + } + + void LaneImpl::WriteParameterToId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ID, parameterName, nullTextMarker /*no textmarker*/); + _id = {}; + } + + std::string LaneImpl::GetParameterFromId() const + { + auto id = OSC_CONSTANTS::ATTRIBUTE__ID; + return GetParameterNameFromAttribute(id); + } + + bool LaneImpl::IsIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ID); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + LaneImpl::LaneImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ID, SimpleType::INT); + } + + void LaneImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ID) + { + // Simple type + _id = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetId = true; + } + } + + SimpleType LaneImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_id = GetId(); + // clone indicators + // clone children + return clonedObject; + } + + std::string LaneImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> LaneImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LaneImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ID) + { + // Simple type + _id = value; + AddResolvedParameter(attributeKey); + _isSetId = true; + } + + } + + + bool LaneImpl::IsSetId() const + { + return _isSetId; + } + + IOpenScenarioFlexElement* LaneChangeActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double LaneChangeActionImpl::GetTargetLaneOffset() const + { + return _targetLaneOffset; + } + std::shared_ptr LaneChangeActionImpl::GetLaneChangeActionDynamics() const + { + return _laneChangeActionDynamics; + } + std::shared_ptr LaneChangeActionImpl::GetLaneChangeTarget() const + { + return _laneChangeTarget; + } + + + void LaneChangeActionImpl::SetTargetLaneOffset(const double targetLaneOffset) + { + _targetLaneOffset = targetLaneOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET); + _isSetTargetLaneOffset = true; + } + + void LaneChangeActionImpl::SetLaneChangeActionDynamics(std::shared_ptr laneChangeActionDynamics) + { + _laneChangeActionDynamics = laneChangeActionDynamics; + _isSetLaneChangeActionDynamics = true; + } + + void LaneChangeActionImpl::SetLaneChangeTarget(std::shared_ptr laneChangeTarget) + { + _laneChangeTarget = laneChangeTarget; + _isSetLaneChangeTarget = true; + } + + std::shared_ptr LaneChangeActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneChangeActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILaneChangeAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneChangeActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneChangeActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneChangeActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneChangeActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LaneChangeActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET) + { + return GetTargetLaneOffset(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LaneChangeActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneChangeActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LaneChangeActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneChangeActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneChangeActionImpl::GetModelType() const + { + return "LaneChangeAction"; + } + + void LaneChangeActionImpl::WriteParameterToTargetLaneOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _targetLaneOffset = {}; + } + + std::string LaneChangeActionImpl::GetParameterFromTargetLaneOffset() const + { + auto targetLaneOffset = OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET; + return GetParameterNameFromAttribute(targetLaneOffset); + } + + bool LaneChangeActionImpl::IsTargetLaneOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LaneChangeActionImpl::GetWriterLaneChangeActionDynamics() const + { + return std::dynamic_pointer_cast(_laneChangeActionDynamics); + } + std::shared_ptr LaneChangeActionImpl::GetWriterLaneChangeTarget() const + { + return std::dynamic_pointer_cast(_laneChangeTarget); + } + + LaneChangeActionImpl::LaneChangeActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, SimpleType::DOUBLE); + } + + void LaneChangeActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET) + { + // Simple type + _targetLaneOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTargetLaneOffset = true; + } + } + + SimpleType LaneChangeActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneChangeActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLaneChangeActionDynamics = GetWriterLaneChangeActionDynamics(); + if (kLaneChangeActionDynamics) + { + result.push_back(std::dynamic_pointer_cast(kLaneChangeActionDynamics)); + } + const auto kLaneChangeTarget = GetWriterLaneChangeTarget(); + if (kLaneChangeTarget) + { + result.push_back(std::dynamic_pointer_cast(kLaneChangeTarget)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneChangeActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_targetLaneOffset = GetTargetLaneOffset(); + // clone indicators + clonedObject->_isSetTargetLaneOffset = _isSetTargetLaneOffset; + // clone children + const auto kLaneChangeActionDynamics = GetWriterLaneChangeActionDynamics(); + if (kLaneChangeActionDynamics) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneChangeActionDynamics)->Clone(); + auto clonedChildITransitionDynamics = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneChangeActionDynamics(std::dynamic_pointer_cast(clonedChildITransitionDynamics)); + } + const auto kLaneChangeTarget = GetWriterLaneChangeTarget(); + if (kLaneChangeTarget) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneChangeTarget)->Clone(); + auto clonedChildILaneChangeTarget = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneChangeTarget(std::dynamic_pointer_cast(clonedChildILaneChangeTarget)); + } + return clonedObject; + } + + std::string LaneChangeActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneChangeActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION_DYNAMICS) + { + return std::dynamic_pointer_cast(GetLaneChangeActionDynamics()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_TARGET) + { + return std::dynamic_pointer_cast(GetLaneChangeTarget()); + } + throw KeyNotSupportedException(); + } + + std::vector> LaneChangeActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneChangeActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneChangeActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LaneChangeActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET) + { + // Simple type + _targetLaneOffset = value; + AddResolvedParameter(attributeKey); + _isSetTargetLaneOffset = true; + } + + } + + + void LaneChangeActionImpl::ResetTargetLaneOffset() + { + _isSetTargetLaneOffset = false; + _targetLaneOffset = {0}; + + } + bool LaneChangeActionImpl::IsSetTargetLaneOffset() const + { + return _isSetTargetLaneOffset; + } + bool LaneChangeActionImpl::IsSetLaneChangeActionDynamics() const + { + return _isSetLaneChangeActionDynamics; + } + bool LaneChangeActionImpl::IsSetLaneChangeTarget() const + { + return _isSetLaneChangeTarget; + } + + IOpenScenarioFlexElement* LaneChangeTargetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr LaneChangeTargetImpl::GetRelativeTargetLane() const + { + return _relativeTargetLane; + } + std::shared_ptr LaneChangeTargetImpl::GetAbsoluteTargetLane() const + { + return _absoluteTargetLane; + } + + + void LaneChangeTargetImpl::SetRelativeTargetLane(std::shared_ptr relativeTargetLane) + { + _relativeTargetLane = relativeTargetLane; + _absoluteTargetLane = {}; + _isSetRelativeTargetLane = true; + } + + void LaneChangeTargetImpl::SetAbsoluteTargetLane(std::shared_ptr absoluteTargetLane) + { + _absoluteTargetLane = absoluteTargetLane; + _relativeTargetLane = {}; + _isSetAbsoluteTargetLane = true; + } + + std::shared_ptr LaneChangeTargetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneChangeTargetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILaneChangeTarget).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneChangeTargetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneChangeTargetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneChangeTargetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneChangeTargetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LaneChangeTargetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LaneChangeTargetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneChangeTargetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LaneChangeTargetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneChangeTargetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneChangeTargetImpl::GetModelType() const + { + return "LaneChangeTarget"; + } + + // children + std::shared_ptr LaneChangeTargetImpl::GetWriterRelativeTargetLane() const + { + return std::dynamic_pointer_cast(_relativeTargetLane); + } + std::shared_ptr LaneChangeTargetImpl::GetWriterAbsoluteTargetLane() const + { + return std::dynamic_pointer_cast(_absoluteTargetLane); + } + + LaneChangeTargetImpl::LaneChangeTargetImpl() + { + /** + * Filling the property to type map + */ + } + + void LaneChangeTargetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType LaneChangeTargetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneChangeTargetImpl::GetChildren() const + { + std::vector> result; + + const auto kRelativeTargetLane = GetWriterRelativeTargetLane(); + if (kRelativeTargetLane) + { + result.push_back(std::dynamic_pointer_cast(kRelativeTargetLane)); + } + const auto kAbsoluteTargetLane = GetWriterAbsoluteTargetLane(); + if (kAbsoluteTargetLane) + { + result.push_back(std::dynamic_pointer_cast(kAbsoluteTargetLane)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneChangeTargetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRelativeTargetLane = GetWriterRelativeTargetLane(); + if (kRelativeTargetLane) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeTargetLane)->Clone(); + auto clonedChildIRelativeTargetLane = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeTargetLane(std::dynamic_pointer_cast(clonedChildIRelativeTargetLane)); + } + const auto kAbsoluteTargetLane = GetWriterAbsoluteTargetLane(); + if (kAbsoluteTargetLane) + { + auto clonedChild = std::dynamic_pointer_cast(kAbsoluteTargetLane)->Clone(); + auto clonedChildIAbsoluteTargetLane = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAbsoluteTargetLane(std::dynamic_pointer_cast(clonedChildIAbsoluteTargetLane)); + } + return clonedObject; + } + + std::string LaneChangeTargetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneChangeTargetImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE) + { + return std::dynamic_pointer_cast(GetRelativeTargetLane()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE) + { + return std::dynamic_pointer_cast(GetAbsoluteTargetLane()); + } + throw KeyNotSupportedException(); + } + + std::vector> LaneChangeTargetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneChangeTargetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneChangeTargetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool LaneChangeTargetImpl::IsSetRelativeTargetLane() const + { + return _isSetRelativeTargetLane; + } + bool LaneChangeTargetImpl::IsSetAbsoluteTargetLane() const + { + return _isSetAbsoluteTargetLane; + } + + IOpenScenarioFlexElement* LaneOffsetActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool LaneOffsetActionImpl::GetContinuous() const + { + return _continuous; + } + std::shared_ptr LaneOffsetActionImpl::GetLaneOffsetActionDynamics() const + { + return _laneOffsetActionDynamics; + } + std::shared_ptr LaneOffsetActionImpl::GetLaneOffsetTarget() const + { + return _laneOffsetTarget; + } + + + void LaneOffsetActionImpl::SetContinuous(const bool continuous) + { + _continuous = continuous; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + _isSetContinuous = true; + } + + void LaneOffsetActionImpl::SetLaneOffsetActionDynamics(std::shared_ptr laneOffsetActionDynamics) + { + _laneOffsetActionDynamics = laneOffsetActionDynamics; + _isSetLaneOffsetActionDynamics = true; + } + + void LaneOffsetActionImpl::SetLaneOffsetTarget(std::shared_ptr laneOffsetTarget) + { + _laneOffsetTarget = laneOffsetTarget; + _isSetLaneOffsetTarget = true; + } + + std::shared_ptr LaneOffsetActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneOffsetActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILaneOffsetAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneOffsetActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneOffsetActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneOffsetActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneOffsetActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LaneOffsetActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LaneOffsetActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneOffsetActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + return GetContinuous(); + } + throw KeyNotSupportedException(); + + } + + DateTime LaneOffsetActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneOffsetActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneOffsetActionImpl::GetModelType() const + { + return "LaneOffsetAction"; + } + + void LaneOffsetActionImpl::WriteParameterToContinuous(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, parameterName, nullTextMarker /*no textmarker*/); + _continuous = {}; + } + + std::string LaneOffsetActionImpl::GetParameterFromContinuous() const + { + auto continuous = OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS; + return GetParameterNameFromAttribute(continuous); + } + + bool LaneOffsetActionImpl::IsContinuousParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LaneOffsetActionImpl::GetWriterLaneOffsetActionDynamics() const + { + return std::dynamic_pointer_cast(_laneOffsetActionDynamics); + } + std::shared_ptr LaneOffsetActionImpl::GetWriterLaneOffsetTarget() const + { + return std::dynamic_pointer_cast(_laneOffsetTarget); + } + + LaneOffsetActionImpl::LaneOffsetActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, SimpleType::BOOLEAN); + } + + void LaneOffsetActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + } + + SimpleType LaneOffsetActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneOffsetActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLaneOffsetActionDynamics = GetWriterLaneOffsetActionDynamics(); + if (kLaneOffsetActionDynamics) + { + result.push_back(std::dynamic_pointer_cast(kLaneOffsetActionDynamics)); + } + const auto kLaneOffsetTarget = GetWriterLaneOffsetTarget(); + if (kLaneOffsetTarget) + { + result.push_back(std::dynamic_pointer_cast(kLaneOffsetTarget)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneOffsetActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_continuous = GetContinuous(); + // clone indicators + // clone children + const auto kLaneOffsetActionDynamics = GetWriterLaneOffsetActionDynamics(); + if (kLaneOffsetActionDynamics) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneOffsetActionDynamics)->Clone(); + auto clonedChildILaneOffsetActionDynamics = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneOffsetActionDynamics(std::dynamic_pointer_cast(clonedChildILaneOffsetActionDynamics)); + } + const auto kLaneOffsetTarget = GetWriterLaneOffsetTarget(); + if (kLaneOffsetTarget) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneOffsetTarget)->Clone(); + auto clonedChildILaneOffsetTarget = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneOffsetTarget(std::dynamic_pointer_cast(clonedChildILaneOffsetTarget)); + } + return clonedObject; + } + + std::string LaneOffsetActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION_DYNAMICS) + { + return std::dynamic_pointer_cast(GetLaneOffsetActionDynamics()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_TARGET) + { + return std::dynamic_pointer_cast(GetLaneOffsetTarget()); + } + throw KeyNotSupportedException(); + } + + std::vector> LaneOffsetActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneOffsetActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LaneOffsetActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = value; + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + + } + + + bool LaneOffsetActionImpl::IsSetContinuous() const + { + return _isSetContinuous; + } + bool LaneOffsetActionImpl::IsSetLaneOffsetActionDynamics() const + { + return _isSetLaneOffsetActionDynamics; + } + bool LaneOffsetActionImpl::IsSetLaneOffsetTarget() const + { + return _isSetLaneOffsetTarget; + } + + IOpenScenarioFlexElement* LaneOffsetActionDynamicsImpl::GetOpenScenarioFlexElement() + { + return this; + } + DynamicsShape LaneOffsetActionDynamicsImpl::GetDynamicsShape() const + { + return _dynamicsShape; + } + double LaneOffsetActionDynamicsImpl::GetMaxLateralAcc() const + { + return _maxLateralAcc; + } + + + void LaneOffsetActionDynamicsImpl::SetDynamicsShape(const DynamicsShape dynamicsShape) + { + _dynamicsShape = dynamicsShape; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE); + _isSetDynamicsShape = true; + } + + void LaneOffsetActionDynamicsImpl::SetMaxLateralAcc(const double maxLateralAcc) + { + _maxLateralAcc = maxLateralAcc; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC); + _isSetMaxLateralAcc = true; + } + + std::shared_ptr LaneOffsetActionDynamicsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneOffsetActionDynamicsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILaneOffsetActionDynamics).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneOffsetActionDynamicsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneOffsetActionDynamicsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneOffsetActionDynamicsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneOffsetActionDynamicsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LaneOffsetActionDynamicsImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC) + { + return GetMaxLateralAcc(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LaneOffsetActionDynamicsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneOffsetActionDynamicsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LaneOffsetActionDynamicsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneOffsetActionDynamicsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneOffsetActionDynamicsImpl::GetModelType() const + { + return "LaneOffsetActionDynamics"; + } + + void LaneOffsetActionDynamicsImpl::WriteParameterToDynamicsShape(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, parameterName, nullTextMarker /*no textmarker*/); + _dynamicsShape = {}; + } + + void LaneOffsetActionDynamicsImpl::WriteParameterToMaxLateralAcc(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, parameterName, nullTextMarker /*no textmarker*/); + _maxLateralAcc = {}; + } + + std::string LaneOffsetActionDynamicsImpl::GetParameterFromDynamicsShape() const + { + auto dynamicsShape = OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE; + return GetParameterNameFromAttribute(dynamicsShape); + } + + std::string LaneOffsetActionDynamicsImpl::GetParameterFromMaxLateralAcc() const + { + auto maxLateralAcc = OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC; + return GetParameterNameFromAttribute(maxLateralAcc); + } + + bool LaneOffsetActionDynamicsImpl::IsDynamicsShapeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LaneOffsetActionDynamicsImpl::IsMaxLateralAccParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + LaneOffsetActionDynamicsImpl::LaneOffsetActionDynamicsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, SimpleType::DOUBLE); + } + + void LaneOffsetActionDynamicsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE) + { + // Enumeration Type + const auto kResult = DynamicsShape::GetFromLiteral(parameterLiteralValue); + if (kResult != DynamicsShape::UNKNOWN) + { + _dynamicsShape = kResult; + AddResolvedParameter(attributeKey); + _isSetDynamicsShape = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC) + { + // Simple type + _maxLateralAcc = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxLateralAcc = true; + } + } + + SimpleType LaneOffsetActionDynamicsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneOffsetActionDynamicsImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneOffsetActionDynamicsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDynamicsShape = GetDynamicsShape(); + if ( kDynamicsShape.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_dynamicsShape = DynamicsShape::GetFromLiteral(kDynamicsShape.GetLiteral()); + } + // Simple type + clonedObject->_maxLateralAcc = GetMaxLateralAcc(); + // clone indicators + clonedObject->_isSetMaxLateralAcc = _isSetMaxLateralAcc; + // clone children + return clonedObject; + } + + std::string LaneOffsetActionDynamicsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetActionDynamicsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> LaneOffsetActionDynamicsImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetActionDynamicsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneOffsetActionDynamicsImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE) + { + auto dynamicsShape = GetDynamicsShape(); + return dynamicsShape.GetLiteral() != "UNKNOWN" ? dynamicsShape.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void LaneOffsetActionDynamicsImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC) + { + // Simple type + _maxLateralAcc = value; + AddResolvedParameter(attributeKey); + _isSetMaxLateralAcc = true; + } + + } + + + bool LaneOffsetActionDynamicsImpl::IsSetDynamicsShape() const + { + return _isSetDynamicsShape; + } + void LaneOffsetActionDynamicsImpl::ResetMaxLateralAcc() + { + _isSetMaxLateralAcc = false; + _maxLateralAcc = {}; + + } + bool LaneOffsetActionDynamicsImpl::IsSetMaxLateralAcc() const + { + return _isSetMaxLateralAcc; + } + + IOpenScenarioFlexElement* LaneOffsetTargetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr LaneOffsetTargetImpl::GetRelativeTargetLaneOffset() const + { + return _relativeTargetLaneOffset; + } + std::shared_ptr LaneOffsetTargetImpl::GetAbsoluteTargetLaneOffset() const + { + return _absoluteTargetLaneOffset; + } + + + void LaneOffsetTargetImpl::SetRelativeTargetLaneOffset(std::shared_ptr relativeTargetLaneOffset) + { + _relativeTargetLaneOffset = relativeTargetLaneOffset; + _absoluteTargetLaneOffset = {}; + _isSetRelativeTargetLaneOffset = true; + } + + void LaneOffsetTargetImpl::SetAbsoluteTargetLaneOffset(std::shared_ptr absoluteTargetLaneOffset) + { + _absoluteTargetLaneOffset = absoluteTargetLaneOffset; + _relativeTargetLaneOffset = {}; + _isSetAbsoluteTargetLaneOffset = true; + } + + std::shared_ptr LaneOffsetTargetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LaneOffsetTargetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILaneOffsetTarget).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILaneOffsetTargetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LaneOffsetTargetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LaneOffsetTargetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LaneOffsetTargetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LaneOffsetTargetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LaneOffsetTargetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LaneOffsetTargetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LaneOffsetTargetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LaneOffsetTargetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LaneOffsetTargetImpl::GetModelType() const + { + return "LaneOffsetTarget"; + } + + // children + std::shared_ptr LaneOffsetTargetImpl::GetWriterRelativeTargetLaneOffset() const + { + return std::dynamic_pointer_cast(_relativeTargetLaneOffset); + } + std::shared_ptr LaneOffsetTargetImpl::GetWriterAbsoluteTargetLaneOffset() const + { + return std::dynamic_pointer_cast(_absoluteTargetLaneOffset); + } + + LaneOffsetTargetImpl::LaneOffsetTargetImpl() + { + /** + * Filling the property to type map + */ + } + + void LaneOffsetTargetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType LaneOffsetTargetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LaneOffsetTargetImpl::GetChildren() const + { + std::vector> result; + + const auto kRelativeTargetLaneOffset = GetWriterRelativeTargetLaneOffset(); + if (kRelativeTargetLaneOffset) + { + result.push_back(std::dynamic_pointer_cast(kRelativeTargetLaneOffset)); + } + const auto kAbsoluteTargetLaneOffset = GetWriterAbsoluteTargetLaneOffset(); + if (kAbsoluteTargetLaneOffset) + { + result.push_back(std::dynamic_pointer_cast(kAbsoluteTargetLaneOffset)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LaneOffsetTargetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRelativeTargetLaneOffset = GetWriterRelativeTargetLaneOffset(); + if (kRelativeTargetLaneOffset) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeTargetLaneOffset)->Clone(); + auto clonedChildIRelativeTargetLaneOffset = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeTargetLaneOffset(std::dynamic_pointer_cast(clonedChildIRelativeTargetLaneOffset)); + } + const auto kAbsoluteTargetLaneOffset = GetWriterAbsoluteTargetLaneOffset(); + if (kAbsoluteTargetLaneOffset) + { + auto clonedChild = std::dynamic_pointer_cast(kAbsoluteTargetLaneOffset)->Clone(); + auto clonedChildIAbsoluteTargetLaneOffset = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAbsoluteTargetLaneOffset(std::dynamic_pointer_cast(clonedChildIAbsoluteTargetLaneOffset)); + } + return clonedObject; + } + + std::string LaneOffsetTargetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetTargetImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET) + { + return std::dynamic_pointer_cast(GetRelativeTargetLaneOffset()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET) + { + return std::dynamic_pointer_cast(GetAbsoluteTargetLaneOffset()); + } + throw KeyNotSupportedException(); + } + + std::vector> LaneOffsetTargetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LaneOffsetTargetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LaneOffsetTargetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool LaneOffsetTargetImpl::IsSetRelativeTargetLaneOffset() const + { + return _isSetRelativeTargetLaneOffset; + } + bool LaneOffsetTargetImpl::IsSetAbsoluteTargetLaneOffset() const + { + return _isSetAbsoluteTargetLaneOffset; + } + + IOpenScenarioFlexElement* LanePositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string LanePositionImpl::GetLaneId() const + { + return _laneId; + } + double LanePositionImpl::GetOffset() const + { + return _offset; + } + std::string LanePositionImpl::GetRoadId() const + { + return _roadId; + } + double LanePositionImpl::GetS() const + { + return _s; + } + std::shared_ptr LanePositionImpl::GetOrientation() const + { + return _orientation; + } + + + void LanePositionImpl::SetLaneId(const std::string laneId) + { + _laneId = laneId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID); + _isSetLaneId = true; + } + + void LanePositionImpl::SetOffset(const double offset) + { + _offset = offset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET); + _isSetOffset = true; + } + + void LanePositionImpl::SetRoadId(const std::string roadId) + { + _roadId = roadId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + _isSetRoadId = true; + } + + void LanePositionImpl::SetS(const double s) + { + _s = s; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S); + _isSetS = true; + } + + void LanePositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr LanePositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LanePositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILanePosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILanePositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LanePositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LanePositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LanePositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LanePositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + return GetOffset(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__S) + { + return GetS(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LanePositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LanePositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LanePositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LanePositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LanePositionImpl::GetModelType() const + { + return "LanePosition"; + } + + void LanePositionImpl::WriteParameterToLaneId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, parameterName, nullTextMarker /*no textmarker*/); + _laneId = {}; + } + + void LanePositionImpl::WriteParameterToOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _offset = {}; + } + + void LanePositionImpl::WriteParameterToRoadId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, parameterName, nullTextMarker /*no textmarker*/); + _roadId = {}; + } + + void LanePositionImpl::WriteParameterToS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, parameterName, nullTextMarker /*no textmarker*/); + _s = {}; + } + + std::string LanePositionImpl::GetParameterFromLaneId() const + { + auto laneId = OSC_CONSTANTS::ATTRIBUTE__LANE_ID; + return GetParameterNameFromAttribute(laneId); + } + + std::string LanePositionImpl::GetParameterFromOffset() const + { + auto offset = OSC_CONSTANTS::ATTRIBUTE__OFFSET; + return GetParameterNameFromAttribute(offset); + } + + std::string LanePositionImpl::GetParameterFromRoadId() const + { + auto roadId = OSC_CONSTANTS::ATTRIBUTE__ROAD_ID; + return GetParameterNameFromAttribute(roadId); + } + + std::string LanePositionImpl::GetParameterFromS() const + { + auto s = OSC_CONSTANTS::ATTRIBUTE__S; + return GetParameterNameFromAttribute(s); + } + + bool LanePositionImpl::IsLaneIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LANE_ID); + if (kIt != keys.end()) + return true; + return false; + } + + bool LanePositionImpl::IsOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + bool LanePositionImpl::IsRoadIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + if (kIt != keys.end()) + return true; + return false; + } + + bool LanePositionImpl::IsSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__S); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LanePositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + LanePositionImpl::LanePositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OFFSET, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__S, SimpleType::DOUBLE); + } + + void LanePositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + // Simple type + _laneId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLaneId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetS = true; + } + } + + SimpleType LanePositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LanePositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LanePositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_laneId = GetLaneId(); + // Simple type + clonedObject->_offset = GetOffset(); + // Simple type + clonedObject->_roadId = GetRoadId(); + // Simple type + clonedObject->_s = GetS(); + // clone indicators + clonedObject->_isSetOffset = _isSetOffset; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string LanePositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + return GetLaneId(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + return GetRoadId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr LanePositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> LanePositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LanePositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LanePositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LanePositionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + // Simple type + _laneId = value; + AddResolvedParameter(attributeKey); + _isSetLaneId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = value; + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + + } + void LanePositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = value; + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = value; + AddResolvedParameter(attributeKey); + _isSetS = true; + } + + } + + + bool LanePositionImpl::IsSetLaneId() const + { + return _isSetLaneId; + } + void LanePositionImpl::ResetOffset() + { + _isSetOffset = false; + _offset = {0}; + + } + bool LanePositionImpl::IsSetOffset() const + { + return _isSetOffset; + } + bool LanePositionImpl::IsSetRoadId() const + { + return _isSetRoadId; + } + bool LanePositionImpl::IsSetS() const + { + return _isSetS; + } + void LanePositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool LanePositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* LateralActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr LateralActionImpl::GetLaneChangeAction() const + { + return _laneChangeAction; + } + std::shared_ptr LateralActionImpl::GetLaneOffsetAction() const + { + return _laneOffsetAction; + } + std::shared_ptr LateralActionImpl::GetLateralDistanceAction() const + { + return _lateralDistanceAction; + } + + + void LateralActionImpl::SetLaneChangeAction(std::shared_ptr laneChangeAction) + { + _laneChangeAction = laneChangeAction; + _laneOffsetAction = {}; + _lateralDistanceAction = {}; + _isSetLaneChangeAction = true; + } + + void LateralActionImpl::SetLaneOffsetAction(std::shared_ptr laneOffsetAction) + { + _laneOffsetAction = laneOffsetAction; + _laneChangeAction = {}; + _lateralDistanceAction = {}; + _isSetLaneOffsetAction = true; + } + + void LateralActionImpl::SetLateralDistanceAction(std::shared_ptr lateralDistanceAction) + { + _lateralDistanceAction = lateralDistanceAction; + _laneChangeAction = {}; + _laneOffsetAction = {}; + _isSetLateralDistanceAction = true; + } + + std::shared_ptr LateralActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LateralActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILateralAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILateralActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LateralActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LateralActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LateralActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LateralActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LateralActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LateralActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LateralActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LateralActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LateralActionImpl::GetModelType() const + { + return "LateralAction"; + } + + // children + std::shared_ptr LateralActionImpl::GetWriterLaneChangeAction() const + { + return std::dynamic_pointer_cast(_laneChangeAction); + } + std::shared_ptr LateralActionImpl::GetWriterLaneOffsetAction() const + { + return std::dynamic_pointer_cast(_laneOffsetAction); + } + std::shared_ptr LateralActionImpl::GetWriterLateralDistanceAction() const + { + return std::dynamic_pointer_cast(_lateralDistanceAction); + } + + LateralActionImpl::LateralActionImpl() + { + /** + * Filling the property to type map + */ + } + + void LateralActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType LateralActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LateralActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLaneChangeAction = GetWriterLaneChangeAction(); + if (kLaneChangeAction) + { + result.push_back(std::dynamic_pointer_cast(kLaneChangeAction)); + } + const auto kLaneOffsetAction = GetWriterLaneOffsetAction(); + if (kLaneOffsetAction) + { + result.push_back(std::dynamic_pointer_cast(kLaneOffsetAction)); + } + const auto kLateralDistanceAction = GetWriterLateralDistanceAction(); + if (kLateralDistanceAction) + { + result.push_back(std::dynamic_pointer_cast(kLateralDistanceAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LateralActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kLaneChangeAction = GetWriterLaneChangeAction(); + if (kLaneChangeAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneChangeAction)->Clone(); + auto clonedChildILaneChangeAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneChangeAction(std::dynamic_pointer_cast(clonedChildILaneChangeAction)); + } + const auto kLaneOffsetAction = GetWriterLaneOffsetAction(); + if (kLaneOffsetAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLaneOffsetAction)->Clone(); + auto clonedChildILaneOffsetAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLaneOffsetAction(std::dynamic_pointer_cast(clonedChildILaneOffsetAction)); + } + const auto kLateralDistanceAction = GetWriterLateralDistanceAction(); + if (kLateralDistanceAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLateralDistanceAction)->Clone(); + auto clonedChildILateralDistanceAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLateralDistanceAction(std::dynamic_pointer_cast(clonedChildILateralDistanceAction)); + } + return clonedObject; + } + + std::string LateralActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LateralActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION) + { + return std::dynamic_pointer_cast(GetLaneChangeAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION) + { + return std::dynamic_pointer_cast(GetLaneOffsetAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION) + { + return std::dynamic_pointer_cast(GetLateralDistanceAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> LateralActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LateralActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LateralActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool LateralActionImpl::IsSetLaneChangeAction() const + { + return _isSetLaneChangeAction; + } + bool LateralActionImpl::IsSetLaneOffsetAction() const + { + return _isSetLaneOffsetAction; + } + bool LateralActionImpl::IsSetLateralDistanceAction() const + { + return _isSetLateralDistanceAction; + } + + IOpenScenarioFlexElement* LateralDistanceActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool LateralDistanceActionImpl::GetContinuous() const + { + return _continuous; + } + CoordinateSystem LateralDistanceActionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + LateralDisplacement LateralDistanceActionImpl::GetDisplacement() const + { + return _displacement; + } + double LateralDistanceActionImpl::GetDistance() const + { + return _distance; + } + std::shared_ptr> LateralDistanceActionImpl::GetEntityRef() const + { + return _entityRef; + } + bool LateralDistanceActionImpl::GetFreespace() const + { + return _freespace; + } + std::shared_ptr LateralDistanceActionImpl::GetDynamicConstraints() const + { + return _dynamicConstraints; + } + + + void LateralDistanceActionImpl::SetContinuous(const bool continuous) + { + _continuous = continuous; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + _isSetContinuous = true; + } + + void LateralDistanceActionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void LateralDistanceActionImpl::SetDisplacement(const LateralDisplacement displacement) + { + _displacement = displacement; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT); + _isSetDisplacement = true; + } + + void LateralDistanceActionImpl::SetDistance(const double distance) + { + _distance = distance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + _isSetDistance = true; + } + + void LateralDistanceActionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void LateralDistanceActionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void LateralDistanceActionImpl::SetDynamicConstraints(std::shared_ptr dynamicConstraints) + { + _dynamicConstraints = dynamicConstraints; + _isSetDynamicConstraints = true; + } + + std::shared_ptr LateralDistanceActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LateralDistanceActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILateralDistanceAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILateralDistanceActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LateralDistanceActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LateralDistanceActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LateralDistanceActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LateralDistanceActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + return GetDistance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LateralDistanceActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LateralDistanceActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + return GetContinuous(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime LateralDistanceActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LateralDistanceActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LateralDistanceActionImpl::GetModelType() const + { + return "LateralDistanceAction"; + } + + void LateralDistanceActionImpl::WriteParameterToContinuous(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, parameterName, nullTextMarker /*no textmarker*/); + _continuous = {}; + } + + void LateralDistanceActionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void LateralDistanceActionImpl::WriteParameterToDisplacement(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, parameterName, nullTextMarker /*no textmarker*/); + _displacement = {}; + } + + void LateralDistanceActionImpl::WriteParameterToDistance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, parameterName, nullTextMarker /*no textmarker*/); + _distance = {}; + } + + void LateralDistanceActionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void LateralDistanceActionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + std::string LateralDistanceActionImpl::GetParameterFromContinuous() const + { + auto continuous = OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS; + return GetParameterNameFromAttribute(continuous); + } + + std::string LateralDistanceActionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string LateralDistanceActionImpl::GetParameterFromDisplacement() const + { + auto displacement = OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT; + return GetParameterNameFromAttribute(displacement); + } + + std::string LateralDistanceActionImpl::GetParameterFromDistance() const + { + auto distance = OSC_CONSTANTS::ATTRIBUTE__DISTANCE; + return GetParameterNameFromAttribute(distance); + } + + std::string LateralDistanceActionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string LateralDistanceActionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + bool LateralDistanceActionImpl::IsContinuousParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool LateralDistanceActionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool LateralDistanceActionImpl::IsDisplacementParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT); + if (kIt != keys.end()) + return true; + return false; + } + + bool LateralDistanceActionImpl::IsDistanceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LateralDistanceActionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool LateralDistanceActionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LateralDistanceActionImpl::GetWriterDynamicConstraints() const + { + return std::dynamic_pointer_cast(_dynamicConstraints); + } + + LateralDistanceActionImpl::LateralDistanceActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + } + + void LateralDistanceActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT) + { + // Enumeration Type + const auto kResult = LateralDisplacement::GetFromLiteral(parameterLiteralValue); + if (kResult != LateralDisplacement::UNKNOWN) + { + _displacement = kResult; + AddResolvedParameter(attributeKey); + _isSetDisplacement = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + } + + SimpleType LateralDistanceActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LateralDistanceActionImpl::GetChildren() const + { + std::vector> result; + + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + result.push_back(std::dynamic_pointer_cast(kDynamicConstraints)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LateralDistanceActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_continuous = GetContinuous(); + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Enumeration Type + const auto kDisplacement = GetDisplacement(); + if ( kDisplacement.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_displacement = LateralDisplacement::GetFromLiteral(kDisplacement.GetLiteral()); + } + // Simple type + clonedObject->_distance = GetDistance(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_freespace = GetFreespace(); + // clone indicators + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetDisplacement = _isSetDisplacement; + clonedObject->_isSetDistance = _isSetDistance; + // clone children + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + auto clonedChild = std::dynamic_pointer_cast(kDynamicConstraints)->Clone(); + auto clonedChildIDynamicConstraints = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDynamicConstraints(std::dynamic_pointer_cast(clonedChildIDynamicConstraints)); + } + return clonedObject; + } + + std::string LateralDistanceActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr LateralDistanceActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS) + { + return std::dynamic_pointer_cast(GetDynamicConstraints()); + } + throw KeyNotSupportedException(); + } + + std::vector> LateralDistanceActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LateralDistanceActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string LateralDistanceActionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT) + { + auto displacement = GetDisplacement(); + return displacement.GetLiteral() != "UNKNOWN" ? displacement.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void LateralDistanceActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = value; + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void LateralDistanceActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = value; + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + + } + + + bool LateralDistanceActionImpl::IsSetContinuous() const + { + return _isSetContinuous; + } + void LateralDistanceActionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool LateralDistanceActionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + void LateralDistanceActionImpl::ResetDisplacement() + { + _isSetDisplacement = false; + _displacement = {LateralDisplacement::LateralDisplacementEnum::ANY}; + + } + bool LateralDistanceActionImpl::IsSetDisplacement() const + { + return _isSetDisplacement; + } + void LateralDistanceActionImpl::ResetDistance() + { + _isSetDistance = false; + _distance = {0}; + + } + bool LateralDistanceActionImpl::IsSetDistance() const + { + return _isSetDistance; + } + bool LateralDistanceActionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool LateralDistanceActionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + void LateralDistanceActionImpl::ResetDynamicConstraints() + { + _isSetDynamicConstraints = false; + _dynamicConstraints = {}; + + } + bool LateralDistanceActionImpl::IsSetDynamicConstraints() const + { + return _isSetDynamicConstraints; + } + + IOpenScenarioFlexElement* LicenseImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string LicenseImpl::GetText() const + { + return _text; + } + std::string LicenseImpl::GetName() const + { + return _name; + } + std::string LicenseImpl::GetResource() const + { + return _resource; + } + std::string LicenseImpl::GetSpdxId() const + { + return _spdxId; + } + + + void LicenseImpl::SetText(const std::string text) + { + _text = text; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEXT); + _isSetText = true; + } + + void LicenseImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void LicenseImpl::SetResource(const std::string resource) + { + _resource = resource; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RESOURCE); + _isSetResource = true; + } + + void LicenseImpl::SetSpdxId(const std::string spdxId) + { + _spdxId = spdxId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID); + _isSetSpdxId = true; + } + + std::shared_ptr LicenseImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LicenseImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILicense).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILicenseWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LicenseImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LicenseImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LicenseImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LicenseImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LicenseImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LicenseImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LicenseImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LicenseImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LicenseImpl::GetModelType() const + { + return "License"; + } + + void LicenseImpl::WriteParameterToText(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEXT, parameterName, nullTextMarker /*no textmarker*/); + _text = {}; + } + + void LicenseImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void LicenseImpl::WriteParameterToResource(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, parameterName, nullTextMarker /*no textmarker*/); + _resource = {}; + } + + void LicenseImpl::WriteParameterToSpdxId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, parameterName, nullTextMarker /*no textmarker*/); + _spdxId = {}; + } + + std::string LicenseImpl::GetParameterFromText() const + { + auto text = OSC_CONSTANTS::ATTRIBUTE__TEXT; + return GetParameterNameFromAttribute(text); + } + + std::string LicenseImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string LicenseImpl::GetParameterFromResource() const + { + auto resource = OSC_CONSTANTS::ATTRIBUTE__RESOURCE; + return GetParameterNameFromAttribute(resource); + } + + std::string LicenseImpl::GetParameterFromSpdxId() const + { + auto spdxId = OSC_CONSTANTS::ATTRIBUTE__SPDX_ID; + return GetParameterNameFromAttribute(spdxId); + } + + bool LicenseImpl::IsTextParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TEXT); + if (kIt != keys.end()) + return true; + return false; + } + + bool LicenseImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool LicenseImpl::IsResourceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RESOURCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LicenseImpl::IsSpdxIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPDX_ID); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + LicenseImpl::LicenseImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TEXT, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, SimpleType::STRING); + } + + void LicenseImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TEXT) + { + // Simple type + _text = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetText = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RESOURCE) + { + // Simple type + _resource = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetResource = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPDX_ID) + { + // Simple type + _spdxId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSpdxId = true; + } + } + + SimpleType LicenseImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LicenseImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LicenseImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_resource = GetResource(); + // Simple type + clonedObject->_spdxId = GetSpdxId(); + // clone indicators + clonedObject->_isSetResource = _isSetResource; + clonedObject->_isSetSpdxId = _isSetSpdxId; + // clone children + return clonedObject; + } + + std::string LicenseImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TEXT) + { + return GetText(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__RESOURCE) + { + return GetResource(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__SPDX_ID) + { + return GetSpdxId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr LicenseImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> LicenseImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LicenseImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LicenseImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LicenseImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TEXT) + { + // Simple type + _text = value; + AddResolvedParameter(attributeKey); + _isSetText = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RESOURCE) + { + // Simple type + _resource = value; + AddResolvedParameter(attributeKey); + _isSetResource = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPDX_ID) + { + // Simple type + _spdxId = value; + AddResolvedParameter(attributeKey); + _isSetSpdxId = true; + } + + } + + + void LicenseImpl::ResetText() + { + _isSetText = false; + _text = {}; + + } + bool LicenseImpl::IsSetText() const + { + return _isSetText; + } + bool LicenseImpl::IsSetName() const + { + return _isSetName; + } + void LicenseImpl::ResetResource() + { + _isSetResource = false; + _resource = {}; + + } + bool LicenseImpl::IsSetResource() const + { + return _isSetResource; + } + void LicenseImpl::ResetSpdxId() + { + _isSetSpdxId = false; + _spdxId = {}; + + } + bool LicenseImpl::IsSetSpdxId() const + { + return _isSetSpdxId; + } + + IOpenScenarioFlexElement* LightStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + double LightStateImpl::GetFlashingOffDuration() const + { + return _flashingOffDuration; + } + double LightStateImpl::GetFlashingOnDuration() const + { + return _flashingOnDuration; + } + double LightStateImpl::GetLuminousIntensity() const + { + return _luminousIntensity; + } + LightMode LightStateImpl::GetMode() const + { + return _mode; + } + std::shared_ptr LightStateImpl::GetColor() const + { + return _color; + } + + + void LightStateImpl::SetFlashingOffDuration(const double flashingOffDuration) + { + _flashingOffDuration = flashingOffDuration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION); + _isSetFlashingOffDuration = true; + } + + void LightStateImpl::SetFlashingOnDuration(const double flashingOnDuration) + { + _flashingOnDuration = flashingOnDuration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION); + _isSetFlashingOnDuration = true; + } + + void LightStateImpl::SetLuminousIntensity(const double luminousIntensity) + { + _luminousIntensity = luminousIntensity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY); + _isSetLuminousIntensity = true; + } + + void LightStateImpl::SetMode(const LightMode mode) + { + _mode = mode; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODE); + _isSetMode = true; + } + + void LightStateImpl::SetColor(std::shared_ptr color) + { + _color = color; + _isSetColor = true; + } + + std::shared_ptr LightStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LightStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILightState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILightStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LightStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LightStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LightStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LightStateImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION) + { + return GetFlashingOffDuration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION) + { + return GetFlashingOnDuration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY) + { + return GetLuminousIntensity(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LightStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LightStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LightStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LightStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LightStateImpl::GetModelType() const + { + return "LightState"; + } + + void LightStateImpl::WriteParameterToFlashingOffDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, parameterName, nullTextMarker /*no textmarker*/); + _flashingOffDuration = {}; + } + + void LightStateImpl::WriteParameterToFlashingOnDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, parameterName, nullTextMarker /*no textmarker*/); + _flashingOnDuration = {}; + } + + void LightStateImpl::WriteParameterToLuminousIntensity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, parameterName, nullTextMarker /*no textmarker*/); + _luminousIntensity = {}; + } + + void LightStateImpl::WriteParameterToMode(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODE, parameterName, nullTextMarker /*no textmarker*/); + _mode = {}; + } + + std::string LightStateImpl::GetParameterFromFlashingOffDuration() const + { + auto flashingOffDuration = OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION; + return GetParameterNameFromAttribute(flashingOffDuration); + } + + std::string LightStateImpl::GetParameterFromFlashingOnDuration() const + { + auto flashingOnDuration = OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION; + return GetParameterNameFromAttribute(flashingOnDuration); + } + + std::string LightStateImpl::GetParameterFromLuminousIntensity() const + { + auto luminousIntensity = OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY; + return GetParameterNameFromAttribute(luminousIntensity); + } + + std::string LightStateImpl::GetParameterFromMode() const + { + auto mode = OSC_CONSTANTS::ATTRIBUTE__MODE; + return GetParameterNameFromAttribute(mode); + } + + bool LightStateImpl::IsFlashingOffDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool LightStateImpl::IsFlashingOnDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool LightStateImpl::IsLuminousIntensityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY); + if (kIt != keys.end()) + return true; + return false; + } + + bool LightStateImpl::IsModeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MODE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LightStateImpl::GetWriterColor() const + { + return std::dynamic_pointer_cast(_color); + } + + LightStateImpl::LightStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MODE, SimpleType::ENUM_TYPE); + } + + void LightStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION) + { + // Simple type + _flashingOffDuration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFlashingOffDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION) + { + // Simple type + _flashingOnDuration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFlashingOnDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY) + { + // Simple type + _luminousIntensity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLuminousIntensity = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODE) + { + // Enumeration Type + const auto kResult = LightMode::GetFromLiteral(parameterLiteralValue); + if (kResult != LightMode::UNKNOWN) + { + _mode = kResult; + AddResolvedParameter(attributeKey); + _isSetMode = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType LightStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LightStateImpl::GetChildren() const + { + std::vector> result; + + const auto kColor = GetWriterColor(); + if (kColor) + { + result.push_back(std::dynamic_pointer_cast(kColor)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LightStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_flashingOffDuration = GetFlashingOffDuration(); + // Simple type + clonedObject->_flashingOnDuration = GetFlashingOnDuration(); + // Simple type + clonedObject->_luminousIntensity = GetLuminousIntensity(); + // Enumeration Type + const auto kMode = GetMode(); + if ( kMode.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_mode = LightMode::GetFromLiteral(kMode.GetLiteral()); + } + // clone indicators + clonedObject->_isSetFlashingOffDuration = _isSetFlashingOffDuration; + clonedObject->_isSetFlashingOnDuration = _isSetFlashingOnDuration; + clonedObject->_isSetLuminousIntensity = _isSetLuminousIntensity; + // clone children + const auto kColor = GetWriterColor(); + if (kColor) + { + auto clonedChild = std::dynamic_pointer_cast(kColor)->Clone(); + auto clonedChildIColor = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetColor(std::dynamic_pointer_cast(clonedChildIColor)); + } + return clonedObject; + } + + std::string LightStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LightStateImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__COLOR) + { + return std::dynamic_pointer_cast(GetColor()); + } + throw KeyNotSupportedException(); + } + + std::vector> LightStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LightStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LightStateImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MODE) + { + auto mode = GetMode(); + return mode.GetLiteral() != "UNKNOWN" ? mode.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void LightStateImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION) + { + // Simple type + _flashingOffDuration = value; + AddResolvedParameter(attributeKey); + _isSetFlashingOffDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION) + { + // Simple type + _flashingOnDuration = value; + AddResolvedParameter(attributeKey); + _isSetFlashingOnDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY) + { + // Simple type + _luminousIntensity = value; + AddResolvedParameter(attributeKey); + _isSetLuminousIntensity = true; + } + + } + + + void LightStateImpl::ResetFlashingOffDuration() + { + _isSetFlashingOffDuration = false; + _flashingOffDuration = {0.5}; + + } + bool LightStateImpl::IsSetFlashingOffDuration() const + { + return _isSetFlashingOffDuration; + } + void LightStateImpl::ResetFlashingOnDuration() + { + _isSetFlashingOnDuration = false; + _flashingOnDuration = {0.5}; + + } + bool LightStateImpl::IsSetFlashingOnDuration() const + { + return _isSetFlashingOnDuration; + } + void LightStateImpl::ResetLuminousIntensity() + { + _isSetLuminousIntensity = false; + _luminousIntensity = {}; + + } + bool LightStateImpl::IsSetLuminousIntensity() const + { + return _isSetLuminousIntensity; + } + bool LightStateImpl::IsSetMode() const + { + return _isSetMode; + } + void LightStateImpl::ResetColor() + { + _isSetColor = false; + _color = {}; + + } + bool LightStateImpl::IsSetColor() const + { + return _isSetColor; + } + + IOpenScenarioFlexElement* LightStateActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double LightStateActionImpl::GetTransitionTime() const + { + return _transitionTime; + } + std::shared_ptr LightStateActionImpl::GetLightType() const + { + return _lightType; + } + std::shared_ptr LightStateActionImpl::GetLightState() const + { + return _lightState; + } + + + void LightStateActionImpl::SetTransitionTime(const double transitionTime) + { + _transitionTime = transitionTime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME); + _isSetTransitionTime = true; + } + + void LightStateActionImpl::SetLightType(std::shared_ptr lightType) + { + _lightType = lightType; + _isSetLightType = true; + } + + void LightStateActionImpl::SetLightState(std::shared_ptr lightState) + { + _lightState = lightState; + _isSetLightState = true; + } + + std::shared_ptr LightStateActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LightStateActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILightStateAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILightStateActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LightStateActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LightStateActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LightStateActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LightStateActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME) + { + return GetTransitionTime(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LightStateActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LightStateActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LightStateActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LightStateActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LightStateActionImpl::GetModelType() const + { + return "LightStateAction"; + } + + void LightStateActionImpl::WriteParameterToTransitionTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, parameterName, nullTextMarker /*no textmarker*/); + _transitionTime = {}; + } + + std::string LightStateActionImpl::GetParameterFromTransitionTime() const + { + auto transitionTime = OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME; + return GetParameterNameFromAttribute(transitionTime); + } + + bool LightStateActionImpl::IsTransitionTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LightStateActionImpl::GetWriterLightType() const + { + return std::dynamic_pointer_cast(_lightType); + } + std::shared_ptr LightStateActionImpl::GetWriterLightState() const + { + return std::dynamic_pointer_cast(_lightState); + } + + LightStateActionImpl::LightStateActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, SimpleType::DOUBLE); + } + + void LightStateActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME) + { + // Simple type + _transitionTime = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTransitionTime = true; + } + } + + SimpleType LightStateActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LightStateActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLightType = GetWriterLightType(); + if (kLightType) + { + result.push_back(std::dynamic_pointer_cast(kLightType)); + } + const auto kLightState = GetWriterLightState(); + if (kLightState) + { + result.push_back(std::dynamic_pointer_cast(kLightState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LightStateActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_transitionTime = GetTransitionTime(); + // clone indicators + clonedObject->_isSetTransitionTime = _isSetTransitionTime; + // clone children + const auto kLightType = GetWriterLightType(); + if (kLightType) + { + auto clonedChild = std::dynamic_pointer_cast(kLightType)->Clone(); + auto clonedChildILightType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLightType(std::dynamic_pointer_cast(clonedChildILightType)); + } + const auto kLightState = GetWriterLightState(); + if (kLightState) + { + auto clonedChild = std::dynamic_pointer_cast(kLightState)->Clone(); + auto clonedChildILightState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLightState(std::dynamic_pointer_cast(clonedChildILightState)); + } + return clonedObject; + } + + std::string LightStateActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LightStateActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LIGHT_TYPE) + { + return std::dynamic_pointer_cast(GetLightType()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LIGHT_STATE) + { + return std::dynamic_pointer_cast(GetLightState()); + } + throw KeyNotSupportedException(); + } + + std::vector> LightStateActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LightStateActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LightStateActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LightStateActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME) + { + // Simple type + _transitionTime = value; + AddResolvedParameter(attributeKey); + _isSetTransitionTime = true; + } + + } + + + void LightStateActionImpl::ResetTransitionTime() + { + _isSetTransitionTime = false; + _transitionTime = {0}; + + } + bool LightStateActionImpl::IsSetTransitionTime() const + { + return _isSetTransitionTime; + } + bool LightStateActionImpl::IsSetLightType() const + { + return _isSetLightType; + } + bool LightStateActionImpl::IsSetLightState() const + { + return _isSetLightState; + } + + IOpenScenarioFlexElement* LightTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr LightTypeImpl::GetVehicleLight() const + { + return _vehicleLight; + } + std::shared_ptr LightTypeImpl::GetUserDefinedLight() const + { + return _userDefinedLight; + } + + + void LightTypeImpl::SetVehicleLight(std::shared_ptr vehicleLight) + { + _vehicleLight = vehicleLight; + _userDefinedLight = {}; + _isSetVehicleLight = true; + } + + void LightTypeImpl::SetUserDefinedLight(std::shared_ptr userDefinedLight) + { + _userDefinedLight = userDefinedLight; + _vehicleLight = {}; + _isSetUserDefinedLight = true; + } + + std::shared_ptr LightTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LightTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILightType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILightTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LightTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LightTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LightTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LightTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LightTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LightTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LightTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LightTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LightTypeImpl::GetModelType() const + { + return "LightType"; + } + + // children + std::shared_ptr LightTypeImpl::GetWriterVehicleLight() const + { + return std::dynamic_pointer_cast(_vehicleLight); + } + std::shared_ptr LightTypeImpl::GetWriterUserDefinedLight() const + { + return std::dynamic_pointer_cast(_userDefinedLight); + } + + LightTypeImpl::LightTypeImpl() + { + /** + * Filling the property to type map + */ + } + + void LightTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType LightTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LightTypeImpl::GetChildren() const + { + std::vector> result; + + const auto kVehicleLight = GetWriterVehicleLight(); + if (kVehicleLight) + { + result.push_back(std::dynamic_pointer_cast(kVehicleLight)); + } + const auto kUserDefinedLight = GetWriterUserDefinedLight(); + if (kUserDefinedLight) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedLight)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LightTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVehicleLight = GetWriterVehicleLight(); + if (kVehicleLight) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicleLight)->Clone(); + auto clonedChildIVehicleLight = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicleLight(std::dynamic_pointer_cast(clonedChildIVehicleLight)); + } + const auto kUserDefinedLight = GetWriterUserDefinedLight(); + if (kUserDefinedLight) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedLight)->Clone(); + auto clonedChildIUserDefinedLight = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedLight(std::dynamic_pointer_cast(clonedChildIUserDefinedLight)); + } + return clonedObject; + } + + std::string LightTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LightTypeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT) + { + return std::dynamic_pointer_cast(GetVehicleLight()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT) + { + return std::dynamic_pointer_cast(GetUserDefinedLight()); + } + throw KeyNotSupportedException(); + } + + std::vector> LightTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LightTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LightTypeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool LightTypeImpl::IsSetVehicleLight() const + { + return _isSetVehicleLight; + } + bool LightTypeImpl::IsSetUserDefinedLight() const + { + return _isSetUserDefinedLight; + } + + IOpenScenarioFlexElement* LogNormalDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double LogNormalDistributionImpl::GetExpectedValue() const + { + return _expectedValue; + } + double LogNormalDistributionImpl::GetVariance() const + { + return _variance; + } + std::shared_ptr LogNormalDistributionImpl::GetRange() const + { + return _range; + } + + + void LogNormalDistributionImpl::SetExpectedValue(const double expectedValue) + { + _expectedValue = expectedValue; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + _isSetExpectedValue = true; + } + + void LogNormalDistributionImpl::SetVariance(const double variance) + { + _variance = variance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE); + _isSetVariance = true; + } + + void LogNormalDistributionImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr LogNormalDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LogNormalDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILogNormalDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILogNormalDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LogNormalDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LogNormalDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LogNormalDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LogNormalDistributionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + return GetExpectedValue(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + return GetVariance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LogNormalDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LogNormalDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LogNormalDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LogNormalDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LogNormalDistributionImpl::GetModelType() const + { + return "LogNormalDistribution"; + } + + void LogNormalDistributionImpl::WriteParameterToExpectedValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, parameterName, nullTextMarker /*no textmarker*/); + _expectedValue = {}; + } + + void LogNormalDistributionImpl::WriteParameterToVariance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, parameterName, nullTextMarker /*no textmarker*/); + _variance = {}; + } + + std::string LogNormalDistributionImpl::GetParameterFromExpectedValue() const + { + auto expectedValue = OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE; + return GetParameterNameFromAttribute(expectedValue); + } + + std::string LogNormalDistributionImpl::GetParameterFromVariance() const + { + auto variance = OSC_CONSTANTS::ATTRIBUTE__VARIANCE; + return GetParameterNameFromAttribute(variance); + } + + bool LogNormalDistributionImpl::IsExpectedValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LogNormalDistributionImpl::IsVarianceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VARIANCE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LogNormalDistributionImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + LogNormalDistributionImpl::LogNormalDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, SimpleType::DOUBLE); + } + + void LogNormalDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + // Simple type + _variance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVariance = true; + } + } + + SimpleType LogNormalDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LogNormalDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LogNormalDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_expectedValue = GetExpectedValue(); + // Simple type + clonedObject->_variance = GetVariance(); + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string LogNormalDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LogNormalDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> LogNormalDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LogNormalDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LogNormalDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void LogNormalDistributionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = value; + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + // Simple type + _variance = value; + AddResolvedParameter(attributeKey); + _isSetVariance = true; + } + + } + + + bool LogNormalDistributionImpl::IsSetExpectedValue() const + { + return _isSetExpectedValue; + } + bool LogNormalDistributionImpl::IsSetVariance() const + { + return _isSetVariance; + } + void LogNormalDistributionImpl::ResetRange() + { + _isSetRange = false; + _range = {}; + + } + bool LogNormalDistributionImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* LongitudinalActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr LongitudinalActionImpl::GetSpeedAction() const + { + return _speedAction; + } + std::shared_ptr LongitudinalActionImpl::GetLongitudinalDistanceAction() const + { + return _longitudinalDistanceAction; + } + std::shared_ptr LongitudinalActionImpl::GetSpeedProfileAction() const + { + return _speedProfileAction; + } + + + void LongitudinalActionImpl::SetSpeedAction(std::shared_ptr speedAction) + { + _speedAction = speedAction; + _longitudinalDistanceAction = {}; + _speedProfileAction = {}; + _isSetSpeedAction = true; + } + + void LongitudinalActionImpl::SetLongitudinalDistanceAction(std::shared_ptr longitudinalDistanceAction) + { + _longitudinalDistanceAction = longitudinalDistanceAction; + _speedAction = {}; + _speedProfileAction = {}; + _isSetLongitudinalDistanceAction = true; + } + + void LongitudinalActionImpl::SetSpeedProfileAction(std::shared_ptr speedProfileAction) + { + _speedProfileAction = speedProfileAction; + _speedAction = {}; + _longitudinalDistanceAction = {}; + _isSetSpeedProfileAction = true; + } + + std::shared_ptr LongitudinalActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LongitudinalActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILongitudinalAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILongitudinalActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LongitudinalActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LongitudinalActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LongitudinalActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LongitudinalActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t LongitudinalActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LongitudinalActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime LongitudinalActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LongitudinalActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LongitudinalActionImpl::GetModelType() const + { + return "LongitudinalAction"; + } + + // children + std::shared_ptr LongitudinalActionImpl::GetWriterSpeedAction() const + { + return std::dynamic_pointer_cast(_speedAction); + } + std::shared_ptr LongitudinalActionImpl::GetWriterLongitudinalDistanceAction() const + { + return std::dynamic_pointer_cast(_longitudinalDistanceAction); + } + std::shared_ptr LongitudinalActionImpl::GetWriterSpeedProfileAction() const + { + return std::dynamic_pointer_cast(_speedProfileAction); + } + + LongitudinalActionImpl::LongitudinalActionImpl() + { + /** + * Filling the property to type map + */ + } + + void LongitudinalActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType LongitudinalActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LongitudinalActionImpl::GetChildren() const + { + std::vector> result; + + const auto kSpeedAction = GetWriterSpeedAction(); + if (kSpeedAction) + { + result.push_back(std::dynamic_pointer_cast(kSpeedAction)); + } + const auto kLongitudinalDistanceAction = GetWriterLongitudinalDistanceAction(); + if (kLongitudinalDistanceAction) + { + result.push_back(std::dynamic_pointer_cast(kLongitudinalDistanceAction)); + } + const auto kSpeedProfileAction = GetWriterSpeedProfileAction(); + if (kSpeedProfileAction) + { + result.push_back(std::dynamic_pointer_cast(kSpeedProfileAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LongitudinalActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kSpeedAction = GetWriterSpeedAction(); + if (kSpeedAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSpeedAction)->Clone(); + auto clonedChildISpeedAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSpeedAction(std::dynamic_pointer_cast(clonedChildISpeedAction)); + } + const auto kLongitudinalDistanceAction = GetWriterLongitudinalDistanceAction(); + if (kLongitudinalDistanceAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLongitudinalDistanceAction)->Clone(); + auto clonedChildILongitudinalDistanceAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLongitudinalDistanceAction(std::dynamic_pointer_cast(clonedChildILongitudinalDistanceAction)); + } + const auto kSpeedProfileAction = GetWriterSpeedProfileAction(); + if (kSpeedProfileAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSpeedProfileAction)->Clone(); + auto clonedChildISpeedProfileAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSpeedProfileAction(std::dynamic_pointer_cast(clonedChildISpeedProfileAction)); + } + return clonedObject; + } + + std::string LongitudinalActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr LongitudinalActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_ACTION) + { + return std::dynamic_pointer_cast(GetSpeedAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION) + { + return std::dynamic_pointer_cast(GetLongitudinalDistanceAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION) + { + return std::dynamic_pointer_cast(GetSpeedProfileAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> LongitudinalActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LongitudinalActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string LongitudinalActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool LongitudinalActionImpl::IsSetSpeedAction() const + { + return _isSetSpeedAction; + } + bool LongitudinalActionImpl::IsSetLongitudinalDistanceAction() const + { + return _isSetLongitudinalDistanceAction; + } + bool LongitudinalActionImpl::IsSetSpeedProfileAction() const + { + return _isSetSpeedProfileAction; + } + + IOpenScenarioFlexElement* LongitudinalDistanceActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool LongitudinalDistanceActionImpl::GetContinuous() const + { + return _continuous; + } + CoordinateSystem LongitudinalDistanceActionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + LongitudinalDisplacement LongitudinalDistanceActionImpl::GetDisplacement() const + { + return _displacement; + } + double LongitudinalDistanceActionImpl::GetDistance() const + { + return _distance; + } + std::shared_ptr> LongitudinalDistanceActionImpl::GetEntityRef() const + { + return _entityRef; + } + bool LongitudinalDistanceActionImpl::GetFreespace() const + { + return _freespace; + } + double LongitudinalDistanceActionImpl::GetTimeGap() const + { + return _timeGap; + } + std::shared_ptr LongitudinalDistanceActionImpl::GetDynamicConstraints() const + { + return _dynamicConstraints; + } + + + void LongitudinalDistanceActionImpl::SetContinuous(const bool continuous) + { + _continuous = continuous; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + _isSetContinuous = true; + } + + void LongitudinalDistanceActionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void LongitudinalDistanceActionImpl::SetDisplacement(const LongitudinalDisplacement displacement) + { + _displacement = displacement; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT); + _isSetDisplacement = true; + } + + void LongitudinalDistanceActionImpl::SetDistance(const double distance) + { + _distance = distance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + _isSetDistance = true; + } + + void LongitudinalDistanceActionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void LongitudinalDistanceActionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void LongitudinalDistanceActionImpl::SetTimeGap(const double timeGap) + { + _timeGap = timeGap; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP); + _isSetTimeGap = true; + } + + void LongitudinalDistanceActionImpl::SetDynamicConstraints(std::shared_ptr dynamicConstraints) + { + _dynamicConstraints = dynamicConstraints; + _isSetDynamicConstraints = true; + } + + std::shared_ptr LongitudinalDistanceActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(LongitudinalDistanceActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ILongitudinalDistanceAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ILongitudinalDistanceActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr LongitudinalDistanceActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t LongitudinalDistanceActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int LongitudinalDistanceActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double LongitudinalDistanceActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + return GetDistance(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME_GAP) + { + return GetTimeGap(); + } + throw KeyNotSupportedException(); + + } + + uint16_t LongitudinalDistanceActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool LongitudinalDistanceActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + return GetContinuous(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime LongitudinalDistanceActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr LongitudinalDistanceActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string LongitudinalDistanceActionImpl::GetModelType() const + { + return "LongitudinalDistanceAction"; + } + + void LongitudinalDistanceActionImpl::WriteParameterToContinuous(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, parameterName, nullTextMarker /*no textmarker*/); + _continuous = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToDisplacement(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, parameterName, nullTextMarker /*no textmarker*/); + _displacement = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToDistance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, parameterName, nullTextMarker /*no textmarker*/); + _distance = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + void LongitudinalDistanceActionImpl::WriteParameterToTimeGap(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, parameterName, nullTextMarker /*no textmarker*/); + _timeGap = {}; + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromContinuous() const + { + auto continuous = OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS; + return GetParameterNameFromAttribute(continuous); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromDisplacement() const + { + auto displacement = OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT; + return GetParameterNameFromAttribute(displacement); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromDistance() const + { + auto distance = OSC_CONSTANTS::ATTRIBUTE__DISTANCE; + return GetParameterNameFromAttribute(distance); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + std::string LongitudinalDistanceActionImpl::GetParameterFromTimeGap() const + { + auto timeGap = OSC_CONSTANTS::ATTRIBUTE__TIME_GAP; + return GetParameterNameFromAttribute(timeGap); + } + + bool LongitudinalDistanceActionImpl::IsContinuousParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsDisplacementParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsDistanceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool LongitudinalDistanceActionImpl::IsTimeGapParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME_GAP); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr LongitudinalDistanceActionImpl::GetWriterDynamicConstraints() const + { + return std::dynamic_pointer_cast(_dynamicConstraints); + } + + LongitudinalDistanceActionImpl::LongitudinalDistanceActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, SimpleType::DOUBLE); + } + + void LongitudinalDistanceActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT) + { + // Enumeration Type + const auto kResult = LongitudinalDisplacement::GetFromLiteral(parameterLiteralValue); + if (kResult != LongitudinalDisplacement::UNKNOWN) + { + _displacement = kResult; + AddResolvedParameter(attributeKey); + _isSetDisplacement = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_GAP) + { + // Simple type + _timeGap = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTimeGap = true; + } + } + + SimpleType LongitudinalDistanceActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> LongitudinalDistanceActionImpl::GetChildren() const + { + std::vector> result; + + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + result.push_back(std::dynamic_pointer_cast(kDynamicConstraints)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr LongitudinalDistanceActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_continuous = GetContinuous(); + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Enumeration Type + const auto kDisplacement = GetDisplacement(); + if ( kDisplacement.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_displacement = LongitudinalDisplacement::GetFromLiteral(kDisplacement.GetLiteral()); + } + // Simple type + clonedObject->_distance = GetDistance(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_freespace = GetFreespace(); + // Simple type + clonedObject->_timeGap = GetTimeGap(); + // clone indicators + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetDisplacement = _isSetDisplacement; + clonedObject->_isSetDistance = _isSetDistance; + clonedObject->_isSetTimeGap = _isSetTimeGap; + // clone children + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + auto clonedChild = std::dynamic_pointer_cast(kDynamicConstraints)->Clone(); + auto clonedChildIDynamicConstraints = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDynamicConstraints(std::dynamic_pointer_cast(clonedChildIDynamicConstraints)); + } + return clonedObject; + } + + std::string LongitudinalDistanceActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr LongitudinalDistanceActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS) + { + return std::dynamic_pointer_cast(GetDynamicConstraints()); + } + throw KeyNotSupportedException(); + } + + std::vector> LongitudinalDistanceActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr LongitudinalDistanceActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string LongitudinalDistanceActionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT) + { + auto displacement = GetDisplacement(); + return displacement.GetLiteral() != "UNKNOWN" ? displacement.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void LongitudinalDistanceActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = value; + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void LongitudinalDistanceActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = value; + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME_GAP) + { + // Simple type + _timeGap = value; + AddResolvedParameter(attributeKey); + _isSetTimeGap = true; + } + + } + + + bool LongitudinalDistanceActionImpl::IsSetContinuous() const + { + return _isSetContinuous; + } + void LongitudinalDistanceActionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool LongitudinalDistanceActionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + void LongitudinalDistanceActionImpl::ResetDisplacement() + { + _isSetDisplacement = false; + _displacement = {LongitudinalDisplacement::LongitudinalDisplacementEnum::TRAILING_REFERENCED_ENTITY}; + + } + bool LongitudinalDistanceActionImpl::IsSetDisplacement() const + { + return _isSetDisplacement; + } + void LongitudinalDistanceActionImpl::ResetDistance() + { + _isSetDistance = false; + _distance = {}; + + } + bool LongitudinalDistanceActionImpl::IsSetDistance() const + { + return _isSetDistance; + } + bool LongitudinalDistanceActionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool LongitudinalDistanceActionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + void LongitudinalDistanceActionImpl::ResetTimeGap() + { + _isSetTimeGap = false; + _timeGap = {}; + + } + bool LongitudinalDistanceActionImpl::IsSetTimeGap() const + { + return _isSetTimeGap; + } + void LongitudinalDistanceActionImpl::ResetDynamicConstraints() + { + _isSetDynamicConstraints = false; + _dynamicConstraints = {}; + + } + bool LongitudinalDistanceActionImpl::IsSetDynamicConstraints() const + { + return _isSetDynamicConstraints; + } + + IOpenScenarioFlexElement* ManeuverImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ManeuverImpl::GetName() const + { + return _name; + } + std::vector> ManeuverImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> ManeuverImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int ManeuverImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr ManeuverImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::vector> ManeuverImpl::GetEvents() const + { + std::vector> temp; + for(auto&& elm: _events) + temp.push_back(elm); + return temp; + } + std::vector> ManeuverImpl::GetWriterEvents() const + { + return _events; + } + + int ManeuverImpl::GetEventsSize() const + { + return static_cast(_events.size()); + } + + std::shared_ptr ManeuverImpl::GetEventsAtIndex(unsigned int index) const + { + if (index >= 0 && _events.size() > index) + { + return _events[index]; + } + return nullptr; + } + + + void ManeuverImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ManeuverImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void ManeuverImpl::SetEvents(std::vector>& events) + { + _events = events; + _isSetEvents = true; + } + + std::shared_ptr ManeuverImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ManeuverImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IManeuver).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IManeuverWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ManeuverImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ManeuverImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ManeuverImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ManeuverImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ManeuverImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ManeuverImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ManeuverImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ManeuverImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ManeuverImpl::GetModelType() const + { + return "Maneuver"; + } + + void ManeuverImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ManeuverImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ManeuverImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ManeuverImpl::ManeuverImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ManeuverImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ManeuverImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool ManeuverImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> ManeuverImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ManeuverImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto events = GetWriterEvents(); + if (!events.empty()) + { + for(auto&& item : events) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ManeuverImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kEvents = GetWriterEvents(); + if (!kEvents.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEvents) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEvents(clonedList); + } + return clonedObject; + } + + std::string ManeuverImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ManeuverImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__EVENT) + { + std::vector> vect; + for (auto&& elem : GetEvents()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ManeuverImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ManeuverImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ManeuverImpl::IsSetName() const + { + return _isSetName; + } + void ManeuverImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool ManeuverImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool ManeuverImpl::IsSetEvents() const + { + return _isSetEvents; + } + + IOpenScenarioFlexElement* ManeuverCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ManeuverCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void ManeuverCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr ManeuverCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ManeuverCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IManeuverCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IManeuverCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ManeuverCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ManeuverCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ManeuverCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ManeuverCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ManeuverCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ManeuverCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ManeuverCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ManeuverCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ManeuverCatalogLocationImpl::GetModelType() const + { + return "ManeuverCatalogLocation"; + } + + // children + std::shared_ptr ManeuverCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + ManeuverCatalogLocationImpl::ManeuverCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void ManeuverCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ManeuverCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ManeuverCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ManeuverCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string ManeuverCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> ManeuverCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ManeuverCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ManeuverCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* ManeuverGroupImpl::GetOpenScenarioFlexElement() + { + return this; + } + uint32_t ManeuverGroupImpl::GetMaximumExecutionCount() const + { + return _maximumExecutionCount; + } + std::string ManeuverGroupImpl::GetName() const + { + return _name; + } + std::shared_ptr ManeuverGroupImpl::GetActors() const + { + return _actors; + } + std::vector> ManeuverGroupImpl::GetCatalogReferences() const + { + std::vector> temp; + for(auto&& elm: _catalogReferences) + temp.push_back(elm); + return temp; + } + std::vector> ManeuverGroupImpl::GetWriterCatalogReferences() const + { + return _catalogReferences; + } + + int ManeuverGroupImpl::GetCatalogReferencesSize() const + { + return static_cast(_catalogReferences.size()); + } + + std::shared_ptr ManeuverGroupImpl::GetCatalogReferencesAtIndex(unsigned int index) const + { + if (index >= 0 && _catalogReferences.size() > index) + { + return _catalogReferences[index]; + } + return nullptr; + } + std::vector> ManeuverGroupImpl::GetManeuvers() const + { + std::vector> temp; + for(auto&& elm: _maneuvers) + temp.push_back(elm); + return temp; + } + std::vector> ManeuverGroupImpl::GetWriterManeuvers() const + { + return _maneuvers; + } + + int ManeuverGroupImpl::GetManeuversSize() const + { + return static_cast(_maneuvers.size()); + } + + std::shared_ptr ManeuverGroupImpl::GetManeuversAtIndex(unsigned int index) const + { + if (index >= 0 && _maneuvers.size() > index) + { + return _maneuvers[index]; + } + return nullptr; + } + + + void ManeuverGroupImpl::SetMaximumExecutionCount(const uint32_t maximumExecutionCount) + { + _maximumExecutionCount = maximumExecutionCount; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + _isSetMaximumExecutionCount = true; + } + + void ManeuverGroupImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ManeuverGroupImpl::SetActors(std::shared_ptr actors) + { + _actors = actors; + _isSetActors = true; + } + + void ManeuverGroupImpl::SetCatalogReferences(std::vector>& catalogReferences) + { + _catalogReferences = catalogReferences; + _isSetCatalogReferences = true; + } + + void ManeuverGroupImpl::SetManeuvers(std::vector>& maneuvers) + { + _maneuvers = maneuvers; + _isSetManeuvers = true; + } + + std::shared_ptr ManeuverGroupImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ManeuverGroupImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IManeuverGroup).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IManeuverGroupWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ManeuverGroupImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ManeuverGroupImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + return GetMaximumExecutionCount(); + } + throw KeyNotSupportedException(); + + } + + int ManeuverGroupImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ManeuverGroupImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ManeuverGroupImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ManeuverGroupImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ManeuverGroupImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ManeuverGroupImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ManeuverGroupImpl::GetModelType() const + { + return "ManeuverGroup"; + } + + void ManeuverGroupImpl::WriteParameterToMaximumExecutionCount(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, parameterName, nullTextMarker /*no textmarker*/); + _maximumExecutionCount = {}; + } + + void ManeuverGroupImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ManeuverGroupImpl::GetParameterFromMaximumExecutionCount() const + { + auto maximumExecutionCount = OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT; + return GetParameterNameFromAttribute(maximumExecutionCount); + } + + std::string ManeuverGroupImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ManeuverGroupImpl::IsMaximumExecutionCountParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT); + if (kIt != keys.end()) + return true; + return false; + } + + bool ManeuverGroupImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ManeuverGroupImpl::GetWriterActors() const + { + return std::dynamic_pointer_cast(_actors); + } + + ManeuverGroupImpl::ManeuverGroupImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, SimpleType::UNSIGNED_INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ManeuverGroupImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + // Simple type + _maximumExecutionCount = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaximumExecutionCount = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ManeuverGroupImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ManeuverGroupImpl::GetChildren() const + { + std::vector> result; + + const auto kActors = GetWriterActors(); + if (kActors) + { + result.push_back(std::dynamic_pointer_cast(kActors)); + } + auto catalogReferences = GetWriterCatalogReferences(); + if (!catalogReferences.empty()) + { + for(auto&& item : catalogReferences) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto maneuvers = GetWriterManeuvers(); + if (!maneuvers.empty()) + { + for(auto&& item : maneuvers) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ManeuverGroupImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maximumExecutionCount = GetMaximumExecutionCount(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kActors = GetWriterActors(); + if (kActors) + { + auto clonedChild = std::dynamic_pointer_cast(kActors)->Clone(); + auto clonedChildIActors = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetActors(std::dynamic_pointer_cast(clonedChildIActors)); + } + const auto kCatalogReferences = GetWriterCatalogReferences(); + if (!kCatalogReferences.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kCatalogReferences) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetCatalogReferences(clonedList); + } + const auto kManeuvers = GetWriterManeuvers(); + if (!kManeuvers.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kManeuvers) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetManeuvers(clonedList); + } + return clonedObject; + } + + std::string ManeuverGroupImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverGroupImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACTORS) + { + return std::dynamic_pointer_cast(GetActors()); + } + throw KeyNotSupportedException(); + } + + std::vector> ManeuverGroupImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + std::vector> vect; + for (auto&& elem : GetCatalogReferences()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__MANEUVER) + { + std::vector> vect; + for (auto&& elem : GetManeuvers()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ManeuverGroupImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ManeuverGroupImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ManeuverGroupImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT) + { + // Simple type + _maximumExecutionCount = value; + AddResolvedParameter(attributeKey); + _isSetMaximumExecutionCount = true; + } + + } + void ManeuverGroupImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ManeuverGroupImpl::IsSetMaximumExecutionCount() const + { + return _isSetMaximumExecutionCount; + } + bool ManeuverGroupImpl::IsSetName() const + { + return _isSetName; + } + bool ManeuverGroupImpl::IsSetActors() const + { + return _isSetActors; + } + void ManeuverGroupImpl::ResetCatalogReferences() + { + _isSetCatalogReferences = false; + _catalogReferences = {}; + + } + bool ManeuverGroupImpl::IsSetCatalogReferences() const + { + return _isSetCatalogReferences; + } + void ManeuverGroupImpl::ResetManeuvers() + { + _isSetManeuvers = false; + _maneuvers = {}; + + } + bool ManeuverGroupImpl::IsSetManeuvers() const + { + return _isSetManeuvers; + } + + IOpenScenarioFlexElement* ManualGearImpl::GetOpenScenarioFlexElement() + { + return this; + } + int ManualGearImpl::GetNumber() const + { + return _number; + } + + + void ManualGearImpl::SetNumber(const int number) + { + _number = number; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER); + _isSetNumber = true; + } + + std::shared_ptr ManualGearImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ManualGearImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IManualGear).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IManualGearWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ManualGearImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ManualGearImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ManualGearImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + return GetNumber(); + } + throw KeyNotSupportedException(); + + } + + double ManualGearImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ManualGearImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ManualGearImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ManualGearImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ManualGearImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ManualGearImpl::GetModelType() const + { + return "ManualGear"; + } + + void ManualGearImpl::WriteParameterToNumber(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, parameterName, nullTextMarker /*no textmarker*/); + _number = {}; + } + + std::string ManualGearImpl::GetParameterFromNumber() const + { + auto number = OSC_CONSTANTS::ATTRIBUTE__NUMBER; + return GetParameterNameFromAttribute(number); + } + + bool ManualGearImpl::IsNumberParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NUMBER); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ManualGearImpl::ManualGearImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NUMBER, SimpleType::INT); + } + + void ManualGearImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + // Simple type + _number = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetNumber = true; + } + } + + SimpleType ManualGearImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ManualGearImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ManualGearImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_number = GetNumber(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ManualGearImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ManualGearImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ManualGearImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ManualGearImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ManualGearImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ManualGearImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + // Simple type + _number = value; + AddResolvedParameter(attributeKey); + _isSetNumber = true; + } + + } + + + bool ManualGearImpl::IsSetNumber() const + { + return _isSetNumber; + } + + IOpenScenarioFlexElement* MiscObjectImpl::GetOpenScenarioFlexElement() + { + return this; + } + double MiscObjectImpl::GetMass() const + { + return _mass; + } + MiscObjectCategory MiscObjectImpl::GetMiscObjectCategory() const + { + return _miscObjectCategory; + } + std::string MiscObjectImpl::GetModel3d() const + { + return _model3d; + } + std::string MiscObjectImpl::GetName() const + { + return _name; + } + std::vector> MiscObjectImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> MiscObjectImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int MiscObjectImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr MiscObjectImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr MiscObjectImpl::GetBoundingBox() const + { + return _boundingBox; + } + std::shared_ptr MiscObjectImpl::GetProperties() const + { + return _properties; + } + + + void MiscObjectImpl::SetMass(const double mass) + { + _mass = mass; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS); + _isSetMass = true; + } + + void MiscObjectImpl::SetMiscObjectCategory(const MiscObjectCategory miscObjectCategory) + { + _miscObjectCategory = miscObjectCategory; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY); + _isSetMiscObjectCategory = true; + } + + void MiscObjectImpl::SetModel3d(const std::string model3d) + { + _model3d = model3d; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + _isSetModel3d = true; + } + + void MiscObjectImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void MiscObjectImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void MiscObjectImpl::SetBoundingBox(std::shared_ptr boundingBox) + { + _boundingBox = boundingBox; + _isSetBoundingBox = true; + } + + void MiscObjectImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr MiscObjectImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(MiscObjectImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IMiscObject).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IMiscObjectWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr MiscObjectImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t MiscObjectImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int MiscObjectImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double MiscObjectImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + return GetMass(); + } + throw KeyNotSupportedException(); + + } + + uint16_t MiscObjectImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool MiscObjectImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime MiscObjectImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr MiscObjectImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string MiscObjectImpl::GetModelType() const + { + return "MiscObject"; + } + + void MiscObjectImpl::WriteParameterToMass(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, parameterName, nullTextMarker /*no textmarker*/); + _mass = {}; + } + + void MiscObjectImpl::WriteParameterToMiscObjectCategory(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, parameterName, nullTextMarker /*no textmarker*/); + _miscObjectCategory = {}; + } + + void MiscObjectImpl::WriteParameterToModel3d(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, parameterName, nullTextMarker /*no textmarker*/); + _model3d = {}; + } + + void MiscObjectImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string MiscObjectImpl::GetParameterFromMass() const + { + auto mass = OSC_CONSTANTS::ATTRIBUTE__MASS; + return GetParameterNameFromAttribute(mass); + } + + std::string MiscObjectImpl::GetParameterFromMiscObjectCategory() const + { + auto miscObjectCategory = OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY; + return GetParameterNameFromAttribute(miscObjectCategory); + } + + std::string MiscObjectImpl::GetParameterFromModel3d() const + { + auto model3d = OSC_CONSTANTS::ATTRIBUTE__MODEL3D; + return GetParameterNameFromAttribute(model3d); + } + + std::string MiscObjectImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool MiscObjectImpl::IsMassParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MASS); + if (kIt != keys.end()) + return true; + return false; + } + + bool MiscObjectImpl::IsMiscObjectCategoryParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY); + if (kIt != keys.end()) + return true; + return false; + } + + bool MiscObjectImpl::IsModel3dParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + if (kIt != keys.end()) + return true; + return false; + } + + bool MiscObjectImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr MiscObjectImpl::GetWriterBoundingBox() const + { + return std::dynamic_pointer_cast(_boundingBox); + } + std::shared_ptr MiscObjectImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + MiscObjectImpl::MiscObjectImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MASS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void MiscObjectImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY) + { + // Enumeration Type + const auto kResult = MiscObjectCategory::GetFromLiteral(parameterLiteralValue); + if (kResult != MiscObjectCategory::UNKNOWN) + { + _miscObjectCategory = kResult; + AddResolvedParameter(attributeKey); + _isSetMiscObjectCategory = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType MiscObjectImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool MiscObjectImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> MiscObjectImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> MiscObjectImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + result.push_back(std::dynamic_pointer_cast(kBoundingBox)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr MiscObjectImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_mass = GetMass(); + // Enumeration Type + const auto kMiscObjectCategory = GetMiscObjectCategory(); + if ( kMiscObjectCategory.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_miscObjectCategory = MiscObjectCategory::GetFromLiteral(kMiscObjectCategory.GetLiteral()); + } + // Simple type + clonedObject->_model3d = GetModel3d(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + clonedObject->_isSetModel3d = _isSetModel3d; + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + auto clonedChild = std::dynamic_pointer_cast(kBoundingBox)->Clone(); + auto clonedChildIBoundingBox = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBoundingBox(std::dynamic_pointer_cast(clonedChildIBoundingBox)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string MiscObjectImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + return GetModel3d(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr MiscObjectImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX) + { + return std::dynamic_pointer_cast(GetBoundingBox()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> MiscObjectImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr MiscObjectImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string MiscObjectImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY) + { + auto miscObjectCategory = GetMiscObjectCategory(); + return miscObjectCategory.GetLiteral() != "UNKNOWN" ? miscObjectCategory.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void MiscObjectImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = value; + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + void MiscObjectImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = value; + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + + } + + + bool MiscObjectImpl::IsSetMass() const + { + return _isSetMass; + } + bool MiscObjectImpl::IsSetMiscObjectCategory() const + { + return _isSetMiscObjectCategory; + } + void MiscObjectImpl::ResetModel3d() + { + _isSetModel3d = false; + _model3d = {}; + + } + bool MiscObjectImpl::IsSetModel3d() const + { + return _isSetModel3d; + } + bool MiscObjectImpl::IsSetName() const + { + return _isSetName; + } + void MiscObjectImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool MiscObjectImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool MiscObjectImpl::IsSetBoundingBox() const + { + return _isSetBoundingBox; + } + void MiscObjectImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool MiscObjectImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* MiscObjectCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr MiscObjectCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void MiscObjectCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr MiscObjectCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(MiscObjectCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IMiscObjectCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IMiscObjectCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr MiscObjectCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t MiscObjectCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int MiscObjectCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double MiscObjectCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t MiscObjectCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool MiscObjectCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime MiscObjectCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr MiscObjectCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string MiscObjectCatalogLocationImpl::GetModelType() const + { + return "MiscObjectCatalogLocation"; + } + + // children + std::shared_ptr MiscObjectCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + MiscObjectCatalogLocationImpl::MiscObjectCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void MiscObjectCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType MiscObjectCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> MiscObjectCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr MiscObjectCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string MiscObjectCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr MiscObjectCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> MiscObjectCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr MiscObjectCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string MiscObjectCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool MiscObjectCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* ModifyRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ModifyRuleImpl::GetAddValue() const + { + return _addValue; + } + std::shared_ptr ModifyRuleImpl::GetMultiplyByValue() const + { + return _multiplyByValue; + } + + + void ModifyRuleImpl::SetAddValue(std::shared_ptr addValue) + { + _addValue = addValue; + _multiplyByValue = {}; + _isSetAddValue = true; + } + + void ModifyRuleImpl::SetMultiplyByValue(std::shared_ptr multiplyByValue) + { + _multiplyByValue = multiplyByValue; + _addValue = {}; + _isSetMultiplyByValue = true; + } + + std::shared_ptr ModifyRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ModifyRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IModifyRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IModifyRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ModifyRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ModifyRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ModifyRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ModifyRuleImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ModifyRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ModifyRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ModifyRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ModifyRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ModifyRuleImpl::GetModelType() const + { + return "ModifyRule"; + } + + // children + std::shared_ptr ModifyRuleImpl::GetWriterAddValue() const + { + return std::dynamic_pointer_cast(_addValue); + } + std::shared_ptr ModifyRuleImpl::GetWriterMultiplyByValue() const + { + return std::dynamic_pointer_cast(_multiplyByValue); + } + + ModifyRuleImpl::ModifyRuleImpl() + { + /** + * Filling the property to type map + */ + } + + void ModifyRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ModifyRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ModifyRuleImpl::GetChildren() const + { + std::vector> result; + + const auto kAddValue = GetWriterAddValue(); + if (kAddValue) + { + result.push_back(std::dynamic_pointer_cast(kAddValue)); + } + const auto kMultiplyByValue = GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + result.push_back(std::dynamic_pointer_cast(kMultiplyByValue)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ModifyRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kAddValue = GetWriterAddValue(); + if (kAddValue) + { + auto clonedChild = std::dynamic_pointer_cast(kAddValue)->Clone(); + auto clonedChildIParameterAddValueRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAddValue(std::dynamic_pointer_cast(clonedChildIParameterAddValueRule)); + } + const auto kMultiplyByValue = GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + auto clonedChild = std::dynamic_pointer_cast(kMultiplyByValue)->Clone(); + auto clonedChildIParameterMultiplyByValueRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetMultiplyByValue(std::dynamic_pointer_cast(clonedChildIParameterMultiplyByValueRule)); + } + return clonedObject; + } + + std::string ModifyRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ModifyRuleImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ADD_VALUE) + { + return std::dynamic_pointer_cast(GetAddValue()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE) + { + return std::dynamic_pointer_cast(GetMultiplyByValue()); + } + throw KeyNotSupportedException(); + } + + std::vector> ModifyRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ModifyRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ModifyRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ModifyRuleImpl::IsSetAddValue() const + { + return _isSetAddValue; + } + bool ModifyRuleImpl::IsSetMultiplyByValue() const + { + return _isSetMultiplyByValue; + } + + IOpenScenarioFlexElement* MonitorDeclarationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string MonitorDeclarationImpl::GetName() const + { + return _name; + } + bool MonitorDeclarationImpl::GetValue() const + { + return _value; + } + + + void MonitorDeclarationImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void MonitorDeclarationImpl::SetValue(const bool value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr MonitorDeclarationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(MonitorDeclarationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IMonitorDeclaration).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IMonitorDeclarationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr MonitorDeclarationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t MonitorDeclarationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int MonitorDeclarationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double MonitorDeclarationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t MonitorDeclarationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool MonitorDeclarationImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + DateTime MonitorDeclarationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr MonitorDeclarationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string MonitorDeclarationImpl::GetModelType() const + { + return "MonitorDeclaration"; + } + + void MonitorDeclarationImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void MonitorDeclarationImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string MonitorDeclarationImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string MonitorDeclarationImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool MonitorDeclarationImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool MonitorDeclarationImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + MonitorDeclarationImpl::MonitorDeclarationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::BOOLEAN); + } + + void MonitorDeclarationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType MonitorDeclarationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> MonitorDeclarationImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr MonitorDeclarationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string MonitorDeclarationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr MonitorDeclarationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> MonitorDeclarationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr MonitorDeclarationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string MonitorDeclarationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void MonitorDeclarationImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + void MonitorDeclarationImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool MonitorDeclarationImpl::IsSetName() const + { + return _isSetName; + } + bool MonitorDeclarationImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* NoneImpl::GetOpenScenarioFlexElement() + { + return this; + } + + + std::shared_ptr NoneImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(NoneImpl).name()) + return shared_from_this(); + else if (classifier == typeid(INone).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(INoneWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr NoneImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t NoneImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int NoneImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double NoneImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t NoneImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool NoneImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime NoneImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr NoneImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string NoneImpl::GetModelType() const + { + return "None"; + } + + // children + + NoneImpl::NoneImpl() + { + /** + * Filling the property to type map + */ + } + + void NoneImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType NoneImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> NoneImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr NoneImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string NoneImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr NoneImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> NoneImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr NoneImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string NoneImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + + IOpenScenarioFlexElement* NormalDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double NormalDistributionImpl::GetExpectedValue() const + { + return _expectedValue; + } + double NormalDistributionImpl::GetVariance() const + { + return _variance; + } + std::shared_ptr NormalDistributionImpl::GetRange() const + { + return _range; + } + + + void NormalDistributionImpl::SetExpectedValue(const double expectedValue) + { + _expectedValue = expectedValue; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + _isSetExpectedValue = true; + } + + void NormalDistributionImpl::SetVariance(const double variance) + { + _variance = variance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE); + _isSetVariance = true; + } + + void NormalDistributionImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr NormalDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(NormalDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(INormalDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(INormalDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr NormalDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t NormalDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int NormalDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double NormalDistributionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + return GetExpectedValue(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + return GetVariance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t NormalDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool NormalDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime NormalDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr NormalDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string NormalDistributionImpl::GetModelType() const + { + return "NormalDistribution"; + } + + void NormalDistributionImpl::WriteParameterToExpectedValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, parameterName, nullTextMarker /*no textmarker*/); + _expectedValue = {}; + } + + void NormalDistributionImpl::WriteParameterToVariance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, parameterName, nullTextMarker /*no textmarker*/); + _variance = {}; + } + + std::string NormalDistributionImpl::GetParameterFromExpectedValue() const + { + auto expectedValue = OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE; + return GetParameterNameFromAttribute(expectedValue); + } + + std::string NormalDistributionImpl::GetParameterFromVariance() const + { + auto variance = OSC_CONSTANTS::ATTRIBUTE__VARIANCE; + return GetParameterNameFromAttribute(variance); + } + + bool NormalDistributionImpl::IsExpectedValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool NormalDistributionImpl::IsVarianceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VARIANCE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr NormalDistributionImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + NormalDistributionImpl::NormalDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, SimpleType::DOUBLE); + } + + void NormalDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + // Simple type + _variance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVariance = true; + } + } + + SimpleType NormalDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> NormalDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr NormalDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_expectedValue = GetExpectedValue(); + // Simple type + clonedObject->_variance = GetVariance(); + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string NormalDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr NormalDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> NormalDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr NormalDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string NormalDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void NormalDistributionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = value; + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIANCE) + { + // Simple type + _variance = value; + AddResolvedParameter(attributeKey); + _isSetVariance = true; + } + + } + + + bool NormalDistributionImpl::IsSetExpectedValue() const + { + return _isSetExpectedValue; + } + bool NormalDistributionImpl::IsSetVariance() const + { + return _isSetVariance; + } + void NormalDistributionImpl::ResetRange() + { + _isSetRange = false; + _range = {}; + + } + bool NormalDistributionImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* NurbsImpl::GetOpenScenarioFlexElement() + { + return this; + } + uint32_t NurbsImpl::GetOrder() const + { + return _order; + } + std::vector> NurbsImpl::GetControlPoints() const + { + std::vector> temp; + for(auto&& elm: _controlPoints) + temp.push_back(elm); + return temp; + } + std::vector> NurbsImpl::GetWriterControlPoints() const + { + return _controlPoints; + } + + int NurbsImpl::GetControlPointsSize() const + { + return static_cast(_controlPoints.size()); + } + + std::shared_ptr NurbsImpl::GetControlPointsAtIndex(unsigned int index) const + { + if (index >= 0 && _controlPoints.size() > index) + { + return _controlPoints[index]; + } + return nullptr; + } + std::vector> NurbsImpl::GetKnots() const + { + std::vector> temp; + for(auto&& elm: _knots) + temp.push_back(elm); + return temp; + } + std::vector> NurbsImpl::GetWriterKnots() const + { + return _knots; + } + + int NurbsImpl::GetKnotsSize() const + { + return static_cast(_knots.size()); + } + + std::shared_ptr NurbsImpl::GetKnotsAtIndex(unsigned int index) const + { + if (index >= 0 && _knots.size() > index) + { + return _knots[index]; + } + return nullptr; + } + + + void NurbsImpl::SetOrder(const uint32_t order) + { + _order = order; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ORDER); + _isSetOrder = true; + } + + void NurbsImpl::SetControlPoints(std::vector>& controlPoints) + { + _controlPoints = controlPoints; + _isSetControlPoints = true; + } + + void NurbsImpl::SetKnots(std::vector>& knots) + { + _knots = knots; + _isSetKnots = true; + } + + std::shared_ptr NurbsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(NurbsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(INurbs).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(INurbsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr NurbsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t NurbsImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ORDER) + { + return GetOrder(); + } + throw KeyNotSupportedException(); + + } + + int NurbsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double NurbsImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t NurbsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool NurbsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime NurbsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr NurbsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string NurbsImpl::GetModelType() const + { + return "Nurbs"; + } + + void NurbsImpl::WriteParameterToOrder(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ORDER, parameterName, nullTextMarker /*no textmarker*/); + _order = {}; + } + + std::string NurbsImpl::GetParameterFromOrder() const + { + auto order = OSC_CONSTANTS::ATTRIBUTE__ORDER; + return GetParameterNameFromAttribute(order); + } + + bool NurbsImpl::IsOrderParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ORDER); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + NurbsImpl::NurbsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ORDER, SimpleType::UNSIGNED_INT); + } + + void NurbsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ORDER) + { + // Simple type + _order = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOrder = true; + } + } + + SimpleType NurbsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> NurbsImpl::GetChildren() const + { + std::vector> result; + + auto controlPoints = GetWriterControlPoints(); + if (!controlPoints.empty()) + { + for(auto&& item : controlPoints) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto knots = GetWriterKnots(); + if (!knots.empty()) + { + for(auto&& item : knots) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr NurbsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_order = GetOrder(); + // clone indicators + // clone children + const auto kControlPoints = GetWriterControlPoints(); + if (!kControlPoints.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kControlPoints) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetControlPoints(clonedList); + } + const auto kKnots = GetWriterKnots(); + if (!kKnots.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kKnots) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetKnots(clonedList); + } + return clonedObject; + } + + std::string NurbsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr NurbsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> NurbsImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROL_POINT) + { + std::vector> vect; + for (auto&& elem : GetControlPoints()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__KNOT) + { + std::vector> vect; + for (auto&& elem : GetKnots()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr NurbsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string NurbsImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void NurbsImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ORDER) + { + // Simple type + _order = value; + AddResolvedParameter(attributeKey); + _isSetOrder = true; + } + + } + + + bool NurbsImpl::IsSetOrder() const + { + return _isSetOrder; + } + bool NurbsImpl::IsSetControlPoints() const + { + return _isSetControlPoints; + } + bool NurbsImpl::IsSetKnots() const + { + return _isSetKnots; + } + + IOpenScenarioFlexElement* ObjectControllerImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ObjectControllerImpl::GetName() const + { + return _name; + } + std::shared_ptr ObjectControllerImpl::GetCatalogReference() const + { + return _catalogReference; + } + std::shared_ptr ObjectControllerImpl::GetController() const + { + return _controller; + } + + + void ObjectControllerImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ObjectControllerImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _controller = {}; + _isSetCatalogReference = true; + } + + void ObjectControllerImpl::SetController(std::shared_ptr controller) + { + _controller = controller; + _catalogReference = {}; + _isSetController = true; + } + + std::shared_ptr ObjectControllerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ObjectControllerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IObjectController).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IObjectControllerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ObjectControllerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ObjectControllerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ObjectControllerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ObjectControllerImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ObjectControllerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ObjectControllerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ObjectControllerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ObjectControllerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ObjectControllerImpl::GetModelType() const + { + return "ObjectController"; + } + + void ObjectControllerImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ObjectControllerImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ObjectControllerImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ObjectControllerImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + std::shared_ptr ObjectControllerImpl::GetWriterController() const + { + return std::dynamic_pointer_cast(_controller); + } + + ObjectControllerImpl::ObjectControllerImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ObjectControllerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ObjectControllerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ObjectControllerImpl::GetChildren() const + { + std::vector> result; + + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + const auto kController = GetWriterController(); + if (kController) + { + result.push_back(std::dynamic_pointer_cast(kController)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ObjectControllerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + clonedObject->_isSetName = _isSetName; + // clone children + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + const auto kController = GetWriterController(); + if (kController) + { + auto clonedChild = std::dynamic_pointer_cast(kController)->Clone(); + auto clonedChildIController = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetController(std::dynamic_pointer_cast(clonedChildIController)); + } + return clonedObject; + } + + std::string ObjectControllerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ObjectControllerImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER) + { + return std::dynamic_pointer_cast(GetController()); + } + throw KeyNotSupportedException(); + } + + std::vector> ObjectControllerImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ObjectControllerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ObjectControllerImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ObjectControllerImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + void ObjectControllerImpl::ResetName() + { + _isSetName = false; + _name = {}; + + } + bool ObjectControllerImpl::IsSetName() const + { + return _isSetName; + } + bool ObjectControllerImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + bool ObjectControllerImpl::IsSetController() const + { + return _isSetController; + } + + IOpenScenarioFlexElement* OffroadConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double OffroadConditionImpl::GetDuration() const + { + return _duration; + } + + + void OffroadConditionImpl::SetDuration(const double duration) + { + _duration = duration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION); + _isSetDuration = true; + } + + std::shared_ptr OffroadConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OffroadConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOffroadCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOffroadConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OffroadConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OffroadConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OffroadConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OffroadConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + return GetDuration(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OffroadConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OffroadConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime OffroadConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OffroadConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OffroadConditionImpl::GetModelType() const + { + return "OffroadCondition"; + } + + void OffroadConditionImpl::WriteParameterToDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, parameterName, nullTextMarker /*no textmarker*/); + _duration = {}; + } + + std::string OffroadConditionImpl::GetParameterFromDuration() const + { + auto duration = OSC_CONSTANTS::ATTRIBUTE__DURATION; + return GetParameterNameFromAttribute(duration); + } + + bool OffroadConditionImpl::IsDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + OffroadConditionImpl::OffroadConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DURATION, SimpleType::DOUBLE); + } + + void OffroadConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + } + + SimpleType OffroadConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OffroadConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OffroadConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_duration = GetDuration(); + // clone indicators + // clone children + return clonedObject; + } + + std::string OffroadConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OffroadConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> OffroadConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OffroadConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OffroadConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OffroadConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = value; + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + + } + + + bool OffroadConditionImpl::IsSetDuration() const + { + return _isSetDuration; + } + + IOpenScenarioFlexElement* OpenScenarioImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr OpenScenarioImpl::GetFileHeader() const + { + return _fileHeader; + } + std::shared_ptr OpenScenarioImpl::GetOpenScenarioCategory() const + { + return _openScenarioCategory; + } + + + void OpenScenarioImpl::SetFileHeader(std::shared_ptr fileHeader) + { + _fileHeader = fileHeader; + _isSetFileHeader = true; + } + + void OpenScenarioImpl::SetOpenScenarioCategory(std::shared_ptr openScenarioCategory) + { + _openScenarioCategory = openScenarioCategory; + _isSetOpenScenarioCategory = true; + } + + std::shared_ptr OpenScenarioImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OpenScenarioImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOpenScenario).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOpenScenarioWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OpenScenarioImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OpenScenarioImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OpenScenarioImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OpenScenarioImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t OpenScenarioImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OpenScenarioImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime OpenScenarioImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OpenScenarioImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OpenScenarioImpl::GetModelType() const + { + return "OpenScenario"; + } + + // children + std::shared_ptr OpenScenarioImpl::GetWriterFileHeader() const + { + return std::dynamic_pointer_cast(_fileHeader); + } + std::shared_ptr OpenScenarioImpl::GetWriterOpenScenarioCategory() const + { + return std::dynamic_pointer_cast(_openScenarioCategory); + } + + OpenScenarioImpl::OpenScenarioImpl() + { + /** + * Filling the property to type map + */ + } + + void OpenScenarioImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType OpenScenarioImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OpenScenarioImpl::GetChildren() const + { + std::vector> result; + + const auto kFileHeader = GetWriterFileHeader(); + if (kFileHeader) + { + result.push_back(std::dynamic_pointer_cast(kFileHeader)); + } + const auto kOpenScenarioCategory = GetWriterOpenScenarioCategory(); + if (kOpenScenarioCategory) + { + result.push_back(std::dynamic_pointer_cast(kOpenScenarioCategory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OpenScenarioImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kFileHeader = GetWriterFileHeader(); + if (kFileHeader) + { + auto clonedChild = std::dynamic_pointer_cast(kFileHeader)->Clone(); + auto clonedChildIFileHeader = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFileHeader(std::dynamic_pointer_cast(clonedChildIFileHeader)); + } + const auto kOpenScenarioCategory = GetWriterOpenScenarioCategory(); + if (kOpenScenarioCategory) + { + auto clonedChild = std::dynamic_pointer_cast(kOpenScenarioCategory)->Clone(); + auto clonedChildIOpenScenarioCategory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOpenScenarioCategory(std::dynamic_pointer_cast(clonedChildIOpenScenarioCategory)); + } + return clonedObject; + } + + std::string OpenScenarioImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OpenScenarioImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__FILE_HEADER) + { + return std::dynamic_pointer_cast(GetFileHeader()); + } + + if (key == OSC_CONSTANTS::ELEMENT__OPEN_SCENARIO_CATEGORY) + { + return std::dynamic_pointer_cast(GetOpenScenarioCategory()); + } + throw KeyNotSupportedException(); + } + + std::vector> OpenScenarioImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OpenScenarioImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OpenScenarioImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool OpenScenarioImpl::IsSetFileHeader() const + { + return _isSetFileHeader; + } + bool OpenScenarioImpl::IsSetOpenScenarioCategory() const + { + return _isSetOpenScenarioCategory; + } + + IOpenScenarioFlexElement* OpenScenarioCategoryImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr OpenScenarioCategoryImpl::GetScenarioDefinition() const + { + return _scenarioDefinition; + } + std::shared_ptr OpenScenarioCategoryImpl::GetCatalogDefinition() const + { + return _catalogDefinition; + } + std::shared_ptr OpenScenarioCategoryImpl::GetParameterValueDistributionDefinition() const + { + return _parameterValueDistributionDefinition; + } + + + void OpenScenarioCategoryImpl::SetScenarioDefinition(std::shared_ptr scenarioDefinition) + { + _scenarioDefinition = scenarioDefinition; + _catalogDefinition = {}; + _parameterValueDistributionDefinition = {}; + _isSetScenarioDefinition = true; + } + + void OpenScenarioCategoryImpl::SetCatalogDefinition(std::shared_ptr catalogDefinition) + { + _catalogDefinition = catalogDefinition; + _scenarioDefinition = {}; + _parameterValueDistributionDefinition = {}; + _isSetCatalogDefinition = true; + } + + void OpenScenarioCategoryImpl::SetParameterValueDistributionDefinition(std::shared_ptr parameterValueDistributionDefinition) + { + _parameterValueDistributionDefinition = parameterValueDistributionDefinition; + _scenarioDefinition = {}; + _catalogDefinition = {}; + _isSetParameterValueDistributionDefinition = true; + } + + std::shared_ptr OpenScenarioCategoryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OpenScenarioCategoryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOpenScenarioCategory).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOpenScenarioCategoryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OpenScenarioCategoryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OpenScenarioCategoryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OpenScenarioCategoryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OpenScenarioCategoryImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t OpenScenarioCategoryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OpenScenarioCategoryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime OpenScenarioCategoryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OpenScenarioCategoryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OpenScenarioCategoryImpl::GetModelType() const + { + return "OpenScenarioCategory"; + } + + // children + std::shared_ptr OpenScenarioCategoryImpl::GetWriterScenarioDefinition() const + { + return std::dynamic_pointer_cast(_scenarioDefinition); + } + std::shared_ptr OpenScenarioCategoryImpl::GetWriterCatalogDefinition() const + { + return std::dynamic_pointer_cast(_catalogDefinition); + } + std::shared_ptr OpenScenarioCategoryImpl::GetWriterParameterValueDistributionDefinition() const + { + return std::dynamic_pointer_cast(_parameterValueDistributionDefinition); + } + + OpenScenarioCategoryImpl::OpenScenarioCategoryImpl() + { + /** + * Filling the property to type map + */ + } + + void OpenScenarioCategoryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType OpenScenarioCategoryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OpenScenarioCategoryImpl::GetChildren() const + { + std::vector> result; + + const auto kScenarioDefinition = GetWriterScenarioDefinition(); + if (kScenarioDefinition) + { + result.push_back(std::dynamic_pointer_cast(kScenarioDefinition)); + } + const auto kCatalogDefinition = GetWriterCatalogDefinition(); + if (kCatalogDefinition) + { + result.push_back(std::dynamic_pointer_cast(kCatalogDefinition)); + } + const auto kParameterValueDistributionDefinition = GetWriterParameterValueDistributionDefinition(); + if (kParameterValueDistributionDefinition) + { + result.push_back(std::dynamic_pointer_cast(kParameterValueDistributionDefinition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OpenScenarioCategoryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kScenarioDefinition = GetWriterScenarioDefinition(); + if (kScenarioDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kScenarioDefinition)->Clone(); + auto clonedChildIScenarioDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetScenarioDefinition(std::dynamic_pointer_cast(clonedChildIScenarioDefinition)); + } + const auto kCatalogDefinition = GetWriterCatalogDefinition(); + if (kCatalogDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogDefinition)->Clone(); + auto clonedChildICatalogDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogDefinition(std::dynamic_pointer_cast(clonedChildICatalogDefinition)); + } + const auto kParameterValueDistributionDefinition = GetWriterParameterValueDistributionDefinition(); + if (kParameterValueDistributionDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kParameterValueDistributionDefinition)->Clone(); + auto clonedChildIParameterValueDistributionDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetParameterValueDistributionDefinition(std::dynamic_pointer_cast(clonedChildIParameterValueDistributionDefinition)); + } + return clonedObject; + } + + std::string OpenScenarioCategoryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OpenScenarioCategoryImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SCENARIO_DEFINITION) + { + return std::dynamic_pointer_cast(GetScenarioDefinition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_DEFINITION) + { + return std::dynamic_pointer_cast(GetCatalogDefinition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION_DEFINITION) + { + return std::dynamic_pointer_cast(GetParameterValueDistributionDefinition()); + } + throw KeyNotSupportedException(); + } + + std::vector> OpenScenarioCategoryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OpenScenarioCategoryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OpenScenarioCategoryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool OpenScenarioCategoryImpl::IsSetScenarioDefinition() const + { + return _isSetScenarioDefinition; + } + bool OpenScenarioCategoryImpl::IsSetCatalogDefinition() const + { + return _isSetCatalogDefinition; + } + bool OpenScenarioCategoryImpl::IsSetParameterValueDistributionDefinition() const + { + return _isSetParameterValueDistributionDefinition; + } + + IOpenScenarioFlexElement* OrientationImpl::GetOpenScenarioFlexElement() + { + return this; + } + double OrientationImpl::GetH() const + { + return _h; + } + double OrientationImpl::GetP() const + { + return _p; + } + double OrientationImpl::GetR() const + { + return _r; + } + ReferenceContext OrientationImpl::GetType() const + { + return _type; + } + + + void OrientationImpl::SetH(const double h) + { + _h = h; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H); + _isSetH = true; + } + + void OrientationImpl::SetP(const double p) + { + _p = p; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P); + _isSetP = true; + } + + void OrientationImpl::SetR(const double r) + { + _r = r; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R); + _isSetR = true; + } + + void OrientationImpl::SetType(const ReferenceContext type) + { + _type = type; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE); + _isSetType = true; + } + + std::shared_ptr OrientationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OrientationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOrientation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOrientationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OrientationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OrientationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OrientationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OrientationImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__H) + { + return GetH(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__P) + { + return GetP(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__R) + { + return GetR(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OrientationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OrientationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime OrientationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OrientationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OrientationImpl::GetModelType() const + { + return "Orientation"; + } + + void OrientationImpl::WriteParameterToH(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, parameterName, nullTextMarker /*no textmarker*/); + _h = {}; + } + + void OrientationImpl::WriteParameterToP(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, parameterName, nullTextMarker /*no textmarker*/); + _p = {}; + } + + void OrientationImpl::WriteParameterToR(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, parameterName, nullTextMarker /*no textmarker*/); + _r = {}; + } + + void OrientationImpl::WriteParameterToType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, parameterName, nullTextMarker /*no textmarker*/); + _type = {}; + } + + std::string OrientationImpl::GetParameterFromH() const + { + auto h = OSC_CONSTANTS::ATTRIBUTE__H; + return GetParameterNameFromAttribute(h); + } + + std::string OrientationImpl::GetParameterFromP() const + { + auto p = OSC_CONSTANTS::ATTRIBUTE__P; + return GetParameterNameFromAttribute(p); + } + + std::string OrientationImpl::GetParameterFromR() const + { + auto r = OSC_CONSTANTS::ATTRIBUTE__R; + return GetParameterNameFromAttribute(r); + } + + std::string OrientationImpl::GetParameterFromType() const + { + auto type = OSC_CONSTANTS::ATTRIBUTE__TYPE; + return GetParameterNameFromAttribute(type); + } + + bool OrientationImpl::IsHParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__H); + if (kIt != keys.end()) + return true; + return false; + } + + bool OrientationImpl::IsPParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__P); + if (kIt != keys.end()) + return true; + return false; + } + + bool OrientationImpl::IsRParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__R); + if (kIt != keys.end()) + return true; + return false; + } + + bool OrientationImpl::IsTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + OrientationImpl::OrientationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__H, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__P, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__R, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TYPE, SimpleType::ENUM_TYPE); + } + + void OrientationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H) + { + // Simple type + _h = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetH = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__P) + { + // Simple type + _p = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetP = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__R) + { + // Simple type + _r = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetR = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Enumeration Type + const auto kResult = ReferenceContext::GetFromLiteral(parameterLiteralValue); + if (kResult != ReferenceContext::UNKNOWN) + { + _type = kResult; + AddResolvedParameter(attributeKey); + _isSetType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType OrientationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OrientationImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OrientationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_h = GetH(); + // Simple type + clonedObject->_p = GetP(); + // Simple type + clonedObject->_r = GetR(); + // Enumeration Type + const auto kType = GetType(); + if ( kType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_type = ReferenceContext::GetFromLiteral(kType.GetLiteral()); + } + // clone indicators + clonedObject->_isSetH = _isSetH; + clonedObject->_isSetP = _isSetP; + clonedObject->_isSetR = _isSetR; + clonedObject->_isSetType = _isSetType; + // clone children + return clonedObject; + } + + std::string OrientationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OrientationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> OrientationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OrientationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OrientationImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + auto type = GetType(); + return type.GetLiteral() != "UNKNOWN" ? type.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void OrientationImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H) + { + // Simple type + _h = value; + AddResolvedParameter(attributeKey); + _isSetH = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__P) + { + // Simple type + _p = value; + AddResolvedParameter(attributeKey); + _isSetP = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__R) + { + // Simple type + _r = value; + AddResolvedParameter(attributeKey); + _isSetR = true; + } + + } + + + void OrientationImpl::ResetH() + { + _isSetH = false; + _h = {0}; + + } + bool OrientationImpl::IsSetH() const + { + return _isSetH; + } + void OrientationImpl::ResetP() + { + _isSetP = false; + _p = {0}; + + } + bool OrientationImpl::IsSetP() const + { + return _isSetP; + } + void OrientationImpl::ResetR() + { + _isSetR = false; + _r = {0}; + + } + bool OrientationImpl::IsSetR() const + { + return _isSetR; + } + void OrientationImpl::ResetType() + { + _isSetType = false; + _type = {ReferenceContext::ReferenceContextEnum::ABSOLUTE}; + + } + bool OrientationImpl::IsSetType() const + { + return _isSetType; + } + + IOpenScenarioFlexElement* OverrideBrakeActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideBrakeActionImpl::GetActive() const + { + return _active; + } + double OverrideBrakeActionImpl::GetValue() const + { + return _value; + } + std::shared_ptr OverrideBrakeActionImpl::GetBrakeInput() const + { + return _brakeInput; + } + + + void OverrideBrakeActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideBrakeActionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void OverrideBrakeActionImpl::SetBrakeInput(std::shared_ptr brakeInput) + { + _brakeInput = brakeInput; + _isSetBrakeInput = true; + } + + std::shared_ptr OverrideBrakeActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideBrakeActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideBrakeAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideBrakeActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideBrakeActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideBrakeActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideBrakeActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideBrakeActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideBrakeActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideBrakeActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideBrakeActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideBrakeActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideBrakeActionImpl::GetModelType() const + { + return "OverrideBrakeAction"; + } + + void OverrideBrakeActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideBrakeActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string OverrideBrakeActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideBrakeActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool OverrideBrakeActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideBrakeActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr OverrideBrakeActionImpl::GetWriterBrakeInput() const + { + return std::dynamic_pointer_cast(_brakeInput); + } + + OverrideBrakeActionImpl::OverrideBrakeActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void OverrideBrakeActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType OverrideBrakeActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideBrakeActionImpl::GetChildren() const + { + std::vector> result; + + const auto kBrakeInput = GetWriterBrakeInput(); + if (kBrakeInput) + { + result.push_back(std::dynamic_pointer_cast(kBrakeInput)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideBrakeActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetValue = _isSetValue; + // clone children + const auto kBrakeInput = GetWriterBrakeInput(); + if (kBrakeInput) + { + auto clonedChild = std::dynamic_pointer_cast(kBrakeInput)->Clone(); + auto clonedChildIBrakeInput = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBrakeInput(std::dynamic_pointer_cast(clonedChildIBrakeInput)); + } + return clonedObject; + } + + std::string OverrideBrakeActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideBrakeActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BRAKE_INPUT) + { + return std::dynamic_pointer_cast(GetBrakeInput()); + } + throw KeyNotSupportedException(); + } + + std::vector> OverrideBrakeActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideBrakeActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideBrakeActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideBrakeActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideBrakeActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool OverrideBrakeActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideBrakeActionImpl::ResetValue() + { + _isSetValue = false; + _value = {}; + + } + bool OverrideBrakeActionImpl::IsSetValue() const + { + return _isSetValue; + } + void OverrideBrakeActionImpl::ResetBrakeInput() + { + _isSetBrakeInput = false; + _brakeInput = {}; + + } + bool OverrideBrakeActionImpl::IsSetBrakeInput() const + { + return _isSetBrakeInput; + } + + IOpenScenarioFlexElement* OverrideClutchActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideClutchActionImpl::GetActive() const + { + return _active; + } + double OverrideClutchActionImpl::GetMaxRate() const + { + return _maxRate; + } + double OverrideClutchActionImpl::GetValue() const + { + return _value; + } + + + void OverrideClutchActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideClutchActionImpl::SetMaxRate(const double maxRate) + { + _maxRate = maxRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + _isSetMaxRate = true; + } + + void OverrideClutchActionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr OverrideClutchActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideClutchActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideClutchAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideClutchActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideClutchActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideClutchActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideClutchActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideClutchActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + return GetMaxRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideClutchActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideClutchActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideClutchActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideClutchActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideClutchActionImpl::GetModelType() const + { + return "OverrideClutchAction"; + } + + void OverrideClutchActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideClutchActionImpl::WriteParameterToMaxRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxRate = {}; + } + + void OverrideClutchActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string OverrideClutchActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideClutchActionImpl::GetParameterFromMaxRate() const + { + auto maxRate = OSC_CONSTANTS::ATTRIBUTE__MAX_RATE; + return GetParameterNameFromAttribute(maxRate); + } + + std::string OverrideClutchActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool OverrideClutchActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideClutchActionImpl::IsMaxRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideClutchActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + OverrideClutchActionImpl::OverrideClutchActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void OverrideClutchActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType OverrideClutchActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideClutchActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideClutchActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_maxRate = GetMaxRate(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetMaxRate = _isSetMaxRate; + // clone children + return clonedObject; + } + + std::string OverrideClutchActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideClutchActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> OverrideClutchActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideClutchActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideClutchActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideClutchActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideClutchActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool OverrideClutchActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideClutchActionImpl::ResetMaxRate() + { + _isSetMaxRate = false; + _maxRate = {}; + + } + bool OverrideClutchActionImpl::IsSetMaxRate() const + { + return _isSetMaxRate; + } + bool OverrideClutchActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* OverrideControllerValueActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr OverrideControllerValueActionImpl::GetThrottle() const + { + return _throttle; + } + std::shared_ptr OverrideControllerValueActionImpl::GetBrake() const + { + return _brake; + } + std::shared_ptr OverrideControllerValueActionImpl::GetClutch() const + { + return _clutch; + } + std::shared_ptr OverrideControllerValueActionImpl::GetParkingBrake() const + { + return _parkingBrake; + } + std::shared_ptr OverrideControllerValueActionImpl::GetSteeringWheel() const + { + return _steeringWheel; + } + std::shared_ptr OverrideControllerValueActionImpl::GetGear() const + { + return _gear; + } + + + void OverrideControllerValueActionImpl::SetThrottle(std::shared_ptr throttle) + { + _throttle = throttle; + _isSetThrottle = true; + } + + void OverrideControllerValueActionImpl::SetBrake(std::shared_ptr brake) + { + _brake = brake; + _isSetBrake = true; + } + + void OverrideControllerValueActionImpl::SetClutch(std::shared_ptr clutch) + { + _clutch = clutch; + _isSetClutch = true; + } + + void OverrideControllerValueActionImpl::SetParkingBrake(std::shared_ptr parkingBrake) + { + _parkingBrake = parkingBrake; + _isSetParkingBrake = true; + } + + void OverrideControllerValueActionImpl::SetSteeringWheel(std::shared_ptr steeringWheel) + { + _steeringWheel = steeringWheel; + _isSetSteeringWheel = true; + } + + void OverrideControllerValueActionImpl::SetGear(std::shared_ptr gear) + { + _gear = gear; + _isSetGear = true; + } + + std::shared_ptr OverrideControllerValueActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideControllerValueActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideControllerValueAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideControllerValueActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideControllerValueActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideControllerValueActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideControllerValueActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideControllerValueActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t OverrideControllerValueActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideControllerValueActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime OverrideControllerValueActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideControllerValueActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideControllerValueActionImpl::GetModelType() const + { + return "OverrideControllerValueAction"; + } + + // children + std::shared_ptr OverrideControllerValueActionImpl::GetWriterThrottle() const + { + return std::dynamic_pointer_cast(_throttle); + } + std::shared_ptr OverrideControllerValueActionImpl::GetWriterBrake() const + { + return std::dynamic_pointer_cast(_brake); + } + std::shared_ptr OverrideControllerValueActionImpl::GetWriterClutch() const + { + return std::dynamic_pointer_cast(_clutch); + } + std::shared_ptr OverrideControllerValueActionImpl::GetWriterParkingBrake() const + { + return std::dynamic_pointer_cast(_parkingBrake); + } + std::shared_ptr OverrideControllerValueActionImpl::GetWriterSteeringWheel() const + { + return std::dynamic_pointer_cast(_steeringWheel); + } + std::shared_ptr OverrideControllerValueActionImpl::GetWriterGear() const + { + return std::dynamic_pointer_cast(_gear); + } + + OverrideControllerValueActionImpl::OverrideControllerValueActionImpl() + { + /** + * Filling the property to type map + */ + } + + void OverrideControllerValueActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType OverrideControllerValueActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideControllerValueActionImpl::GetChildren() const + { + std::vector> result; + + const auto kThrottle = GetWriterThrottle(); + if (kThrottle) + { + result.push_back(std::dynamic_pointer_cast(kThrottle)); + } + const auto kBrake = GetWriterBrake(); + if (kBrake) + { + result.push_back(std::dynamic_pointer_cast(kBrake)); + } + const auto kClutch = GetWriterClutch(); + if (kClutch) + { + result.push_back(std::dynamic_pointer_cast(kClutch)); + } + const auto kParkingBrake = GetWriterParkingBrake(); + if (kParkingBrake) + { + result.push_back(std::dynamic_pointer_cast(kParkingBrake)); + } + const auto kSteeringWheel = GetWriterSteeringWheel(); + if (kSteeringWheel) + { + result.push_back(std::dynamic_pointer_cast(kSteeringWheel)); + } + const auto kGear = GetWriterGear(); + if (kGear) + { + result.push_back(std::dynamic_pointer_cast(kGear)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideControllerValueActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kThrottle = GetWriterThrottle(); + if (kThrottle) + { + auto clonedChild = std::dynamic_pointer_cast(kThrottle)->Clone(); + auto clonedChildIOverrideThrottleAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetThrottle(std::dynamic_pointer_cast(clonedChildIOverrideThrottleAction)); + } + const auto kBrake = GetWriterBrake(); + if (kBrake) + { + auto clonedChild = std::dynamic_pointer_cast(kBrake)->Clone(); + auto clonedChildIOverrideBrakeAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBrake(std::dynamic_pointer_cast(clonedChildIOverrideBrakeAction)); + } + const auto kClutch = GetWriterClutch(); + if (kClutch) + { + auto clonedChild = std::dynamic_pointer_cast(kClutch)->Clone(); + auto clonedChildIOverrideClutchAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetClutch(std::dynamic_pointer_cast(clonedChildIOverrideClutchAction)); + } + const auto kParkingBrake = GetWriterParkingBrake(); + if (kParkingBrake) + { + auto clonedChild = std::dynamic_pointer_cast(kParkingBrake)->Clone(); + auto clonedChildIOverrideParkingBrakeAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetParkingBrake(std::dynamic_pointer_cast(clonedChildIOverrideParkingBrakeAction)); + } + const auto kSteeringWheel = GetWriterSteeringWheel(); + if (kSteeringWheel) + { + auto clonedChild = std::dynamic_pointer_cast(kSteeringWheel)->Clone(); + auto clonedChildIOverrideSteeringWheelAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSteeringWheel(std::dynamic_pointer_cast(clonedChildIOverrideSteeringWheelAction)); + } + const auto kGear = GetWriterGear(); + if (kGear) + { + auto clonedChild = std::dynamic_pointer_cast(kGear)->Clone(); + auto clonedChildIOverrideGearAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetGear(std::dynamic_pointer_cast(clonedChildIOverrideGearAction)); + } + return clonedObject; + } + + std::string OverrideControllerValueActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideControllerValueActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__THROTTLE) + { + return std::dynamic_pointer_cast(GetThrottle()); + } + + if (key == OSC_CONSTANTS::ELEMENT__BRAKE) + { + return std::dynamic_pointer_cast(GetBrake()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CLUTCH) + { + return std::dynamic_pointer_cast(GetClutch()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARKING_BRAKE) + { + return std::dynamic_pointer_cast(GetParkingBrake()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STEERING_WHEEL) + { + return std::dynamic_pointer_cast(GetSteeringWheel()); + } + + if (key == OSC_CONSTANTS::ELEMENT__GEAR) + { + return std::dynamic_pointer_cast(GetGear()); + } + throw KeyNotSupportedException(); + } + + std::vector> OverrideControllerValueActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideControllerValueActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideControllerValueActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void OverrideControllerValueActionImpl::ResetThrottle() + { + _isSetThrottle = false; + _throttle = {}; + + } + bool OverrideControllerValueActionImpl::IsSetThrottle() const + { + return _isSetThrottle; + } + void OverrideControllerValueActionImpl::ResetBrake() + { + _isSetBrake = false; + _brake = {}; + + } + bool OverrideControllerValueActionImpl::IsSetBrake() const + { + return _isSetBrake; + } + void OverrideControllerValueActionImpl::ResetClutch() + { + _isSetClutch = false; + _clutch = {}; + + } + bool OverrideControllerValueActionImpl::IsSetClutch() const + { + return _isSetClutch; + } + void OverrideControllerValueActionImpl::ResetParkingBrake() + { + _isSetParkingBrake = false; + _parkingBrake = {}; + + } + bool OverrideControllerValueActionImpl::IsSetParkingBrake() const + { + return _isSetParkingBrake; + } + void OverrideControllerValueActionImpl::ResetSteeringWheel() + { + _isSetSteeringWheel = false; + _steeringWheel = {}; + + } + bool OverrideControllerValueActionImpl::IsSetSteeringWheel() const + { + return _isSetSteeringWheel; + } + void OverrideControllerValueActionImpl::ResetGear() + { + _isSetGear = false; + _gear = {}; + + } + bool OverrideControllerValueActionImpl::IsSetGear() const + { + return _isSetGear; + } + + IOpenScenarioFlexElement* OverrideGearActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideGearActionImpl::GetActive() const + { + return _active; + } + double OverrideGearActionImpl::GetNumber() const + { + return _number; + } + std::shared_ptr OverrideGearActionImpl::GetGear() const + { + return _gear; + } + + + void OverrideGearActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideGearActionImpl::SetNumber(const double number) + { + _number = number; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER); + _isSetNumber = true; + } + + void OverrideGearActionImpl::SetGear(std::shared_ptr gear) + { + _gear = gear; + _isSetGear = true; + } + + std::shared_ptr OverrideGearActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideGearActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideGearAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideGearActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideGearActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideGearActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideGearActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideGearActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + return GetNumber(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideGearActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideGearActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideGearActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideGearActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideGearActionImpl::GetModelType() const + { + return "OverrideGearAction"; + } + + void OverrideGearActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideGearActionImpl::WriteParameterToNumber(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, parameterName, nullTextMarker /*no textmarker*/); + _number = {}; + } + + std::string OverrideGearActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideGearActionImpl::GetParameterFromNumber() const + { + auto number = OSC_CONSTANTS::ATTRIBUTE__NUMBER; + return GetParameterNameFromAttribute(number); + } + + bool OverrideGearActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideGearActionImpl::IsNumberParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NUMBER); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr OverrideGearActionImpl::GetWriterGear() const + { + return std::dynamic_pointer_cast(_gear); + } + + OverrideGearActionImpl::OverrideGearActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NUMBER, SimpleType::DOUBLE); + } + + void OverrideGearActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + // Simple type + _number = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetNumber = true; + } + } + + SimpleType OverrideGearActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideGearActionImpl::GetChildren() const + { + std::vector> result; + + const auto kGear = GetWriterGear(); + if (kGear) + { + result.push_back(std::dynamic_pointer_cast(kGear)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideGearActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_number = GetNumber(); + // clone indicators + clonedObject->_isSetNumber = _isSetNumber; + // clone children + const auto kGear = GetWriterGear(); + if (kGear) + { + auto clonedChild = std::dynamic_pointer_cast(kGear)->Clone(); + auto clonedChildIGear = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetGear(std::dynamic_pointer_cast(clonedChildIGear)); + } + return clonedObject; + } + + std::string OverrideGearActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideGearActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__GEAR) + { + return std::dynamic_pointer_cast(GetGear()); + } + throw KeyNotSupportedException(); + } + + std::vector> OverrideGearActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideGearActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideGearActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideGearActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideGearActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER) + { + // Simple type + _number = value; + AddResolvedParameter(attributeKey); + _isSetNumber = true; + } + + } + + + bool OverrideGearActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideGearActionImpl::ResetNumber() + { + _isSetNumber = false; + _number = {}; + + } + bool OverrideGearActionImpl::IsSetNumber() const + { + return _isSetNumber; + } + void OverrideGearActionImpl::ResetGear() + { + _isSetGear = false; + _gear = {}; + + } + bool OverrideGearActionImpl::IsSetGear() const + { + return _isSetGear; + } + + IOpenScenarioFlexElement* OverrideParkingBrakeActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideParkingBrakeActionImpl::GetActive() const + { + return _active; + } + double OverrideParkingBrakeActionImpl::GetValue() const + { + return _value; + } + std::shared_ptr OverrideParkingBrakeActionImpl::GetBrakeInput() const + { + return _brakeInput; + } + + + void OverrideParkingBrakeActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideParkingBrakeActionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void OverrideParkingBrakeActionImpl::SetBrakeInput(std::shared_ptr brakeInput) + { + _brakeInput = brakeInput; + _isSetBrakeInput = true; + } + + std::shared_ptr OverrideParkingBrakeActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideParkingBrakeActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideParkingBrakeAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideParkingBrakeActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideParkingBrakeActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideParkingBrakeActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideParkingBrakeActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideParkingBrakeActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideParkingBrakeActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideParkingBrakeActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideParkingBrakeActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideParkingBrakeActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideParkingBrakeActionImpl::GetModelType() const + { + return "OverrideParkingBrakeAction"; + } + + void OverrideParkingBrakeActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideParkingBrakeActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string OverrideParkingBrakeActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideParkingBrakeActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool OverrideParkingBrakeActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideParkingBrakeActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr OverrideParkingBrakeActionImpl::GetWriterBrakeInput() const + { + return std::dynamic_pointer_cast(_brakeInput); + } + + OverrideParkingBrakeActionImpl::OverrideParkingBrakeActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void OverrideParkingBrakeActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType OverrideParkingBrakeActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideParkingBrakeActionImpl::GetChildren() const + { + std::vector> result; + + const auto kBrakeInput = GetWriterBrakeInput(); + if (kBrakeInput) + { + result.push_back(std::dynamic_pointer_cast(kBrakeInput)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideParkingBrakeActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetValue = _isSetValue; + // clone children + const auto kBrakeInput = GetWriterBrakeInput(); + if (kBrakeInput) + { + auto clonedChild = std::dynamic_pointer_cast(kBrakeInput)->Clone(); + auto clonedChildIBrakeInput = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBrakeInput(std::dynamic_pointer_cast(clonedChildIBrakeInput)); + } + return clonedObject; + } + + std::string OverrideParkingBrakeActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideParkingBrakeActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BRAKE_INPUT) + { + return std::dynamic_pointer_cast(GetBrakeInput()); + } + throw KeyNotSupportedException(); + } + + std::vector> OverrideParkingBrakeActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideParkingBrakeActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideParkingBrakeActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideParkingBrakeActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideParkingBrakeActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool OverrideParkingBrakeActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideParkingBrakeActionImpl::ResetValue() + { + _isSetValue = false; + _value = {}; + + } + bool OverrideParkingBrakeActionImpl::IsSetValue() const + { + return _isSetValue; + } + void OverrideParkingBrakeActionImpl::ResetBrakeInput() + { + _isSetBrakeInput = false; + _brakeInput = {}; + + } + bool OverrideParkingBrakeActionImpl::IsSetBrakeInput() const + { + return _isSetBrakeInput; + } + + IOpenScenarioFlexElement* OverrideSteeringWheelActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideSteeringWheelActionImpl::GetActive() const + { + return _active; + } + double OverrideSteeringWheelActionImpl::GetMaxRate() const + { + return _maxRate; + } + double OverrideSteeringWheelActionImpl::GetMaxTorque() const + { + return _maxTorque; + } + double OverrideSteeringWheelActionImpl::GetValue() const + { + return _value; + } + + + void OverrideSteeringWheelActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideSteeringWheelActionImpl::SetMaxRate(const double maxRate) + { + _maxRate = maxRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + _isSetMaxRate = true; + } + + void OverrideSteeringWheelActionImpl::SetMaxTorque(const double maxTorque) + { + _maxTorque = maxTorque; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE); + _isSetMaxTorque = true; + } + + void OverrideSteeringWheelActionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr OverrideSteeringWheelActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideSteeringWheelActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideSteeringWheelAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideSteeringWheelActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideSteeringWheelActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideSteeringWheelActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideSteeringWheelActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideSteeringWheelActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + return GetMaxRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE) + { + return GetMaxTorque(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideSteeringWheelActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideSteeringWheelActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideSteeringWheelActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideSteeringWheelActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideSteeringWheelActionImpl::GetModelType() const + { + return "OverrideSteeringWheelAction"; + } + + void OverrideSteeringWheelActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideSteeringWheelActionImpl::WriteParameterToMaxRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxRate = {}; + } + + void OverrideSteeringWheelActionImpl::WriteParameterToMaxTorque(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, parameterName, nullTextMarker /*no textmarker*/); + _maxTorque = {}; + } + + void OverrideSteeringWheelActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string OverrideSteeringWheelActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideSteeringWheelActionImpl::GetParameterFromMaxRate() const + { + auto maxRate = OSC_CONSTANTS::ATTRIBUTE__MAX_RATE; + return GetParameterNameFromAttribute(maxRate); + } + + std::string OverrideSteeringWheelActionImpl::GetParameterFromMaxTorque() const + { + auto maxTorque = OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE; + return GetParameterNameFromAttribute(maxTorque); + } + + std::string OverrideSteeringWheelActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool OverrideSteeringWheelActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideSteeringWheelActionImpl::IsMaxRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideSteeringWheelActionImpl::IsMaxTorqueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideSteeringWheelActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + OverrideSteeringWheelActionImpl::OverrideSteeringWheelActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void OverrideSteeringWheelActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE) + { + // Simple type + _maxTorque = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxTorque = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType OverrideSteeringWheelActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideSteeringWheelActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideSteeringWheelActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_maxRate = GetMaxRate(); + // Simple type + clonedObject->_maxTorque = GetMaxTorque(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetMaxRate = _isSetMaxRate; + clonedObject->_isSetMaxTorque = _isSetMaxTorque; + // clone children + return clonedObject; + } + + std::string OverrideSteeringWheelActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideSteeringWheelActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> OverrideSteeringWheelActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideSteeringWheelActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideSteeringWheelActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideSteeringWheelActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideSteeringWheelActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE) + { + // Simple type + _maxTorque = value; + AddResolvedParameter(attributeKey); + _isSetMaxTorque = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool OverrideSteeringWheelActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideSteeringWheelActionImpl::ResetMaxRate() + { + _isSetMaxRate = false; + _maxRate = {}; + + } + bool OverrideSteeringWheelActionImpl::IsSetMaxRate() const + { + return _isSetMaxRate; + } + void OverrideSteeringWheelActionImpl::ResetMaxTorque() + { + _isSetMaxTorque = false; + _maxTorque = {}; + + } + bool OverrideSteeringWheelActionImpl::IsSetMaxTorque() const + { + return _isSetMaxTorque; + } + bool OverrideSteeringWheelActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* OverrideThrottleActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool OverrideThrottleActionImpl::GetActive() const + { + return _active; + } + double OverrideThrottleActionImpl::GetMaxRate() const + { + return _maxRate; + } + double OverrideThrottleActionImpl::GetValue() const + { + return _value; + } + + + void OverrideThrottleActionImpl::SetActive(const bool active) + { + _active = active; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + _isSetActive = true; + } + + void OverrideThrottleActionImpl::SetMaxRate(const double maxRate) + { + _maxRate = maxRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + _isSetMaxRate = true; + } + + void OverrideThrottleActionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr OverrideThrottleActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(OverrideThrottleActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IOverrideThrottleAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IOverrideThrottleActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr OverrideThrottleActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t OverrideThrottleActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int OverrideThrottleActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double OverrideThrottleActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + return GetMaxRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t OverrideThrottleActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool OverrideThrottleActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + return GetActive(); + } + throw KeyNotSupportedException(); + + } + + DateTime OverrideThrottleActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr OverrideThrottleActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string OverrideThrottleActionImpl::GetModelType() const + { + return "OverrideThrottleAction"; + } + + void OverrideThrottleActionImpl::WriteParameterToActive(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, parameterName, nullTextMarker /*no textmarker*/); + _active = {}; + } + + void OverrideThrottleActionImpl::WriteParameterToMaxRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxRate = {}; + } + + void OverrideThrottleActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string OverrideThrottleActionImpl::GetParameterFromActive() const + { + auto active = OSC_CONSTANTS::ATTRIBUTE__ACTIVE; + return GetParameterNameFromAttribute(active); + } + + std::string OverrideThrottleActionImpl::GetParameterFromMaxRate() const + { + auto maxRate = OSC_CONSTANTS::ATTRIBUTE__MAX_RATE; + return GetParameterNameFromAttribute(maxRate); + } + + std::string OverrideThrottleActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool OverrideThrottleActionImpl::IsActiveParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ACTIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideThrottleActionImpl::IsMaxRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool OverrideThrottleActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + OverrideThrottleActionImpl::OverrideThrottleActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void OverrideThrottleActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType OverrideThrottleActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> OverrideThrottleActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr OverrideThrottleActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_active = GetActive(); + // Simple type + clonedObject->_maxRate = GetMaxRate(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetMaxRate = _isSetMaxRate; + // clone children + return clonedObject; + } + + std::string OverrideThrottleActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideThrottleActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> OverrideThrottleActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr OverrideThrottleActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string OverrideThrottleActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void OverrideThrottleActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ACTIVE) + { + // Simple type + _active = value; + AddResolvedParameter(attributeKey); + _isSetActive = true; + } + + } + void OverrideThrottleActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_RATE) + { + // Simple type + _maxRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool OverrideThrottleActionImpl::IsSetActive() const + { + return _isSetActive; + } + void OverrideThrottleActionImpl::ResetMaxRate() + { + _isSetMaxRate = false; + _maxRate = {}; + + } + bool OverrideThrottleActionImpl::IsSetMaxRate() const + { + return _isSetMaxRate; + } + bool OverrideThrottleActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> ParameterActionImpl::GetParameterRef() const + { + return _parameterRef; + } + std::shared_ptr ParameterActionImpl::GetSetAction() const + { + return _setAction; + } + std::shared_ptr ParameterActionImpl::GetModifyAction() const + { + return _modifyAction; + } + + + void ParameterActionImpl::SetParameterRef(std::shared_ptr> parameterRef) + { + _parameterRef = parameterRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF); + _isSetParameterRef = true; + } + + void ParameterActionImpl::SetSetAction(std::shared_ptr setAction) + { + _setAction = setAction; + _modifyAction = {}; + _isSetSetAction = true; + } + + void ParameterActionImpl::SetModifyAction(std::shared_ptr modifyAction) + { + _modifyAction = modifyAction; + _setAction = {}; + _isSetModifyAction = true; + } + + std::shared_ptr ParameterActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterActionImpl::GetModelType() const + { + return "ParameterAction"; + } + + void ParameterActionImpl::WriteParameterToParameterRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, parameterName, nullTextMarker /*no textmarker*/); + _parameterRef = {}; + } + + std::string ParameterActionImpl::GetParameterFromParameterRef() const + { + auto parameterRef = OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF; + return GetParameterNameFromAttribute(parameterRef); + } + + bool ParameterActionImpl::IsParameterRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ParameterActionImpl::GetWriterSetAction() const + { + return std::dynamic_pointer_cast(_setAction); + } + std::shared_ptr ParameterActionImpl::GetWriterModifyAction() const + { + return std::dynamic_pointer_cast(_modifyAction); + } + + ParameterActionImpl::ParameterActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, SimpleType::STRING); + } + + void ParameterActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _parameterRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetParameterRef = true; + } + } + + SimpleType ParameterActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterActionImpl::GetChildren() const + { + std::vector> result; + + const auto kSetAction = GetWriterSetAction(); + if (kSetAction) + { + result.push_back(std::dynamic_pointer_cast(kSetAction)); + } + const auto kModifyAction = GetWriterModifyAction(); + if (kModifyAction) + { + result.push_back(std::dynamic_pointer_cast(kModifyAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetParameterRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_parameterRef = proxy; + + // clone indicators + // clone children + const auto kSetAction = GetWriterSetAction(); + if (kSetAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSetAction)->Clone(); + auto clonedChildIParameterSetAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSetAction(std::dynamic_pointer_cast(clonedChildIParameterSetAction)); + } + const auto kModifyAction = GetWriterModifyAction(); + if (kModifyAction) + { + auto clonedChild = std::dynamic_pointer_cast(kModifyAction)->Clone(); + auto clonedChildIParameterModifyAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetModifyAction(std::dynamic_pointer_cast(clonedChildIParameterModifyAction)); + } + return clonedObject; + } + + std::string ParameterActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef!= nullptr ? parameterRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SET_ACTION) + { + return std::dynamic_pointer_cast(GetSetAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MODIFY_ACTION) + { + return std::dynamic_pointer_cast(GetModifyAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> ParameterActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef != nullptr ? std::dynamic_pointer_cast(parameterRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string ParameterActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ParameterActionImpl::IsSetParameterRef() const + { + return _isSetParameterRef; + } + bool ParameterActionImpl::IsSetSetAction() const + { + return _isSetSetAction; + } + bool ParameterActionImpl::IsSetModifyAction() const + { + return _isSetModifyAction; + } + + IOpenScenarioFlexElement* ParameterAddValueRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ParameterAddValueRuleImpl::GetValue() const + { + return _value; + } + + + void ParameterAddValueRuleImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ParameterAddValueRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterAddValueRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterAddValueRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterAddValueRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterAddValueRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterAddValueRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterAddValueRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterAddValueRuleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ParameterAddValueRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterAddValueRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterAddValueRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterAddValueRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterAddValueRuleImpl::GetModelType() const + { + return "ParameterAddValueRule"; + } + + void ParameterAddValueRuleImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterAddValueRuleImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterAddValueRuleImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterAddValueRuleImpl::ParameterAddValueRuleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void ParameterAddValueRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterAddValueRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterAddValueRuleImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterAddValueRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ParameterAddValueRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterAddValueRuleImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterAddValueRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterAddValueRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterAddValueRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ParameterAddValueRuleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool ParameterAddValueRuleImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterAssignmentImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> ParameterAssignmentImpl::GetParameterRef() const + { + return _parameterRef; + } + std::string ParameterAssignmentImpl::GetValue() const + { + return _value; + } + + + void ParameterAssignmentImpl::SetParameterRef(std::shared_ptr> parameterRef) + { + _parameterRef = parameterRef; + _isSetParameterRef = true; + } + + void ParameterAssignmentImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ParameterAssignmentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterAssignmentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterAssignment).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterAssignmentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterAssignmentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterAssignmentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterAssignmentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterAssignmentImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterAssignmentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterAssignmentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterAssignmentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterAssignmentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterAssignmentImpl::GetModelType() const + { + return "ParameterAssignment"; + } + + void ParameterAssignmentImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterAssignmentImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterAssignmentImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterAssignmentImpl::ParameterAssignmentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void ParameterAssignmentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterAssignmentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterAssignmentImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterAssignmentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetParameterRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_parameterRef = proxy; + + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ParameterAssignmentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef!= nullptr ? parameterRef->GetNameRef() : ""; + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterAssignmentImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterAssignmentImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterAssignmentImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef != nullptr ? std::dynamic_pointer_cast(parameterRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string ParameterAssignmentImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ParameterAssignmentImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + bool ParameterAssignmentImpl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + + bool ParameterAssignmentImpl::IsSetParameterRef() const + { + return _isSetParameterRef; + } + bool ParameterAssignmentImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> ParameterConditionImpl::GetParameterRef() const + { + return _parameterRef; + } + Rule ParameterConditionImpl::GetRule() const + { + return _rule; + } + std::string ParameterConditionImpl::GetValue() const + { + return _value; + } + + + void ParameterConditionImpl::SetParameterRef(std::shared_ptr> parameterRef) + { + _parameterRef = parameterRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF); + _isSetParameterRef = true; + } + + void ParameterConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void ParameterConditionImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ParameterConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterConditionImpl::GetModelType() const + { + return "ParameterCondition"; + } + + void ParameterConditionImpl::WriteParameterToParameterRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, parameterName, nullTextMarker /*no textmarker*/); + _parameterRef = {}; + } + + void ParameterConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void ParameterConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterConditionImpl::GetParameterFromParameterRef() const + { + auto parameterRef = OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF; + return GetParameterNameFromAttribute(parameterRef); + } + + std::string ParameterConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string ParameterConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterConditionImpl::IsParameterRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool ParameterConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ParameterConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterConditionImpl::ParameterConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void ParameterConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _parameterRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetParameterRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetParameterRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_parameterRef = proxy; + + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ParameterConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef!= nullptr ? parameterRef->GetNameRef() : ""; + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF) + { + // Get the Proxy + auto parameterRef = GetParameterRef(); + return parameterRef != nullptr ? std::dynamic_pointer_cast(parameterRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string ParameterConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void ParameterConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool ParameterConditionImpl::IsSetParameterRef() const + { + return _isSetParameterRef; + } + bool ParameterConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool ParameterConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterDeclarationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ParameterDeclarationImpl::GetName() const + { + return _name; + } + ParameterType ParameterDeclarationImpl::GetParameterType() const + { + return _parameterType; + } + std::string ParameterDeclarationImpl::GetValue() const + { + return _value; + } + std::vector> ParameterDeclarationImpl::GetConstraintGroups() const + { + std::vector> temp; + for(auto&& elm: _constraintGroups) + temp.push_back(elm); + return temp; + } + std::vector> ParameterDeclarationImpl::GetWriterConstraintGroups() const + { + return _constraintGroups; + } + + int ParameterDeclarationImpl::GetConstraintGroupsSize() const + { + return static_cast(_constraintGroups.size()); + } + + std::shared_ptr ParameterDeclarationImpl::GetConstraintGroupsAtIndex(unsigned int index) const + { + if (index >= 0 && _constraintGroups.size() > index) + { + return _constraintGroups[index]; + } + return nullptr; + } + + + void ParameterDeclarationImpl::SetName(const std::string name) + { + _name = name; + _isSetName = true; + } + + void ParameterDeclarationImpl::SetParameterType(const ParameterType parameterType) + { + _parameterType = parameterType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE); + _isSetParameterType = true; + } + + void ParameterDeclarationImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void ParameterDeclarationImpl::SetConstraintGroups(std::vector>& constraintGroups) + { + _constraintGroups = constraintGroups; + _isSetConstraintGroups = true; + } + + std::shared_ptr ParameterDeclarationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterDeclarationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterDeclaration).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterDeclarationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterDeclarationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterDeclarationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterDeclarationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterDeclarationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterDeclarationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterDeclarationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterDeclarationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterDeclarationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterDeclarationImpl::GetModelType() const + { + return "ParameterDeclaration"; + } + + void ParameterDeclarationImpl::WriteParameterToParameterType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _parameterType = {}; + } + + void ParameterDeclarationImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterDeclarationImpl::GetParameterFromParameterType() const + { + auto parameterType = OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE; + return GetParameterNameFromAttribute(parameterType); + } + + std::string ParameterDeclarationImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterDeclarationImpl::IsParameterTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ParameterDeclarationImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterDeclarationImpl::ParameterDeclarationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void ParameterDeclarationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE) + { + // Enumeration Type + const auto kResult = ParameterType::GetFromLiteral(parameterLiteralValue); + if (kResult != ParameterType::UNKNOWN) + { + _parameterType = kResult; + AddResolvedParameter(attributeKey); + _isSetParameterType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterDeclarationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterDeclarationImpl::GetChildren() const + { + std::vector> result; + + auto constraintGroups = GetWriterConstraintGroups(); + if (!constraintGroups.empty()) + { + for(auto&& item : constraintGroups) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterDeclarationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Enumeration Type + const auto kParameterType = GetParameterType(); + if ( kParameterType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_parameterType = ParameterType::GetFromLiteral(kParameterType.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + const auto kConstraintGroups = GetWriterConstraintGroups(); + if (!kConstraintGroups.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kConstraintGroups) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetConstraintGroups(clonedList); + } + return clonedObject; + } + + std::string ParameterDeclarationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterDeclarationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterDeclarationImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONSTRAINT_GROUP) + { + std::vector> vect; + for (auto&& elem : GetConstraintGroups()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterDeclarationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterDeclarationImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE) + { + auto parameterType = GetParameterType(); + return parameterType.GetLiteral() != "UNKNOWN" ? parameterType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void ParameterDeclarationImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + bool ParameterDeclarationImpl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + + bool ParameterDeclarationImpl::IsSetName() const + { + return _isSetName; + } + bool ParameterDeclarationImpl::IsSetParameterType() const + { + return _isSetParameterType; + } + bool ParameterDeclarationImpl::IsSetValue() const + { + return _isSetValue; + } + void ParameterDeclarationImpl::ResetConstraintGroups() + { + _isSetConstraintGroups = false; + _constraintGroups = {}; + + } + bool ParameterDeclarationImpl::IsSetConstraintGroups() const + { + return _isSetConstraintGroups; + } + + IOpenScenarioFlexElement* ParameterModifyActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ParameterModifyActionImpl::GetRule() const + { + return _rule; + } + + + void ParameterModifyActionImpl::SetRule(std::shared_ptr rule) + { + _rule = rule; + _isSetRule = true; + } + + std::shared_ptr ParameterModifyActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterModifyActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterModifyAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterModifyActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterModifyActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterModifyActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterModifyActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterModifyActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterModifyActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterModifyActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterModifyActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterModifyActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterModifyActionImpl::GetModelType() const + { + return "ParameterModifyAction"; + } + + // children + std::shared_ptr ParameterModifyActionImpl::GetWriterRule() const + { + return std::dynamic_pointer_cast(_rule); + } + + ParameterModifyActionImpl::ParameterModifyActionImpl() + { + /** + * Filling the property to type map + */ + } + + void ParameterModifyActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ParameterModifyActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterModifyActionImpl::GetChildren() const + { + std::vector> result; + + const auto kRule = GetWriterRule(); + if (kRule) + { + result.push_back(std::dynamic_pointer_cast(kRule)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterModifyActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRule = GetWriterRule(); + if (kRule) + { + auto clonedChild = std::dynamic_pointer_cast(kRule)->Clone(); + auto clonedChildIModifyRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRule(std::dynamic_pointer_cast(clonedChildIModifyRule)); + } + return clonedObject; + } + + std::string ParameterModifyActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterModifyActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RULE) + { + return std::dynamic_pointer_cast(GetRule()); + } + throw KeyNotSupportedException(); + } + + std::vector> ParameterModifyActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterModifyActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterModifyActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ParameterModifyActionImpl::IsSetRule() const + { + return _isSetRule; + } + + IOpenScenarioFlexElement* ParameterMultiplyByValueRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ParameterMultiplyByValueRuleImpl::GetValue() const + { + return _value; + } + + + void ParameterMultiplyByValueRuleImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ParameterMultiplyByValueRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterMultiplyByValueRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterMultiplyByValueRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterMultiplyByValueRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterMultiplyByValueRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterMultiplyByValueRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterMultiplyByValueRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterMultiplyByValueRuleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ParameterMultiplyByValueRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterMultiplyByValueRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterMultiplyByValueRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterMultiplyByValueRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterMultiplyByValueRuleImpl::GetModelType() const + { + return "ParameterMultiplyByValueRule"; + } + + void ParameterMultiplyByValueRuleImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterMultiplyByValueRuleImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterMultiplyByValueRuleImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterMultiplyByValueRuleImpl::ParameterMultiplyByValueRuleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void ParameterMultiplyByValueRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterMultiplyByValueRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterMultiplyByValueRuleImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterMultiplyByValueRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ParameterMultiplyByValueRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterMultiplyByValueRuleImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterMultiplyByValueRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterMultiplyByValueRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterMultiplyByValueRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ParameterMultiplyByValueRuleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool ParameterMultiplyByValueRuleImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterSetActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ParameterSetActionImpl::GetValue() const + { + return _value; + } + + + void ParameterSetActionImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ParameterSetActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterSetActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterSetAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterSetActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterSetActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterSetActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterSetActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterSetActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterSetActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterSetActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterSetActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterSetActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterSetActionImpl::GetModelType() const + { + return "ParameterSetAction"; + } + + void ParameterSetActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ParameterSetActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ParameterSetActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ParameterSetActionImpl::ParameterSetActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void ParameterSetActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ParameterSetActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterSetActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterSetActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ParameterSetActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterSetActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterSetActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterSetActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterSetActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ParameterSetActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool ParameterSetActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ParameterValueDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ParameterValueDistributionImpl::GetScenarioFile() const + { + return _scenarioFile; + } + std::shared_ptr ParameterValueDistributionImpl::GetDistributionDefinition() const + { + return _distributionDefinition; + } + + + void ParameterValueDistributionImpl::SetScenarioFile(std::shared_ptr scenarioFile) + { + _scenarioFile = scenarioFile; + _isSetScenarioFile = true; + } + + void ParameterValueDistributionImpl::SetDistributionDefinition(std::shared_ptr distributionDefinition) + { + _distributionDefinition = distributionDefinition; + _isSetDistributionDefinition = true; + } + + std::shared_ptr ParameterValueDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterValueDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterValueDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterValueDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterValueDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterValueDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterValueDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterValueDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterValueDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterValueDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterValueDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterValueDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterValueDistributionImpl::GetModelType() const + { + return "ParameterValueDistribution"; + } + + // children + std::shared_ptr ParameterValueDistributionImpl::GetWriterScenarioFile() const + { + return std::dynamic_pointer_cast(_scenarioFile); + } + std::shared_ptr ParameterValueDistributionImpl::GetWriterDistributionDefinition() const + { + return std::dynamic_pointer_cast(_distributionDefinition); + } + + ParameterValueDistributionImpl::ParameterValueDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void ParameterValueDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ParameterValueDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterValueDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kScenarioFile = GetWriterScenarioFile(); + if (kScenarioFile) + { + result.push_back(std::dynamic_pointer_cast(kScenarioFile)); + } + const auto kDistributionDefinition = GetWriterDistributionDefinition(); + if (kDistributionDefinition) + { + result.push_back(std::dynamic_pointer_cast(kDistributionDefinition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterValueDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kScenarioFile = GetWriterScenarioFile(); + if (kScenarioFile) + { + auto clonedChild = std::dynamic_pointer_cast(kScenarioFile)->Clone(); + auto clonedChildIFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetScenarioFile(std::dynamic_pointer_cast(clonedChildIFile)); + } + const auto kDistributionDefinition = GetWriterDistributionDefinition(); + if (kDistributionDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kDistributionDefinition)->Clone(); + auto clonedChildIDistributionDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDistributionDefinition(std::dynamic_pointer_cast(clonedChildIDistributionDefinition)); + } + return clonedObject; + } + + std::string ParameterValueDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SCENARIO_FILE) + { + return std::dynamic_pointer_cast(GetScenarioFile()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_DEFINITION) + { + return std::dynamic_pointer_cast(GetDistributionDefinition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ParameterValueDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterValueDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ParameterValueDistributionImpl::IsSetScenarioFile() const + { + return _isSetScenarioFile; + } + bool ParameterValueDistributionImpl::IsSetDistributionDefinition() const + { + return _isSetDistributionDefinition; + } + + IOpenScenarioFlexElement* ParameterValueDistributionDefinitionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ParameterValueDistributionDefinitionImpl::GetParameterValueDistribution() const + { + return _parameterValueDistribution; + } + + + void ParameterValueDistributionDefinitionImpl::SetParameterValueDistribution(std::shared_ptr parameterValueDistribution) + { + _parameterValueDistribution = parameterValueDistribution; + _isSetParameterValueDistribution = true; + } + + std::shared_ptr ParameterValueDistributionDefinitionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterValueDistributionDefinitionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterValueDistributionDefinition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterValueDistributionDefinitionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterValueDistributionDefinitionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterValueDistributionDefinitionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterValueDistributionDefinitionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterValueDistributionDefinitionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterValueDistributionDefinitionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterValueDistributionDefinitionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterValueDistributionDefinitionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterValueDistributionDefinitionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterValueDistributionDefinitionImpl::GetModelType() const + { + return "ParameterValueDistributionDefinition"; + } + + // children + std::shared_ptr ParameterValueDistributionDefinitionImpl::GetWriterParameterValueDistribution() const + { + return std::dynamic_pointer_cast(_parameterValueDistribution); + } + + ParameterValueDistributionDefinitionImpl::ParameterValueDistributionDefinitionImpl() + { + /** + * Filling the property to type map + */ + } + + void ParameterValueDistributionDefinitionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ParameterValueDistributionDefinitionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterValueDistributionDefinitionImpl::GetChildren() const + { + std::vector> result; + + const auto kParameterValueDistribution = GetWriterParameterValueDistribution(); + if (kParameterValueDistribution) + { + result.push_back(std::dynamic_pointer_cast(kParameterValueDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterValueDistributionDefinitionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kParameterValueDistribution = GetWriterParameterValueDistribution(); + if (kParameterValueDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kParameterValueDistribution)->Clone(); + auto clonedChildIParameterValueDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetParameterValueDistribution(std::dynamic_pointer_cast(clonedChildIParameterValueDistribution)); + } + return clonedObject; + } + + std::string ParameterValueDistributionDefinitionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueDistributionDefinitionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetParameterValueDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> ParameterValueDistributionDefinitionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueDistributionDefinitionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterValueDistributionDefinitionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ParameterValueDistributionDefinitionImpl::IsSetParameterValueDistribution() const + { + return _isSetParameterValueDistribution; + } + + IOpenScenarioFlexElement* ParameterValueSetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ParameterValueSetImpl::GetParameterAssignments() const + { + std::vector> temp; + for(auto&& elm: _parameterAssignments) + temp.push_back(elm); + return temp; + } + std::vector> ParameterValueSetImpl::GetWriterParameterAssignments() const + { + return _parameterAssignments; + } + + int ParameterValueSetImpl::GetParameterAssignmentsSize() const + { + return static_cast(_parameterAssignments.size()); + } + + std::shared_ptr ParameterValueSetImpl::GetParameterAssignmentsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterAssignments.size() > index) + { + return _parameterAssignments[index]; + } + return nullptr; + } + + + void ParameterValueSetImpl::SetParameterAssignments(std::vector>& parameterAssignments) + { + _parameterAssignments = parameterAssignments; + _isSetParameterAssignments = true; + } + + std::shared_ptr ParameterValueSetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ParameterValueSetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IParameterValueSet).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IParameterValueSetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ParameterValueSetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ParameterValueSetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ParameterValueSetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ParameterValueSetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ParameterValueSetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ParameterValueSetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ParameterValueSetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ParameterValueSetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ParameterValueSetImpl::GetModelType() const + { + return "ParameterValueSet"; + } + + // children + + ParameterValueSetImpl::ParameterValueSetImpl() + { + /** + * Filling the property to type map + */ + } + + void ParameterValueSetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ParameterValueSetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ParameterValueSetImpl::GetChildren() const + { + std::vector> result; + + auto parameterAssignments = GetWriterParameterAssignments(); + if (!parameterAssignments.empty()) + { + for(auto&& item : parameterAssignments) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ParameterValueSetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kParameterAssignments = GetWriterParameterAssignments(); + if (!kParameterAssignments.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterAssignments) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterAssignments(clonedList); + } + return clonedObject; + } + + std::string ParameterValueSetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueSetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ParameterValueSetImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT) + { + std::vector> vect; + for (auto&& elem : GetParameterAssignments()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ParameterValueSetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ParameterValueSetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ParameterValueSetImpl::IsSetParameterAssignments() const + { + return _isSetParameterAssignments; + } + + IOpenScenarioFlexElement* PedestrianImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PedestrianImpl::GetMass() const + { + return _mass; + } + std::string PedestrianImpl::GetModel() const + { + return _model; + } + std::string PedestrianImpl::GetModel3d() const + { + return _model3d; + } + std::string PedestrianImpl::GetName() const + { + return _name; + } + PedestrianCategory PedestrianImpl::GetPedestrianCategory() const + { + return _pedestrianCategory; + } + Role PedestrianImpl::GetRole() const + { + return _role; + } + std::vector> PedestrianImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> PedestrianImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int PedestrianImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr PedestrianImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr PedestrianImpl::GetBoundingBox() const + { + return _boundingBox; + } + std::shared_ptr PedestrianImpl::GetProperties() const + { + return _properties; + } + + + void PedestrianImpl::SetMass(const double mass) + { + _mass = mass; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS); + _isSetMass = true; + } + + void PedestrianImpl::SetModel(const std::string model) + { + _model = model; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL); + _isSetModel = true; + } + + void PedestrianImpl::SetModel3d(const std::string model3d) + { + _model3d = model3d; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + _isSetModel3d = true; + } + + void PedestrianImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void PedestrianImpl::SetPedestrianCategory(const PedestrianCategory pedestrianCategory) + { + _pedestrianCategory = pedestrianCategory; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY); + _isSetPedestrianCategory = true; + } + + void PedestrianImpl::SetRole(const Role role) + { + _role = role; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE); + _isSetRole = true; + } + + void PedestrianImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void PedestrianImpl::SetBoundingBox(std::shared_ptr boundingBox) + { + _boundingBox = boundingBox; + _isSetBoundingBox = true; + } + + void PedestrianImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr PedestrianImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PedestrianImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPedestrian).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPedestrianWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PedestrianImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PedestrianImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PedestrianImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PedestrianImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + return GetMass(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PedestrianImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PedestrianImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PedestrianImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PedestrianImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PedestrianImpl::GetModelType() const + { + return "Pedestrian"; + } + + void PedestrianImpl::WriteParameterToMass(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, parameterName, nullTextMarker /*no textmarker*/); + _mass = {}; + } + + void PedestrianImpl::WriteParameterToModel(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL, parameterName, nullTextMarker /*no textmarker*/); + _model = {}; + } + + void PedestrianImpl::WriteParameterToModel3d(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, parameterName, nullTextMarker /*no textmarker*/); + _model3d = {}; + } + + void PedestrianImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void PedestrianImpl::WriteParameterToPedestrianCategory(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, parameterName, nullTextMarker /*no textmarker*/); + _pedestrianCategory = {}; + } + + void PedestrianImpl::WriteParameterToRole(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, parameterName, nullTextMarker /*no textmarker*/); + _role = {}; + } + + std::string PedestrianImpl::GetParameterFromMass() const + { + auto mass = OSC_CONSTANTS::ATTRIBUTE__MASS; + return GetParameterNameFromAttribute(mass); + } + + std::string PedestrianImpl::GetParameterFromModel() const + { + auto model = OSC_CONSTANTS::ATTRIBUTE__MODEL; + return GetParameterNameFromAttribute(model); + } + + std::string PedestrianImpl::GetParameterFromModel3d() const + { + auto model3d = OSC_CONSTANTS::ATTRIBUTE__MODEL3D; + return GetParameterNameFromAttribute(model3d); + } + + std::string PedestrianImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string PedestrianImpl::GetParameterFromPedestrianCategory() const + { + auto pedestrianCategory = OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY; + return GetParameterNameFromAttribute(pedestrianCategory); + } + + std::string PedestrianImpl::GetParameterFromRole() const + { + auto role = OSC_CONSTANTS::ATTRIBUTE__ROLE; + return GetParameterNameFromAttribute(role); + } + + bool PedestrianImpl::IsMassParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MASS); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianImpl::IsModelParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MODEL); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianImpl::IsModel3dParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianImpl::IsPedestrianCategoryParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianImpl::IsRoleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROLE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr PedestrianImpl::GetWriterBoundingBox() const + { + return std::dynamic_pointer_cast(_boundingBox); + } + std::shared_ptr PedestrianImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + PedestrianImpl::PedestrianImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MASS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MODEL, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROLE, SimpleType::ENUM_TYPE); + } + + void PedestrianImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL) + { + // Simple type + _model = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetModel = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY) + { + // Enumeration Type + const auto kResult = PedestrianCategory::GetFromLiteral(parameterLiteralValue); + if (kResult != PedestrianCategory::UNKNOWN) + { + _pedestrianCategory = kResult; + AddResolvedParameter(attributeKey); + _isSetPedestrianCategory = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + // Enumeration Type + const auto kResult = Role::GetFromLiteral(parameterLiteralValue); + if (kResult != Role::UNKNOWN) + { + _role = kResult; + AddResolvedParameter(attributeKey); + _isSetRole = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType PedestrianImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool PedestrianImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> PedestrianImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PedestrianImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + result.push_back(std::dynamic_pointer_cast(kBoundingBox)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PedestrianImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_mass = GetMass(); + // Simple type + clonedObject->_model = GetModel(); + // Simple type + clonedObject->_model3d = GetModel3d(); + // Simple type + clonedObject->_name = GetName(); + // Enumeration Type + const auto kPedestrianCategory = GetPedestrianCategory(); + if ( kPedestrianCategory.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_pedestrianCategory = PedestrianCategory::GetFromLiteral(kPedestrianCategory.GetLiteral()); + } + // Enumeration Type + const auto kRole = GetRole(); + if ( kRole.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_role = Role::GetFromLiteral(kRole.GetLiteral()); + } + // clone indicators + clonedObject->_isSetModel = _isSetModel; + clonedObject->_isSetModel3d = _isSetModel3d; + clonedObject->_isSetRole = _isSetRole; + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + auto clonedChild = std::dynamic_pointer_cast(kBoundingBox)->Clone(); + auto clonedChildIBoundingBox = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBoundingBox(std::dynamic_pointer_cast(clonedChildIBoundingBox)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string PedestrianImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MODEL) + { + return GetModel(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + return GetModel3d(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX) + { + return std::dynamic_pointer_cast(GetBoundingBox()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> PedestrianImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PedestrianImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY) + { + auto pedestrianCategory = GetPedestrianCategory(); + return pedestrianCategory.GetLiteral() != "UNKNOWN" ? pedestrianCategory.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + auto role = GetRole(); + return role.GetLiteral() != "UNKNOWN" ? role.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void PedestrianImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL) + { + // Simple type + _model = value; + AddResolvedParameter(attributeKey); + _isSetModel = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = value; + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + void PedestrianImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = value; + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + + } + + + bool PedestrianImpl::IsSetMass() const + { + return _isSetMass; + } + void PedestrianImpl::ResetModel() + { + _isSetModel = false; + _model = {}; + + } + bool PedestrianImpl::IsSetModel() const + { + return _isSetModel; + } + void PedestrianImpl::ResetModel3d() + { + _isSetModel3d = false; + _model3d = {}; + + } + bool PedestrianImpl::IsSetModel3d() const + { + return _isSetModel3d; + } + bool PedestrianImpl::IsSetName() const + { + return _isSetName; + } + bool PedestrianImpl::IsSetPedestrianCategory() const + { + return _isSetPedestrianCategory; + } + void PedestrianImpl::ResetRole() + { + _isSetRole = false; + _role = {Role::RoleEnum::NONE}; + + } + bool PedestrianImpl::IsSetRole() const + { + return _isSetRole; + } + void PedestrianImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool PedestrianImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool PedestrianImpl::IsSetBoundingBox() const + { + return _isSetBoundingBox; + } + void PedestrianImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool PedestrianImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* PedestrianAnimationImpl::GetOpenScenarioFlexElement() + { + return this; + } + PedestrianMotionType PedestrianAnimationImpl::GetMotion() const + { + return _motion; + } + std::string PedestrianAnimationImpl::GetUserDefinedPedestrianAnimation() const + { + return _userDefinedPedestrianAnimation; + } + std::vector> PedestrianAnimationImpl::GetGestures() const + { + std::vector> temp; + for(auto&& elm: _gestures) + temp.push_back(elm); + return temp; + } + std::vector> PedestrianAnimationImpl::GetWriterGestures() const + { + return _gestures; + } + + int PedestrianAnimationImpl::GetGesturesSize() const + { + return static_cast(_gestures.size()); + } + + std::shared_ptr PedestrianAnimationImpl::GetGesturesAtIndex(unsigned int index) const + { + if (index >= 0 && _gestures.size() > index) + { + return _gestures[index]; + } + return nullptr; + } + + + void PedestrianAnimationImpl::SetMotion(const PedestrianMotionType motion) + { + _motion = motion; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MOTION); + _isSetMotion = true; + } + + void PedestrianAnimationImpl::SetUserDefinedPedestrianAnimation(const std::string userDefinedPedestrianAnimation) + { + _userDefinedPedestrianAnimation = userDefinedPedestrianAnimation; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION); + _isSetUserDefinedPedestrianAnimation = true; + } + + void PedestrianAnimationImpl::SetGestures(std::vector>& gestures) + { + _gestures = gestures; + _isSetGestures = true; + } + + std::shared_ptr PedestrianAnimationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PedestrianAnimationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPedestrianAnimation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPedestrianAnimationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PedestrianAnimationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PedestrianAnimationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PedestrianAnimationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PedestrianAnimationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PedestrianAnimationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PedestrianAnimationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PedestrianAnimationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PedestrianAnimationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PedestrianAnimationImpl::GetModelType() const + { + return "PedestrianAnimation"; + } + + void PedestrianAnimationImpl::WriteParameterToMotion(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MOTION, parameterName, nullTextMarker /*no textmarker*/); + _motion = {}; + } + + void PedestrianAnimationImpl::WriteParameterToUserDefinedPedestrianAnimation(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, parameterName, nullTextMarker /*no textmarker*/); + _userDefinedPedestrianAnimation = {}; + } + + std::string PedestrianAnimationImpl::GetParameterFromMotion() const + { + auto motion = OSC_CONSTANTS::ATTRIBUTE__MOTION; + return GetParameterNameFromAttribute(motion); + } + + std::string PedestrianAnimationImpl::GetParameterFromUserDefinedPedestrianAnimation() const + { + auto userDefinedPedestrianAnimation = OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION; + return GetParameterNameFromAttribute(userDefinedPedestrianAnimation); + } + + bool PedestrianAnimationImpl::IsMotionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MOTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool PedestrianAnimationImpl::IsUserDefinedPedestrianAnimationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PedestrianAnimationImpl::PedestrianAnimationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MOTION, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, SimpleType::STRING); + } + + void PedestrianAnimationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MOTION) + { + // Enumeration Type + const auto kResult = PedestrianMotionType::GetFromLiteral(parameterLiteralValue); + if (kResult != PedestrianMotionType::UNKNOWN) + { + _motion = kResult; + AddResolvedParameter(attributeKey); + _isSetMotion = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION) + { + // Simple type + _userDefinedPedestrianAnimation = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetUserDefinedPedestrianAnimation = true; + } + } + + SimpleType PedestrianAnimationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PedestrianAnimationImpl::GetChildren() const + { + std::vector> result; + + auto gestures = GetWriterGestures(); + if (!gestures.empty()) + { + for(auto&& item : gestures) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PedestrianAnimationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kMotion = GetMotion(); + if ( kMotion.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_motion = PedestrianMotionType::GetFromLiteral(kMotion.GetLiteral()); + } + // Simple type + clonedObject->_userDefinedPedestrianAnimation = GetUserDefinedPedestrianAnimation(); + // clone indicators + clonedObject->_isSetMotion = _isSetMotion; + clonedObject->_isSetUserDefinedPedestrianAnimation = _isSetUserDefinedPedestrianAnimation; + // clone children + const auto kGestures = GetWriterGestures(); + if (!kGestures.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kGestures) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetGestures(clonedList); + } + return clonedObject; + } + + std::string PedestrianAnimationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION) + { + return GetUserDefinedPedestrianAnimation(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianAnimationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PedestrianAnimationImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_GESTURE) + { + std::vector> vect; + for (auto&& elem : GetGestures()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianAnimationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PedestrianAnimationImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MOTION) + { + auto motion = GetMotion(); + return motion.GetLiteral() != "UNKNOWN" ? motion.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void PedestrianAnimationImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION) + { + // Simple type + _userDefinedPedestrianAnimation = value; + AddResolvedParameter(attributeKey); + _isSetUserDefinedPedestrianAnimation = true; + } + + } + + + void PedestrianAnimationImpl::ResetMotion() + { + _isSetMotion = false; + _motion = {}; + + } + bool PedestrianAnimationImpl::IsSetMotion() const + { + return _isSetMotion; + } + void PedestrianAnimationImpl::ResetUserDefinedPedestrianAnimation() + { + _isSetUserDefinedPedestrianAnimation = false; + _userDefinedPedestrianAnimation = {}; + + } + bool PedestrianAnimationImpl::IsSetUserDefinedPedestrianAnimation() const + { + return _isSetUserDefinedPedestrianAnimation; + } + void PedestrianAnimationImpl::ResetGestures() + { + _isSetGestures = false; + _gestures = {}; + + } + bool PedestrianAnimationImpl::IsSetGestures() const + { + return _isSetGestures; + } + + IOpenScenarioFlexElement* PedestrianCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr PedestrianCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void PedestrianCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr PedestrianCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PedestrianCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPedestrianCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPedestrianCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PedestrianCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PedestrianCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PedestrianCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PedestrianCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PedestrianCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PedestrianCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PedestrianCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PedestrianCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PedestrianCatalogLocationImpl::GetModelType() const + { + return "PedestrianCatalogLocation"; + } + + // children + std::shared_ptr PedestrianCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + PedestrianCatalogLocationImpl::PedestrianCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void PedestrianCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PedestrianCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PedestrianCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PedestrianCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string PedestrianCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> PedestrianCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PedestrianCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PedestrianCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* PedestrianGestureImpl::GetOpenScenarioFlexElement() + { + return this; + } + PedestrianGestureType PedestrianGestureImpl::GetGesture() const + { + return _gesture; + } + + + void PedestrianGestureImpl::SetGesture(const PedestrianGestureType gesture) + { + _gesture = gesture; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GESTURE); + _isSetGesture = true; + } + + std::shared_ptr PedestrianGestureImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PedestrianGestureImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPedestrianGesture).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPedestrianGestureWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PedestrianGestureImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PedestrianGestureImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PedestrianGestureImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PedestrianGestureImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PedestrianGestureImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PedestrianGestureImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PedestrianGestureImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PedestrianGestureImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PedestrianGestureImpl::GetModelType() const + { + return "PedestrianGesture"; + } + + void PedestrianGestureImpl::WriteParameterToGesture(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GESTURE, parameterName, nullTextMarker /*no textmarker*/); + _gesture = {}; + } + + std::string PedestrianGestureImpl::GetParameterFromGesture() const + { + auto gesture = OSC_CONSTANTS::ATTRIBUTE__GESTURE; + return GetParameterNameFromAttribute(gesture); + } + + bool PedestrianGestureImpl::IsGestureParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__GESTURE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PedestrianGestureImpl::PedestrianGestureImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__GESTURE, SimpleType::ENUM_TYPE); + } + + void PedestrianGestureImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GESTURE) + { + // Enumeration Type + const auto kResult = PedestrianGestureType::GetFromLiteral(parameterLiteralValue); + if (kResult != PedestrianGestureType::UNKNOWN) + { + _gesture = kResult; + AddResolvedParameter(attributeKey); + _isSetGesture = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType PedestrianGestureImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PedestrianGestureImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PedestrianGestureImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kGesture = GetGesture(); + if ( kGesture.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_gesture = PedestrianGestureType::GetFromLiteral(kGesture.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string PedestrianGestureImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianGestureImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PedestrianGestureImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PedestrianGestureImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PedestrianGestureImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__GESTURE) + { + auto gesture = GetGesture(); + return gesture.GetLiteral() != "UNKNOWN" ? gesture.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool PedestrianGestureImpl::IsSetGesture() const + { + return _isSetGesture; + } + + IOpenScenarioFlexElement* PerformanceImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PerformanceImpl::GetMaxAcceleration() const + { + return _maxAcceleration; + } + double PerformanceImpl::GetMaxAccelerationRate() const + { + return _maxAccelerationRate; + } + double PerformanceImpl::GetMaxDeceleration() const + { + return _maxDeceleration; + } + double PerformanceImpl::GetMaxDecelerationRate() const + { + return _maxDecelerationRate; + } + double PerformanceImpl::GetMaxSpeed() const + { + return _maxSpeed; + } + + + void PerformanceImpl::SetMaxAcceleration(const double maxAcceleration) + { + _maxAcceleration = maxAcceleration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + _isSetMaxAcceleration = true; + } + + void PerformanceImpl::SetMaxAccelerationRate(const double maxAccelerationRate) + { + _maxAccelerationRate = maxAccelerationRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + _isSetMaxAccelerationRate = true; + } + + void PerformanceImpl::SetMaxDeceleration(const double maxDeceleration) + { + _maxDeceleration = maxDeceleration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + _isSetMaxDeceleration = true; + } + + void PerformanceImpl::SetMaxDecelerationRate(const double maxDecelerationRate) + { + _maxDecelerationRate = maxDecelerationRate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + _isSetMaxDecelerationRate = true; + } + + void PerformanceImpl::SetMaxSpeed(const double maxSpeed) + { + _maxSpeed = maxSpeed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + _isSetMaxSpeed = true; + } + + std::shared_ptr PerformanceImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PerformanceImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPerformance).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPerformanceWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PerformanceImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PerformanceImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PerformanceImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PerformanceImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + return GetMaxAcceleration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + return GetMaxAccelerationRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + return GetMaxDeceleration(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + return GetMaxDecelerationRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + return GetMaxSpeed(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PerformanceImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PerformanceImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PerformanceImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PerformanceImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PerformanceImpl::GetModelType() const + { + return "Performance"; + } + + void PerformanceImpl::WriteParameterToMaxAcceleration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, parameterName, nullTextMarker /*no textmarker*/); + _maxAcceleration = {}; + } + + void PerformanceImpl::WriteParameterToMaxAccelerationRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxAccelerationRate = {}; + } + + void PerformanceImpl::WriteParameterToMaxDeceleration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, parameterName, nullTextMarker /*no textmarker*/); + _maxDeceleration = {}; + } + + void PerformanceImpl::WriteParameterToMaxDecelerationRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, parameterName, nullTextMarker /*no textmarker*/); + _maxDecelerationRate = {}; + } + + void PerformanceImpl::WriteParameterToMaxSpeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, parameterName, nullTextMarker /*no textmarker*/); + _maxSpeed = {}; + } + + std::string PerformanceImpl::GetParameterFromMaxAcceleration() const + { + auto maxAcceleration = OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION; + return GetParameterNameFromAttribute(maxAcceleration); + } + + std::string PerformanceImpl::GetParameterFromMaxAccelerationRate() const + { + auto maxAccelerationRate = OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE; + return GetParameterNameFromAttribute(maxAccelerationRate); + } + + std::string PerformanceImpl::GetParameterFromMaxDeceleration() const + { + auto maxDeceleration = OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION; + return GetParameterNameFromAttribute(maxDeceleration); + } + + std::string PerformanceImpl::GetParameterFromMaxDecelerationRate() const + { + auto maxDecelerationRate = OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE; + return GetParameterNameFromAttribute(maxDecelerationRate); + } + + std::string PerformanceImpl::GetParameterFromMaxSpeed() const + { + auto maxSpeed = OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED; + return GetParameterNameFromAttribute(maxSpeed); + } + + bool PerformanceImpl::IsMaxAccelerationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool PerformanceImpl::IsMaxAccelerationRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool PerformanceImpl::IsMaxDecelerationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool PerformanceImpl::IsMaxDecelerationRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool PerformanceImpl::IsMaxSpeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PerformanceImpl::PerformanceImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, SimpleType::DOUBLE); + } + + void PerformanceImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + // Simple type + _maxAcceleration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxAcceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + // Simple type + _maxAccelerationRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxAccelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + // Simple type + _maxDeceleration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxDeceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + // Simple type + _maxDecelerationRate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxDecelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + // Simple type + _maxSpeed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMaxSpeed = true; + } + } + + SimpleType PerformanceImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PerformanceImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PerformanceImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_maxAcceleration = GetMaxAcceleration(); + // Simple type + clonedObject->_maxAccelerationRate = GetMaxAccelerationRate(); + // Simple type + clonedObject->_maxDeceleration = GetMaxDeceleration(); + // Simple type + clonedObject->_maxDecelerationRate = GetMaxDecelerationRate(); + // Simple type + clonedObject->_maxSpeed = GetMaxSpeed(); + // clone indicators + clonedObject->_isSetMaxAccelerationRate = _isSetMaxAccelerationRate; + clonedObject->_isSetMaxDecelerationRate = _isSetMaxDecelerationRate; + // clone children + return clonedObject; + } + + std::string PerformanceImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PerformanceImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PerformanceImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PerformanceImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PerformanceImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PerformanceImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION) + { + // Simple type + _maxAcceleration = value; + AddResolvedParameter(attributeKey); + _isSetMaxAcceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE) + { + // Simple type + _maxAccelerationRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxAccelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION) + { + // Simple type + _maxDeceleration = value; + AddResolvedParameter(attributeKey); + _isSetMaxDeceleration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE) + { + // Simple type + _maxDecelerationRate = value; + AddResolvedParameter(attributeKey); + _isSetMaxDecelerationRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED) + { + // Simple type + _maxSpeed = value; + AddResolvedParameter(attributeKey); + _isSetMaxSpeed = true; + } + + } + + + bool PerformanceImpl::IsSetMaxAcceleration() const + { + return _isSetMaxAcceleration; + } + void PerformanceImpl::ResetMaxAccelerationRate() + { + _isSetMaxAccelerationRate = false; + _maxAccelerationRate = {}; + + } + bool PerformanceImpl::IsSetMaxAccelerationRate() const + { + return _isSetMaxAccelerationRate; + } + bool PerformanceImpl::IsSetMaxDeceleration() const + { + return _isSetMaxDeceleration; + } + void PerformanceImpl::ResetMaxDecelerationRate() + { + _isSetMaxDecelerationRate = false; + _maxDecelerationRate = {}; + + } + bool PerformanceImpl::IsSetMaxDecelerationRate() const + { + return _isSetMaxDecelerationRate; + } + bool PerformanceImpl::IsSetMaxSpeed() const + { + return _isSetMaxSpeed; + } + + IOpenScenarioFlexElement* PhaseImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PhaseImpl::GetDuration() const + { + return _duration; + } + std::string PhaseImpl::GetName() const + { + return _name; + } + std::vector> PhaseImpl::GetTrafficSignalStates() const + { + std::vector> temp; + for(auto&& elm: _trafficSignalStates) + temp.push_back(elm); + return temp; + } + std::vector> PhaseImpl::GetWriterTrafficSignalStates() const + { + return _trafficSignalStates; + } + + int PhaseImpl::GetTrafficSignalStatesSize() const + { + return static_cast(_trafficSignalStates.size()); + } + + std::shared_ptr PhaseImpl::GetTrafficSignalStatesAtIndex(unsigned int index) const + { + if (index >= 0 && _trafficSignalStates.size() > index) + { + return _trafficSignalStates[index]; + } + return nullptr; + } + std::shared_ptr PhaseImpl::GetTrafficSignalGroupState() const + { + return _trafficSignalGroupState; + } + + + void PhaseImpl::SetDuration(const double duration) + { + _duration = duration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION); + _isSetDuration = true; + } + + void PhaseImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void PhaseImpl::SetTrafficSignalStates(std::vector>& trafficSignalStates) + { + _trafficSignalStates = trafficSignalStates; + _isSetTrafficSignalStates = true; + } + + void PhaseImpl::SetTrafficSignalGroupState(std::shared_ptr trafficSignalGroupState) + { + _trafficSignalGroupState = trafficSignalGroupState; + _isSetTrafficSignalGroupState = true; + } + + std::shared_ptr PhaseImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PhaseImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPhase).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPhaseWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PhaseImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PhaseImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PhaseImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PhaseImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + return GetDuration(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PhaseImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PhaseImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PhaseImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PhaseImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PhaseImpl::GetModelType() const + { + return "Phase"; + } + + void PhaseImpl::WriteParameterToDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, parameterName, nullTextMarker /*no textmarker*/); + _duration = {}; + } + + void PhaseImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string PhaseImpl::GetParameterFromDuration() const + { + auto duration = OSC_CONSTANTS::ATTRIBUTE__DURATION; + return GetParameterNameFromAttribute(duration); + } + + std::string PhaseImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool PhaseImpl::IsDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool PhaseImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr PhaseImpl::GetWriterTrafficSignalGroupState() const + { + return std::dynamic_pointer_cast(_trafficSignalGroupState); + } + + PhaseImpl::PhaseImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DURATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void PhaseImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType PhaseImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PhaseImpl::GetChildren() const + { + std::vector> result; + + auto trafficSignalStates = GetWriterTrafficSignalStates(); + if (!trafficSignalStates.empty()) + { + for(auto&& item : trafficSignalStates) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kTrafficSignalGroupState = GetWriterTrafficSignalGroupState(); + if (kTrafficSignalGroupState) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalGroupState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PhaseImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_duration = GetDuration(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kTrafficSignalStates = GetWriterTrafficSignalStates(); + if (!kTrafficSignalStates.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kTrafficSignalStates) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetTrafficSignalStates(clonedList); + } + const auto kTrafficSignalGroupState = GetWriterTrafficSignalGroupState(); + if (kTrafficSignalGroupState) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalGroupState)->Clone(); + auto clonedChildITrafficSignalGroupState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalGroupState(std::dynamic_pointer_cast(clonedChildITrafficSignalGroupState)); + } + return clonedObject; + } + + std::string PhaseImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PhaseImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_GROUP_STATE) + { + return std::dynamic_pointer_cast(GetTrafficSignalGroupState()); + } + throw KeyNotSupportedException(); + } + + std::vector> PhaseImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE) + { + std::vector> vect; + for (auto&& elem : GetTrafficSignalStates()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PhaseImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PhaseImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PhaseImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + void PhaseImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = value; + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + + } + + + bool PhaseImpl::IsSetDuration() const + { + return _isSetDuration; + } + bool PhaseImpl::IsSetName() const + { + return _isSetName; + } + void PhaseImpl::ResetTrafficSignalStates() + { + _isSetTrafficSignalStates = false; + _trafficSignalStates = {}; + + } + bool PhaseImpl::IsSetTrafficSignalStates() const + { + return _isSetTrafficSignalStates; + } + void PhaseImpl::ResetTrafficSignalGroupState() + { + _isSetTrafficSignalGroupState = false; + _trafficSignalGroupState = {}; + + } + bool PhaseImpl::IsSetTrafficSignalGroupState() const + { + return _isSetTrafficSignalGroupState; + } + + IOpenScenarioFlexElement* PoissonDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PoissonDistributionImpl::GetExpectedValue() const + { + return _expectedValue; + } + std::shared_ptr PoissonDistributionImpl::GetRange() const + { + return _range; + } + + + void PoissonDistributionImpl::SetExpectedValue(const double expectedValue) + { + _expectedValue = expectedValue; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + _isSetExpectedValue = true; + } + + void PoissonDistributionImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr PoissonDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PoissonDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPoissonDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPoissonDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PoissonDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PoissonDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PoissonDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PoissonDistributionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + return GetExpectedValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PoissonDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PoissonDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PoissonDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PoissonDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PoissonDistributionImpl::GetModelType() const + { + return "PoissonDistribution"; + } + + void PoissonDistributionImpl::WriteParameterToExpectedValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, parameterName, nullTextMarker /*no textmarker*/); + _expectedValue = {}; + } + + std::string PoissonDistributionImpl::GetParameterFromExpectedValue() const + { + auto expectedValue = OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE; + return GetParameterNameFromAttribute(expectedValue); + } + + bool PoissonDistributionImpl::IsExpectedValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr PoissonDistributionImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + PoissonDistributionImpl::PoissonDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, SimpleType::DOUBLE); + } + + void PoissonDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + } + + SimpleType PoissonDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PoissonDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PoissonDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_expectedValue = GetExpectedValue(); + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string PoissonDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PoissonDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> PoissonDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PoissonDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PoissonDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PoissonDistributionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE) + { + // Simple type + _expectedValue = value; + AddResolvedParameter(attributeKey); + _isSetExpectedValue = true; + } + + } + + + bool PoissonDistributionImpl::IsSetExpectedValue() const + { + return _isSetExpectedValue; + } + void PoissonDistributionImpl::ResetRange() + { + _isSetRange = false; + _range = {}; + + } + bool PoissonDistributionImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* PolygonImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> PolygonImpl::GetPositions() const + { + std::vector> temp; + for(auto&& elm: _positions) + temp.push_back(elm); + return temp; + } + std::vector> PolygonImpl::GetWriterPositions() const + { + return _positions; + } + + int PolygonImpl::GetPositionsSize() const + { + return static_cast(_positions.size()); + } + + std::shared_ptr PolygonImpl::GetPositionsAtIndex(unsigned int index) const + { + if (index >= 0 && _positions.size() > index) + { + return _positions[index]; + } + return nullptr; + } + + + void PolygonImpl::SetPositions(std::vector>& positions) + { + _positions = positions; + _isSetPositions = true; + } + + std::shared_ptr PolygonImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PolygonImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPolygon).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPolygonWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PolygonImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PolygonImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PolygonImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PolygonImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PolygonImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PolygonImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PolygonImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PolygonImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PolygonImpl::GetModelType() const + { + return "Polygon"; + } + + // children + + PolygonImpl::PolygonImpl() + { + /** + * Filling the property to type map + */ + } + + void PolygonImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PolygonImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PolygonImpl::GetChildren() const + { + std::vector> result; + + auto positions = GetWriterPositions(); + if (!positions.empty()) + { + for(auto&& item : positions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PolygonImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPositions = GetWriterPositions(); + if (!kPositions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPositions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPositions(clonedList); + } + return clonedObject; + } + + std::string PolygonImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PolygonImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PolygonImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + std::vector> vect; + for (auto&& elem : GetPositions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PolygonImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PolygonImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PolygonImpl::IsSetPositions() const + { + return _isSetPositions; + } + + IOpenScenarioFlexElement* PolylineImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> PolylineImpl::GetVertices() const + { + std::vector> temp; + for(auto&& elm: _vertices) + temp.push_back(elm); + return temp; + } + std::vector> PolylineImpl::GetWriterVertices() const + { + return _vertices; + } + + int PolylineImpl::GetVerticesSize() const + { + return static_cast(_vertices.size()); + } + + std::shared_ptr PolylineImpl::GetVerticesAtIndex(unsigned int index) const + { + if (index >= 0 && _vertices.size() > index) + { + return _vertices[index]; + } + return nullptr; + } + + + void PolylineImpl::SetVertices(std::vector>& vertices) + { + _vertices = vertices; + _isSetVertices = true; + } + + std::shared_ptr PolylineImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PolylineImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPolyline).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPolylineWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PolylineImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PolylineImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PolylineImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PolylineImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PolylineImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PolylineImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PolylineImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PolylineImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PolylineImpl::GetModelType() const + { + return "Polyline"; + } + + // children + + PolylineImpl::PolylineImpl() + { + /** + * Filling the property to type map + */ + } + + void PolylineImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PolylineImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PolylineImpl::GetChildren() const + { + std::vector> result; + + auto vertices = GetWriterVertices(); + if (!vertices.empty()) + { + for(auto&& item : vertices) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PolylineImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVertices = GetWriterVertices(); + if (!kVertices.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kVertices) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetVertices(clonedList); + } + return clonedObject; + } + + std::string PolylineImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PolylineImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PolylineImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VERTEX) + { + std::vector> vect; + for (auto&& elem : GetVertices()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PolylineImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PolylineImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PolylineImpl::IsSetVertices() const + { + return _isSetVertices; + } + + IOpenScenarioFlexElement* PositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr PositionImpl::GetWorldPosition() const + { + return _worldPosition; + } + std::shared_ptr PositionImpl::GetRelativeWorldPosition() const + { + return _relativeWorldPosition; + } + std::shared_ptr PositionImpl::GetRelativeObjectPosition() const + { + return _relativeObjectPosition; + } + std::shared_ptr PositionImpl::GetRoadPosition() const + { + return _roadPosition; + } + std::shared_ptr PositionImpl::GetRelativeRoadPosition() const + { + return _relativeRoadPosition; + } + std::shared_ptr PositionImpl::GetLanePosition() const + { + return _lanePosition; + } + std::shared_ptr PositionImpl::GetRelativeLanePosition() const + { + return _relativeLanePosition; + } + std::shared_ptr PositionImpl::GetRoutePosition() const + { + return _routePosition; + } + std::shared_ptr PositionImpl::GetGeoPosition() const + { + return _geoPosition; + } + std::shared_ptr PositionImpl::GetTrajectoryPosition() const + { + return _trajectoryPosition; + } + + + void PositionImpl::SetWorldPosition(std::shared_ptr worldPosition) + { + _worldPosition = worldPosition; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetWorldPosition = true; + } + + void PositionImpl::SetRelativeWorldPosition(std::shared_ptr relativeWorldPosition) + { + _relativeWorldPosition = relativeWorldPosition; + _worldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRelativeWorldPosition = true; + } + + void PositionImpl::SetRelativeObjectPosition(std::shared_ptr relativeObjectPosition) + { + _relativeObjectPosition = relativeObjectPosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRelativeObjectPosition = true; + } + + void PositionImpl::SetRoadPosition(std::shared_ptr roadPosition) + { + _roadPosition = roadPosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRoadPosition = true; + } + + void PositionImpl::SetRelativeRoadPosition(std::shared_ptr relativeRoadPosition) + { + _relativeRoadPosition = relativeRoadPosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRelativeRoadPosition = true; + } + + void PositionImpl::SetLanePosition(std::shared_ptr lanePosition) + { + _lanePosition = lanePosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetLanePosition = true; + } + + void PositionImpl::SetRelativeLanePosition(std::shared_ptr relativeLanePosition) + { + _relativeLanePosition = relativeLanePosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRelativeLanePosition = true; + } + + void PositionImpl::SetRoutePosition(std::shared_ptr routePosition) + { + _routePosition = routePosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _geoPosition = {}; + _trajectoryPosition = {}; + _isSetRoutePosition = true; + } + + void PositionImpl::SetGeoPosition(std::shared_ptr geoPosition) + { + _geoPosition = geoPosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _trajectoryPosition = {}; + _isSetGeoPosition = true; + } + + void PositionImpl::SetTrajectoryPosition(std::shared_ptr trajectoryPosition) + { + _trajectoryPosition = trajectoryPosition; + _worldPosition = {}; + _relativeWorldPosition = {}; + _relativeObjectPosition = {}; + _roadPosition = {}; + _relativeRoadPosition = {}; + _lanePosition = {}; + _relativeLanePosition = {}; + _routePosition = {}; + _geoPosition = {}; + _isSetTrajectoryPosition = true; + } + + std::shared_ptr PositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PositionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PositionImpl::GetModelType() const + { + return "Position"; + } + + // children + std::shared_ptr PositionImpl::GetWriterWorldPosition() const + { + return std::dynamic_pointer_cast(_worldPosition); + } + std::shared_ptr PositionImpl::GetWriterRelativeWorldPosition() const + { + return std::dynamic_pointer_cast(_relativeWorldPosition); + } + std::shared_ptr PositionImpl::GetWriterRelativeObjectPosition() const + { + return std::dynamic_pointer_cast(_relativeObjectPosition); + } + std::shared_ptr PositionImpl::GetWriterRoadPosition() const + { + return std::dynamic_pointer_cast(_roadPosition); + } + std::shared_ptr PositionImpl::GetWriterRelativeRoadPosition() const + { + return std::dynamic_pointer_cast(_relativeRoadPosition); + } + std::shared_ptr PositionImpl::GetWriterLanePosition() const + { + return std::dynamic_pointer_cast(_lanePosition); + } + std::shared_ptr PositionImpl::GetWriterRelativeLanePosition() const + { + return std::dynamic_pointer_cast(_relativeLanePosition); + } + std::shared_ptr PositionImpl::GetWriterRoutePosition() const + { + return std::dynamic_pointer_cast(_routePosition); + } + std::shared_ptr PositionImpl::GetWriterGeoPosition() const + { + return std::dynamic_pointer_cast(_geoPosition); + } + std::shared_ptr PositionImpl::GetWriterTrajectoryPosition() const + { + return std::dynamic_pointer_cast(_trajectoryPosition); + } + + PositionImpl::PositionImpl() + { + /** + * Filling the property to type map + */ + } + + void PositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PositionImpl::GetChildren() const + { + std::vector> result; + + const auto kWorldPosition = GetWriterWorldPosition(); + if (kWorldPosition) + { + result.push_back(std::dynamic_pointer_cast(kWorldPosition)); + } + const auto kRelativeWorldPosition = GetWriterRelativeWorldPosition(); + if (kRelativeWorldPosition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeWorldPosition)); + } + const auto kRelativeObjectPosition = GetWriterRelativeObjectPosition(); + if (kRelativeObjectPosition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeObjectPosition)); + } + const auto kRoadPosition = GetWriterRoadPosition(); + if (kRoadPosition) + { + result.push_back(std::dynamic_pointer_cast(kRoadPosition)); + } + const auto kRelativeRoadPosition = GetWriterRelativeRoadPosition(); + if (kRelativeRoadPosition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeRoadPosition)); + } + const auto kLanePosition = GetWriterLanePosition(); + if (kLanePosition) + { + result.push_back(std::dynamic_pointer_cast(kLanePosition)); + } + const auto kRelativeLanePosition = GetWriterRelativeLanePosition(); + if (kRelativeLanePosition) + { + result.push_back(std::dynamic_pointer_cast(kRelativeLanePosition)); + } + const auto kRoutePosition = GetWriterRoutePosition(); + if (kRoutePosition) + { + result.push_back(std::dynamic_pointer_cast(kRoutePosition)); + } + const auto kGeoPosition = GetWriterGeoPosition(); + if (kGeoPosition) + { + result.push_back(std::dynamic_pointer_cast(kGeoPosition)); + } + const auto kTrajectoryPosition = GetWriterTrajectoryPosition(); + if (kTrajectoryPosition) + { + result.push_back(std::dynamic_pointer_cast(kTrajectoryPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kWorldPosition = GetWriterWorldPosition(); + if (kWorldPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kWorldPosition)->Clone(); + auto clonedChildIWorldPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetWorldPosition(std::dynamic_pointer_cast(clonedChildIWorldPosition)); + } + const auto kRelativeWorldPosition = GetWriterRelativeWorldPosition(); + if (kRelativeWorldPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeWorldPosition)->Clone(); + auto clonedChildIRelativeWorldPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeWorldPosition(std::dynamic_pointer_cast(clonedChildIRelativeWorldPosition)); + } + const auto kRelativeObjectPosition = GetWriterRelativeObjectPosition(); + if (kRelativeObjectPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeObjectPosition)->Clone(); + auto clonedChildIRelativeObjectPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeObjectPosition(std::dynamic_pointer_cast(clonedChildIRelativeObjectPosition)); + } + const auto kRoadPosition = GetWriterRoadPosition(); + if (kRoadPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRoadPosition)->Clone(); + auto clonedChildIRoadPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoadPosition(std::dynamic_pointer_cast(clonedChildIRoadPosition)); + } + const auto kRelativeRoadPosition = GetWriterRelativeRoadPosition(); + if (kRelativeRoadPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeRoadPosition)->Clone(); + auto clonedChildIRelativeRoadPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeRoadPosition(std::dynamic_pointer_cast(clonedChildIRelativeRoadPosition)); + } + const auto kLanePosition = GetWriterLanePosition(); + if (kLanePosition) + { + auto clonedChild = std::dynamic_pointer_cast(kLanePosition)->Clone(); + auto clonedChildILanePosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLanePosition(std::dynamic_pointer_cast(clonedChildILanePosition)); + } + const auto kRelativeLanePosition = GetWriterRelativeLanePosition(); + if (kRelativeLanePosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeLanePosition)->Clone(); + auto clonedChildIRelativeLanePosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeLanePosition(std::dynamic_pointer_cast(clonedChildIRelativeLanePosition)); + } + const auto kRoutePosition = GetWriterRoutePosition(); + if (kRoutePosition) + { + auto clonedChild = std::dynamic_pointer_cast(kRoutePosition)->Clone(); + auto clonedChildIRoutePosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoutePosition(std::dynamic_pointer_cast(clonedChildIRoutePosition)); + } + const auto kGeoPosition = GetWriterGeoPosition(); + if (kGeoPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kGeoPosition)->Clone(); + auto clonedChildIGeoPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetGeoPosition(std::dynamic_pointer_cast(clonedChildIGeoPosition)); + } + const auto kTrajectoryPosition = GetWriterTrajectoryPosition(); + if (kTrajectoryPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectoryPosition)->Clone(); + auto clonedChildITrajectoryPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectoryPosition(std::dynamic_pointer_cast(clonedChildITrajectoryPosition)); + } + return clonedObject; + } + + std::string PositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__WORLD_POSITION) + { + return std::dynamic_pointer_cast(GetWorldPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION) + { + return std::dynamic_pointer_cast(GetRelativeWorldPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION) + { + return std::dynamic_pointer_cast(GetRelativeObjectPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROAD_POSITION) + { + return std::dynamic_pointer_cast(GetRoadPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION) + { + return std::dynamic_pointer_cast(GetRelativeRoadPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE_POSITION) + { + return std::dynamic_pointer_cast(GetLanePosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION) + { + return std::dynamic_pointer_cast(GetRelativeLanePosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTE_POSITION) + { + return std::dynamic_pointer_cast(GetRoutePosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__GEO_POSITION) + { + return std::dynamic_pointer_cast(GetGeoPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION) + { + return std::dynamic_pointer_cast(GetTrajectoryPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> PositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PositionImpl::IsSetWorldPosition() const + { + return _isSetWorldPosition; + } + bool PositionImpl::IsSetRelativeWorldPosition() const + { + return _isSetRelativeWorldPosition; + } + bool PositionImpl::IsSetRelativeObjectPosition() const + { + return _isSetRelativeObjectPosition; + } + bool PositionImpl::IsSetRoadPosition() const + { + return _isSetRoadPosition; + } + bool PositionImpl::IsSetRelativeRoadPosition() const + { + return _isSetRelativeRoadPosition; + } + bool PositionImpl::IsSetLanePosition() const + { + return _isSetLanePosition; + } + bool PositionImpl::IsSetRelativeLanePosition() const + { + return _isSetRelativeLanePosition; + } + bool PositionImpl::IsSetRoutePosition() const + { + return _isSetRoutePosition; + } + bool PositionImpl::IsSetGeoPosition() const + { + return _isSetGeoPosition; + } + bool PositionImpl::IsSetTrajectoryPosition() const + { + return _isSetTrajectoryPosition; + } + + IOpenScenarioFlexElement* PositionInLaneCoordinatesImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string PositionInLaneCoordinatesImpl::GetLaneId() const + { + return _laneId; + } + double PositionInLaneCoordinatesImpl::GetLaneOffset() const + { + return _laneOffset; + } + double PositionInLaneCoordinatesImpl::GetPathS() const + { + return _pathS; + } + + + void PositionInLaneCoordinatesImpl::SetLaneId(const std::string laneId) + { + _laneId = laneId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID); + _isSetLaneId = true; + } + + void PositionInLaneCoordinatesImpl::SetLaneOffset(const double laneOffset) + { + _laneOffset = laneOffset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET); + _isSetLaneOffset = true; + } + + void PositionInLaneCoordinatesImpl::SetPathS(const double pathS) + { + _pathS = pathS; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S); + _isSetPathS = true; + } + + std::shared_ptr PositionInLaneCoordinatesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PositionInLaneCoordinatesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPositionInLaneCoordinates).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPositionInLaneCoordinatesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PositionInLaneCoordinatesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PositionInLaneCoordinatesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PositionInLaneCoordinatesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PositionInLaneCoordinatesImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET) + { + return GetLaneOffset(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + return GetPathS(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PositionInLaneCoordinatesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PositionInLaneCoordinatesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PositionInLaneCoordinatesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PositionInLaneCoordinatesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PositionInLaneCoordinatesImpl::GetModelType() const + { + return "PositionInLaneCoordinates"; + } + + void PositionInLaneCoordinatesImpl::WriteParameterToLaneId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, parameterName, nullTextMarker /*no textmarker*/); + _laneId = {}; + } + + void PositionInLaneCoordinatesImpl::WriteParameterToLaneOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _laneOffset = {}; + } + + void PositionInLaneCoordinatesImpl::WriteParameterToPathS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, parameterName, nullTextMarker /*no textmarker*/); + _pathS = {}; + } + + std::string PositionInLaneCoordinatesImpl::GetParameterFromLaneId() const + { + auto laneId = OSC_CONSTANTS::ATTRIBUTE__LANE_ID; + return GetParameterNameFromAttribute(laneId); + } + + std::string PositionInLaneCoordinatesImpl::GetParameterFromLaneOffset() const + { + auto laneOffset = OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET; + return GetParameterNameFromAttribute(laneOffset); + } + + std::string PositionInLaneCoordinatesImpl::GetParameterFromPathS() const + { + auto pathS = OSC_CONSTANTS::ATTRIBUTE__PATH_S; + return GetParameterNameFromAttribute(pathS); + } + + bool PositionInLaneCoordinatesImpl::IsLaneIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LANE_ID); + if (kIt != keys.end()) + return true; + return false; + } + + bool PositionInLaneCoordinatesImpl::IsLaneOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + bool PositionInLaneCoordinatesImpl::IsPathSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PATH_S); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PositionInLaneCoordinatesImpl::PositionInLaneCoordinatesImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PATH_S, SimpleType::DOUBLE); + } + + void PositionInLaneCoordinatesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + // Simple type + _laneId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLaneId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET) + { + // Simple type + _laneOffset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLaneOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + // Simple type + _pathS = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPathS = true; + } + } + + SimpleType PositionInLaneCoordinatesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PositionInLaneCoordinatesImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PositionInLaneCoordinatesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_laneId = GetLaneId(); + // Simple type + clonedObject->_laneOffset = GetLaneOffset(); + // Simple type + clonedObject->_pathS = GetPathS(); + // clone indicators + clonedObject->_isSetLaneOffset = _isSetLaneOffset; + // clone children + return clonedObject; + } + + std::string PositionInLaneCoordinatesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + return GetLaneId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionInLaneCoordinatesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PositionInLaneCoordinatesImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionInLaneCoordinatesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PositionInLaneCoordinatesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PositionInLaneCoordinatesImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_ID) + { + // Simple type + _laneId = value; + AddResolvedParameter(attributeKey); + _isSetLaneId = true; + } + + } + void PositionInLaneCoordinatesImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET) + { + // Simple type + _laneOffset = value; + AddResolvedParameter(attributeKey); + _isSetLaneOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + // Simple type + _pathS = value; + AddResolvedParameter(attributeKey); + _isSetPathS = true; + } + + } + + + bool PositionInLaneCoordinatesImpl::IsSetLaneId() const + { + return _isSetLaneId; + } + void PositionInLaneCoordinatesImpl::ResetLaneOffset() + { + _isSetLaneOffset = false; + _laneOffset = {0}; + + } + bool PositionInLaneCoordinatesImpl::IsSetLaneOffset() const + { + return _isSetLaneOffset; + } + bool PositionInLaneCoordinatesImpl::IsSetPathS() const + { + return _isSetPathS; + } + + IOpenScenarioFlexElement* PositionInRoadCoordinatesImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PositionInRoadCoordinatesImpl::GetPathS() const + { + return _pathS; + } + double PositionInRoadCoordinatesImpl::GetT() const + { + return _t; + } + + + void PositionInRoadCoordinatesImpl::SetPathS(const double pathS) + { + _pathS = pathS; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S); + _isSetPathS = true; + } + + void PositionInRoadCoordinatesImpl::SetT(const double t) + { + _t = t; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T); + _isSetT = true; + } + + std::shared_ptr PositionInRoadCoordinatesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PositionInRoadCoordinatesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPositionInRoadCoordinates).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPositionInRoadCoordinatesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PositionInRoadCoordinatesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PositionInRoadCoordinatesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PositionInRoadCoordinatesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PositionInRoadCoordinatesImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + return GetPathS(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__T) + { + return GetT(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PositionInRoadCoordinatesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PositionInRoadCoordinatesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PositionInRoadCoordinatesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PositionInRoadCoordinatesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PositionInRoadCoordinatesImpl::GetModelType() const + { + return "PositionInRoadCoordinates"; + } + + void PositionInRoadCoordinatesImpl::WriteParameterToPathS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, parameterName, nullTextMarker /*no textmarker*/); + _pathS = {}; + } + + void PositionInRoadCoordinatesImpl::WriteParameterToT(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, parameterName, nullTextMarker /*no textmarker*/); + _t = {}; + } + + std::string PositionInRoadCoordinatesImpl::GetParameterFromPathS() const + { + auto pathS = OSC_CONSTANTS::ATTRIBUTE__PATH_S; + return GetParameterNameFromAttribute(pathS); + } + + std::string PositionInRoadCoordinatesImpl::GetParameterFromT() const + { + auto t = OSC_CONSTANTS::ATTRIBUTE__T; + return GetParameterNameFromAttribute(t); + } + + bool PositionInRoadCoordinatesImpl::IsPathSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PATH_S); + if (kIt != keys.end()) + return true; + return false; + } + + bool PositionInRoadCoordinatesImpl::IsTParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__T); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PositionInRoadCoordinatesImpl::PositionInRoadCoordinatesImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PATH_S, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__T, SimpleType::DOUBLE); + } + + void PositionInRoadCoordinatesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + // Simple type + _pathS = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPathS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetT = true; + } + } + + SimpleType PositionInRoadCoordinatesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PositionInRoadCoordinatesImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PositionInRoadCoordinatesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_pathS = GetPathS(); + // Simple type + clonedObject->_t = GetT(); + // clone indicators + // clone children + return clonedObject; + } + + std::string PositionInRoadCoordinatesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionInRoadCoordinatesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PositionInRoadCoordinatesImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionInRoadCoordinatesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PositionInRoadCoordinatesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PositionInRoadCoordinatesImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PATH_S) + { + // Simple type + _pathS = value; + AddResolvedParameter(attributeKey); + _isSetPathS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = value; + AddResolvedParameter(attributeKey); + _isSetT = true; + } + + } + + + bool PositionInRoadCoordinatesImpl::IsSetPathS() const + { + return _isSetPathS; + } + bool PositionInRoadCoordinatesImpl::IsSetT() const + { + return _isSetT; + } + + IOpenScenarioFlexElement* PositionOfCurrentEntityImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> PositionOfCurrentEntityImpl::GetEntityRef() const + { + return _entityRef; + } + + + void PositionOfCurrentEntityImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + std::shared_ptr PositionOfCurrentEntityImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PositionOfCurrentEntityImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPositionOfCurrentEntity).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPositionOfCurrentEntityWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PositionOfCurrentEntityImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PositionOfCurrentEntityImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PositionOfCurrentEntityImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PositionOfCurrentEntityImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PositionOfCurrentEntityImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PositionOfCurrentEntityImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PositionOfCurrentEntityImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PositionOfCurrentEntityImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PositionOfCurrentEntityImpl::GetModelType() const + { + return "PositionOfCurrentEntity"; + } + + void PositionOfCurrentEntityImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string PositionOfCurrentEntityImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool PositionOfCurrentEntityImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PositionOfCurrentEntityImpl::PositionOfCurrentEntityImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void PositionOfCurrentEntityImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType PositionOfCurrentEntityImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PositionOfCurrentEntityImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PositionOfCurrentEntityImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string PositionOfCurrentEntityImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionOfCurrentEntityImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PositionOfCurrentEntityImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PositionOfCurrentEntityImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string PositionOfCurrentEntityImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PositionOfCurrentEntityImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* PrecipitationImpl::GetOpenScenarioFlexElement() + { + return this; + } + double PrecipitationImpl::GetIntensity() const + { + return _intensity; + } + double PrecipitationImpl::GetPrecipitationIntensity() const + { + return _precipitationIntensity; + } + PrecipitationType PrecipitationImpl::GetPrecipitationType() const + { + return _precipitationType; + } + + + void PrecipitationImpl::SetIntensity(const double intensity) + { + _intensity = intensity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + _isSetIntensity = true; + } + + void PrecipitationImpl::SetPrecipitationIntensity(const double precipitationIntensity) + { + _precipitationIntensity = precipitationIntensity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY); + _isSetPrecipitationIntensity = true; + } + + void PrecipitationImpl::SetPrecipitationType(const PrecipitationType precipitationType) + { + _precipitationType = precipitationType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE); + _isSetPrecipitationType = true; + } + + std::shared_ptr PrecipitationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PrecipitationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPrecipitation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPrecipitationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PrecipitationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PrecipitationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PrecipitationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PrecipitationImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + return GetIntensity(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY) + { + return GetPrecipitationIntensity(); + } + throw KeyNotSupportedException(); + + } + + uint16_t PrecipitationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PrecipitationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PrecipitationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PrecipitationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PrecipitationImpl::GetModelType() const + { + return "Precipitation"; + } + + void PrecipitationImpl::WriteParameterToIntensity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, parameterName, nullTextMarker /*no textmarker*/); + _intensity = {}; + } + + void PrecipitationImpl::WriteParameterToPrecipitationIntensity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, parameterName, nullTextMarker /*no textmarker*/); + _precipitationIntensity = {}; + } + + void PrecipitationImpl::WriteParameterToPrecipitationType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _precipitationType = {}; + } + + std::string PrecipitationImpl::GetParameterFromIntensity() const + { + auto intensity = OSC_CONSTANTS::ATTRIBUTE__INTENSITY; + return GetParameterNameFromAttribute(intensity); + } + + std::string PrecipitationImpl::GetParameterFromPrecipitationIntensity() const + { + auto precipitationIntensity = OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY; + return GetParameterNameFromAttribute(precipitationIntensity); + } + + std::string PrecipitationImpl::GetParameterFromPrecipitationType() const + { + auto precipitationType = OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE; + return GetParameterNameFromAttribute(precipitationType); + } + + bool PrecipitationImpl::IsIntensityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + if (kIt != keys.end()) + return true; + return false; + } + + bool PrecipitationImpl::IsPrecipitationIntensityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY); + if (kIt != keys.end()) + return true; + return false; + } + + bool PrecipitationImpl::IsPrecipitationTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PrecipitationImpl::PrecipitationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, SimpleType::ENUM_TYPE); + } + + void PrecipitationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + // Simple type + _intensity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetIntensity = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY) + { + // Simple type + _precipitationIntensity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPrecipitationIntensity = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE) + { + // Enumeration Type + const auto kResult = PrecipitationType::GetFromLiteral(parameterLiteralValue); + if (kResult != PrecipitationType::UNKNOWN) + { + _precipitationType = kResult; + AddResolvedParameter(attributeKey); + _isSetPrecipitationType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType PrecipitationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PrecipitationImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PrecipitationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_intensity = GetIntensity(); + // Simple type + clonedObject->_precipitationIntensity = GetPrecipitationIntensity(); + // Enumeration Type + const auto kPrecipitationType = GetPrecipitationType(); + if ( kPrecipitationType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_precipitationType = PrecipitationType::GetFromLiteral(kPrecipitationType.GetLiteral()); + } + // clone indicators + clonedObject->_isSetIntensity = _isSetIntensity; + clonedObject->_isSetPrecipitationIntensity = _isSetPrecipitationIntensity; + // clone children + return clonedObject; + } + + std::string PrecipitationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PrecipitationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PrecipitationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PrecipitationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PrecipitationImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE) + { + auto precipitationType = GetPrecipitationType(); + return precipitationType.GetLiteral() != "UNKNOWN" ? precipitationType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void PrecipitationImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + // Simple type + _intensity = value; + AddResolvedParameter(attributeKey); + _isSetIntensity = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY) + { + // Simple type + _precipitationIntensity = value; + AddResolvedParameter(attributeKey); + _isSetPrecipitationIntensity = true; + } + + } + + + void PrecipitationImpl::ResetIntensity() + { + _isSetIntensity = false; + _intensity = {}; + + } + bool PrecipitationImpl::IsSetIntensity() const + { + return _isSetIntensity; + } + void PrecipitationImpl::ResetPrecipitationIntensity() + { + _isSetPrecipitationIntensity = false; + _precipitationIntensity = {}; + + } + bool PrecipitationImpl::IsSetPrecipitationIntensity() const + { + return _isSetPrecipitationIntensity; + } + bool PrecipitationImpl::IsSetPrecipitationType() const + { + return _isSetPrecipitationType; + } + + IOpenScenarioFlexElement* PrivateImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> PrivateImpl::GetEntityRef() const + { + return _entityRef; + } + std::vector> PrivateImpl::GetPrivateActions() const + { + std::vector> temp; + for(auto&& elm: _privateActions) + temp.push_back(elm); + return temp; + } + std::vector> PrivateImpl::GetWriterPrivateActions() const + { + return _privateActions; + } + + int PrivateImpl::GetPrivateActionsSize() const + { + return static_cast(_privateActions.size()); + } + + std::shared_ptr PrivateImpl::GetPrivateActionsAtIndex(unsigned int index) const + { + if (index >= 0 && _privateActions.size() > index) + { + return _privateActions[index]; + } + return nullptr; + } + + + void PrivateImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void PrivateImpl::SetPrivateActions(std::vector>& privateActions) + { + _privateActions = privateActions; + _isSetPrivateActions = true; + } + + std::shared_ptr PrivateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PrivateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPrivate).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPrivateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PrivateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PrivateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PrivateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PrivateImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PrivateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PrivateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PrivateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PrivateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PrivateImpl::GetModelType() const + { + return "Private"; + } + + void PrivateImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string PrivateImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool PrivateImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PrivateImpl::PrivateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void PrivateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType PrivateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PrivateImpl::GetChildren() const + { + std::vector> result; + + auto privateActions = GetWriterPrivateActions(); + if (!privateActions.empty()) + { + for(auto&& item : privateActions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PrivateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + const auto kPrivateActions = GetWriterPrivateActions(); + if (!kPrivateActions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPrivateActions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPrivateActions(clonedList); + } + return clonedObject; + } + + std::string PrivateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PrivateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PrivateImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION) + { + std::vector> vect; + for (auto&& elem : GetPrivateActions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PrivateImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string PrivateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PrivateImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool PrivateImpl::IsSetPrivateActions() const + { + return _isSetPrivateActions; + } + + IOpenScenarioFlexElement* PrivateActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr PrivateActionImpl::GetLongitudinalAction() const + { + return _longitudinalAction; + } + std::shared_ptr PrivateActionImpl::GetLateralAction() const + { + return _lateralAction; + } + std::shared_ptr PrivateActionImpl::GetVisibilityAction() const + { + return _visibilityAction; + } + std::shared_ptr PrivateActionImpl::GetSynchronizeAction() const + { + return _synchronizeAction; + } + std::shared_ptr PrivateActionImpl::GetActivateControllerAction() const + { + return _activateControllerAction; + } + std::shared_ptr PrivateActionImpl::GetControllerAction() const + { + return _controllerAction; + } + std::shared_ptr PrivateActionImpl::GetTeleportAction() const + { + return _teleportAction; + } + std::shared_ptr PrivateActionImpl::GetRoutingAction() const + { + return _routingAction; + } + std::shared_ptr PrivateActionImpl::GetAppearanceAction() const + { + return _appearanceAction; + } + std::shared_ptr PrivateActionImpl::GetTrailerAction() const + { + return _trailerAction; + } + + + void PrivateActionImpl::SetLongitudinalAction(std::shared_ptr longitudinalAction) + { + _longitudinalAction = longitudinalAction; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetLongitudinalAction = true; + } + + void PrivateActionImpl::SetLateralAction(std::shared_ptr lateralAction) + { + _lateralAction = lateralAction; + _longitudinalAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetLateralAction = true; + } + + void PrivateActionImpl::SetVisibilityAction(std::shared_ptr visibilityAction) + { + _visibilityAction = visibilityAction; + _longitudinalAction = {}; + _lateralAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetVisibilityAction = true; + } + + void PrivateActionImpl::SetSynchronizeAction(std::shared_ptr synchronizeAction) + { + _synchronizeAction = synchronizeAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetSynchronizeAction = true; + } + + void PrivateActionImpl::SetActivateControllerAction(std::shared_ptr activateControllerAction) + { + _activateControllerAction = activateControllerAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetActivateControllerAction = true; + } + + void PrivateActionImpl::SetControllerAction(std::shared_ptr controllerAction) + { + _controllerAction = controllerAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetControllerAction = true; + } + + void PrivateActionImpl::SetTeleportAction(std::shared_ptr teleportAction) + { + _teleportAction = teleportAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetTeleportAction = true; + } + + void PrivateActionImpl::SetRoutingAction(std::shared_ptr routingAction) + { + _routingAction = routingAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _appearanceAction = {}; + _trailerAction = {}; + _isSetRoutingAction = true; + } + + void PrivateActionImpl::SetAppearanceAction(std::shared_ptr appearanceAction) + { + _appearanceAction = appearanceAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _trailerAction = {}; + _isSetAppearanceAction = true; + } + + void PrivateActionImpl::SetTrailerAction(std::shared_ptr trailerAction) + { + _trailerAction = trailerAction; + _longitudinalAction = {}; + _lateralAction = {}; + _visibilityAction = {}; + _synchronizeAction = {}; + _activateControllerAction = {}; + _controllerAction = {}; + _teleportAction = {}; + _routingAction = {}; + _appearanceAction = {}; + _isSetTrailerAction = true; + } + + std::shared_ptr PrivateActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PrivateActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IPrivateAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPrivateActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PrivateActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PrivateActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PrivateActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PrivateActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PrivateActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PrivateActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PrivateActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PrivateActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PrivateActionImpl::GetModelType() const + { + return "PrivateAction"; + } + + // children + std::shared_ptr PrivateActionImpl::GetWriterLongitudinalAction() const + { + return std::dynamic_pointer_cast(_longitudinalAction); + } + std::shared_ptr PrivateActionImpl::GetWriterLateralAction() const + { + return std::dynamic_pointer_cast(_lateralAction); + } + std::shared_ptr PrivateActionImpl::GetWriterVisibilityAction() const + { + return std::dynamic_pointer_cast(_visibilityAction); + } + std::shared_ptr PrivateActionImpl::GetWriterSynchronizeAction() const + { + return std::dynamic_pointer_cast(_synchronizeAction); + } + std::shared_ptr PrivateActionImpl::GetWriterActivateControllerAction() const + { + return std::dynamic_pointer_cast(_activateControllerAction); + } + std::shared_ptr PrivateActionImpl::GetWriterControllerAction() const + { + return std::dynamic_pointer_cast(_controllerAction); + } + std::shared_ptr PrivateActionImpl::GetWriterTeleportAction() const + { + return std::dynamic_pointer_cast(_teleportAction); + } + std::shared_ptr PrivateActionImpl::GetWriterRoutingAction() const + { + return std::dynamic_pointer_cast(_routingAction); + } + std::shared_ptr PrivateActionImpl::GetWriterAppearanceAction() const + { + return std::dynamic_pointer_cast(_appearanceAction); + } + std::shared_ptr PrivateActionImpl::GetWriterTrailerAction() const + { + return std::dynamic_pointer_cast(_trailerAction); + } + + PrivateActionImpl::PrivateActionImpl() + { + /** + * Filling the property to type map + */ + } + + void PrivateActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PrivateActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PrivateActionImpl::GetChildren() const + { + std::vector> result; + + const auto kLongitudinalAction = GetWriterLongitudinalAction(); + if (kLongitudinalAction) + { + result.push_back(std::dynamic_pointer_cast(kLongitudinalAction)); + } + const auto kLateralAction = GetWriterLateralAction(); + if (kLateralAction) + { + result.push_back(std::dynamic_pointer_cast(kLateralAction)); + } + const auto kVisibilityAction = GetWriterVisibilityAction(); + if (kVisibilityAction) + { + result.push_back(std::dynamic_pointer_cast(kVisibilityAction)); + } + const auto kSynchronizeAction = GetWriterSynchronizeAction(); + if (kSynchronizeAction) + { + result.push_back(std::dynamic_pointer_cast(kSynchronizeAction)); + } + const auto kActivateControllerAction = GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + result.push_back(std::dynamic_pointer_cast(kActivateControllerAction)); + } + const auto kControllerAction = GetWriterControllerAction(); + if (kControllerAction) + { + result.push_back(std::dynamic_pointer_cast(kControllerAction)); + } + const auto kTeleportAction = GetWriterTeleportAction(); + if (kTeleportAction) + { + result.push_back(std::dynamic_pointer_cast(kTeleportAction)); + } + const auto kRoutingAction = GetWriterRoutingAction(); + if (kRoutingAction) + { + result.push_back(std::dynamic_pointer_cast(kRoutingAction)); + } + const auto kAppearanceAction = GetWriterAppearanceAction(); + if (kAppearanceAction) + { + result.push_back(std::dynamic_pointer_cast(kAppearanceAction)); + } + const auto kTrailerAction = GetWriterTrailerAction(); + if (kTrailerAction) + { + result.push_back(std::dynamic_pointer_cast(kTrailerAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PrivateActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kLongitudinalAction = GetWriterLongitudinalAction(); + if (kLongitudinalAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLongitudinalAction)->Clone(); + auto clonedChildILongitudinalAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLongitudinalAction(std::dynamic_pointer_cast(clonedChildILongitudinalAction)); + } + const auto kLateralAction = GetWriterLateralAction(); + if (kLateralAction) + { + auto clonedChild = std::dynamic_pointer_cast(kLateralAction)->Clone(); + auto clonedChildILateralAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLateralAction(std::dynamic_pointer_cast(clonedChildILateralAction)); + } + const auto kVisibilityAction = GetWriterVisibilityAction(); + if (kVisibilityAction) + { + auto clonedChild = std::dynamic_pointer_cast(kVisibilityAction)->Clone(); + auto clonedChildIVisibilityAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVisibilityAction(std::dynamic_pointer_cast(clonedChildIVisibilityAction)); + } + const auto kSynchronizeAction = GetWriterSynchronizeAction(); + if (kSynchronizeAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSynchronizeAction)->Clone(); + auto clonedChildISynchronizeAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSynchronizeAction(std::dynamic_pointer_cast(clonedChildISynchronizeAction)); + } + const auto kActivateControllerAction = GetWriterActivateControllerAction(); + if (kActivateControllerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kActivateControllerAction)->Clone(); + auto clonedChildIActivateControllerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetActivateControllerAction(std::dynamic_pointer_cast(clonedChildIActivateControllerAction)); + } + const auto kControllerAction = GetWriterControllerAction(); + if (kControllerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kControllerAction)->Clone(); + auto clonedChildIControllerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetControllerAction(std::dynamic_pointer_cast(clonedChildIControllerAction)); + } + const auto kTeleportAction = GetWriterTeleportAction(); + if (kTeleportAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTeleportAction)->Clone(); + auto clonedChildITeleportAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTeleportAction(std::dynamic_pointer_cast(clonedChildITeleportAction)); + } + const auto kRoutingAction = GetWriterRoutingAction(); + if (kRoutingAction) + { + auto clonedChild = std::dynamic_pointer_cast(kRoutingAction)->Clone(); + auto clonedChildIRoutingAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoutingAction(std::dynamic_pointer_cast(clonedChildIRoutingAction)); + } + const auto kAppearanceAction = GetWriterAppearanceAction(); + if (kAppearanceAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAppearanceAction)->Clone(); + auto clonedChildIAppearanceAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAppearanceAction(std::dynamic_pointer_cast(clonedChildIAppearanceAction)); + } + const auto kTrailerAction = GetWriterTrailerAction(); + if (kTrailerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailerAction)->Clone(); + auto clonedChildITrailerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailerAction(std::dynamic_pointer_cast(clonedChildITrailerAction)); + } + return clonedObject; + } + + std::string PrivateActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PrivateActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION) + { + return std::dynamic_pointer_cast(GetLongitudinalAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LATERAL_ACTION) + { + return std::dynamic_pointer_cast(GetLateralAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION) + { + return std::dynamic_pointer_cast(GetVisibilityAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION) + { + return std::dynamic_pointer_cast(GetSynchronizeAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION) + { + return std::dynamic_pointer_cast(GetActivateControllerAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION) + { + return std::dynamic_pointer_cast(GetControllerAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION) + { + return std::dynamic_pointer_cast(GetTeleportAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTING_ACTION) + { + return std::dynamic_pointer_cast(GetRoutingAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION) + { + return std::dynamic_pointer_cast(GetAppearanceAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER_ACTION) + { + return std::dynamic_pointer_cast(GetTrailerAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> PrivateActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PrivateActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PrivateActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool PrivateActionImpl::IsSetLongitudinalAction() const + { + return _isSetLongitudinalAction; + } + bool PrivateActionImpl::IsSetLateralAction() const + { + return _isSetLateralAction; + } + bool PrivateActionImpl::IsSetVisibilityAction() const + { + return _isSetVisibilityAction; + } + bool PrivateActionImpl::IsSetSynchronizeAction() const + { + return _isSetSynchronizeAction; + } + bool PrivateActionImpl::IsSetActivateControllerAction() const + { + return _isSetActivateControllerAction; + } + bool PrivateActionImpl::IsSetControllerAction() const + { + return _isSetControllerAction; + } + bool PrivateActionImpl::IsSetTeleportAction() const + { + return _isSetTeleportAction; + } + bool PrivateActionImpl::IsSetRoutingAction() const + { + return _isSetRoutingAction; + } + bool PrivateActionImpl::IsSetAppearanceAction() const + { + return _isSetAppearanceAction; + } + bool PrivateActionImpl::IsSetTrailerAction() const + { + return _isSetTrailerAction; + } + + IOpenScenarioFlexElement* ProbabilityDistributionSetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ProbabilityDistributionSetImpl::GetElements() const + { + std::vector> temp; + for(auto&& elm: _elements) + temp.push_back(elm); + return temp; + } + std::vector> ProbabilityDistributionSetImpl::GetWriterElements() const + { + return _elements; + } + + int ProbabilityDistributionSetImpl::GetElementsSize() const + { + return static_cast(_elements.size()); + } + + std::shared_ptr ProbabilityDistributionSetImpl::GetElementsAtIndex(unsigned int index) const + { + if (index >= 0 && _elements.size() > index) + { + return _elements[index]; + } + return nullptr; + } + + + void ProbabilityDistributionSetImpl::SetElements(std::vector>& elements) + { + _elements = elements; + _isSetElements = true; + } + + std::shared_ptr ProbabilityDistributionSetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ProbabilityDistributionSetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IProbabilityDistributionSet).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IProbabilityDistributionSetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ProbabilityDistributionSetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ProbabilityDistributionSetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ProbabilityDistributionSetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ProbabilityDistributionSetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ProbabilityDistributionSetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ProbabilityDistributionSetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ProbabilityDistributionSetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ProbabilityDistributionSetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ProbabilityDistributionSetImpl::GetModelType() const + { + return "ProbabilityDistributionSet"; + } + + // children + + ProbabilityDistributionSetImpl::ProbabilityDistributionSetImpl() + { + /** + * Filling the property to type map + */ + } + + void ProbabilityDistributionSetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ProbabilityDistributionSetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ProbabilityDistributionSetImpl::GetChildren() const + { + std::vector> result; + + auto elements = GetWriterElements(); + if (!elements.empty()) + { + for(auto&& item : elements) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ProbabilityDistributionSetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kElements = GetWriterElements(); + if (!kElements.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kElements) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetElements(clonedList); + } + return clonedObject; + } + + std::string ProbabilityDistributionSetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ProbabilityDistributionSetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ProbabilityDistributionSetImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ELEMENT) + { + std::vector> vect; + for (auto&& elem : GetElements()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ProbabilityDistributionSetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ProbabilityDistributionSetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ProbabilityDistributionSetImpl::IsSetElements() const + { + return _isSetElements; + } + + IOpenScenarioFlexElement* ProbabilityDistributionSetElementImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ProbabilityDistributionSetElementImpl::GetValue() const + { + return _value; + } + double ProbabilityDistributionSetElementImpl::GetWeight() const + { + return _weight; + } + + + void ProbabilityDistributionSetElementImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void ProbabilityDistributionSetElementImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + std::shared_ptr ProbabilityDistributionSetElementImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ProbabilityDistributionSetElementImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IProbabilityDistributionSetElement).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IProbabilityDistributionSetElementWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ProbabilityDistributionSetElementImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ProbabilityDistributionSetElementImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ProbabilityDistributionSetElementImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ProbabilityDistributionSetElementImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ProbabilityDistributionSetElementImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ProbabilityDistributionSetElementImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ProbabilityDistributionSetElementImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ProbabilityDistributionSetElementImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ProbabilityDistributionSetElementImpl::GetModelType() const + { + return "ProbabilityDistributionSetElement"; + } + + void ProbabilityDistributionSetElementImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + void ProbabilityDistributionSetElementImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string ProbabilityDistributionSetElementImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + std::string ProbabilityDistributionSetElementImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool ProbabilityDistributionSetElementImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ProbabilityDistributionSetElementImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ProbabilityDistributionSetElementImpl::ProbabilityDistributionSetElementImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void ProbabilityDistributionSetElementImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType ProbabilityDistributionSetElementImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ProbabilityDistributionSetElementImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ProbabilityDistributionSetElementImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ProbabilityDistributionSetElementImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ProbabilityDistributionSetElementImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ProbabilityDistributionSetElementImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ProbabilityDistributionSetElementImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ProbabilityDistributionSetElementImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ProbabilityDistributionSetElementImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + void ProbabilityDistributionSetElementImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool ProbabilityDistributionSetElementImpl::IsSetValue() const + { + return _isSetValue; + } + bool ProbabilityDistributionSetElementImpl::IsSetWeight() const + { + return _isSetWeight; + } + + IOpenScenarioFlexElement* PropertiesImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> PropertiesImpl::GetProperties() const + { + std::vector> temp; + for(auto&& elm: _properties) + temp.push_back(elm); + return temp; + } + std::vector> PropertiesImpl::GetWriterProperties() const + { + return _properties; + } + + int PropertiesImpl::GetPropertiesSize() const + { + return static_cast(_properties.size()); + } + + std::shared_ptr PropertiesImpl::GetPropertiesAtIndex(unsigned int index) const + { + if (index >= 0 && _properties.size() > index) + { + return _properties[index]; + } + return nullptr; + } + std::vector> PropertiesImpl::GetFiles() const + { + std::vector> temp; + for(auto&& elm: _files) + temp.push_back(elm); + return temp; + } + std::vector> PropertiesImpl::GetWriterFiles() const + { + return _files; + } + + int PropertiesImpl::GetFilesSize() const + { + return static_cast(_files.size()); + } + + std::shared_ptr PropertiesImpl::GetFilesAtIndex(unsigned int index) const + { + if (index >= 0 && _files.size() > index) + { + return _files[index]; + } + return nullptr; + } + std::vector> PropertiesImpl::GetCustomContent() const + { + std::vector> temp; + for(auto&& elm: _customContent) + temp.push_back(elm); + return temp; + } + std::vector> PropertiesImpl::GetWriterCustomContent() const + { + return _customContent; + } + + int PropertiesImpl::GetCustomContentSize() const + { + return static_cast(_customContent.size()); + } + + std::shared_ptr PropertiesImpl::GetCustomContentAtIndex(unsigned int index) const + { + if (index >= 0 && _customContent.size() > index) + { + return _customContent[index]; + } + return nullptr; + } + + + void PropertiesImpl::SetProperties(std::vector>& properties) + { + _properties = properties; + _isSetProperties = true; + } + + void PropertiesImpl::SetFiles(std::vector>& files) + { + _files = files; + _isSetFiles = true; + } + + void PropertiesImpl::SetCustomContent(std::vector>& customContent) + { + _customContent = customContent; + _isSetCustomContent = true; + } + + std::shared_ptr PropertiesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PropertiesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IProperties).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPropertiesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PropertiesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PropertiesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PropertiesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PropertiesImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PropertiesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PropertiesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PropertiesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PropertiesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PropertiesImpl::GetModelType() const + { + return "Properties"; + } + + // children + + PropertiesImpl::PropertiesImpl() + { + /** + * Filling the property to type map + */ + } + + void PropertiesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType PropertiesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PropertiesImpl::GetChildren() const + { + std::vector> result; + + auto properties = GetWriterProperties(); + if (!properties.empty()) + { + for(auto&& item : properties) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto files = GetWriterFiles(); + if (!files.empty()) + { + for(auto&& item : files) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto customContent = GetWriterCustomContent(); + if (!customContent.empty()) + { + for(auto&& item : customContent) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PropertiesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kProperties = GetWriterProperties(); + if (!kProperties.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetProperties(clonedList); + } + const auto kFiles = GetWriterFiles(); + if (!kFiles.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kFiles) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetFiles(clonedList); + } + const auto kCustomContent = GetWriterCustomContent(); + if (!kCustomContent.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kCustomContent) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetCustomContent(clonedList); + } + return clonedObject; + } + + std::string PropertiesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr PropertiesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PropertiesImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTY) + { + std::vector> vect; + for (auto&& elem : GetProperties()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__FILE) + { + std::vector> vect; + for (auto&& elem : GetFiles()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__CUSTOM_CONTENT) + { + std::vector> vect; + for (auto&& elem : GetCustomContent()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PropertiesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PropertiesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void PropertiesImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool PropertiesImpl::IsSetProperties() const + { + return _isSetProperties; + } + void PropertiesImpl::ResetFiles() + { + _isSetFiles = false; + _files = {}; + + } + bool PropertiesImpl::IsSetFiles() const + { + return _isSetFiles; + } + void PropertiesImpl::ResetCustomContent() + { + _isSetCustomContent = false; + _customContent = {}; + + } + bool PropertiesImpl::IsSetCustomContent() const + { + return _isSetCustomContent; + } + + IOpenScenarioFlexElement* PropertyImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string PropertyImpl::GetName() const + { + return _name; + } + std::string PropertyImpl::GetValue() const + { + return _value; + } + + + void PropertyImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void PropertyImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr PropertyImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(PropertyImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IProperty).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IPropertyWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr PropertyImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t PropertyImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int PropertyImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double PropertyImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t PropertyImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool PropertyImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime PropertyImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr PropertyImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string PropertyImpl::GetModelType() const + { + return "Property"; + } + + void PropertyImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void PropertyImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string PropertyImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string PropertyImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool PropertyImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool PropertyImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + PropertyImpl::PropertyImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void PropertyImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType PropertyImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> PropertyImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr PropertyImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string PropertyImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr PropertyImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> PropertyImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr PropertyImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string PropertyImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void PropertyImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool PropertyImpl::IsSetName() const + { + return _isSetName; + } + bool PropertyImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RandomRouteActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + + + std::shared_ptr RandomRouteActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RandomRouteActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRandomRouteAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRandomRouteActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RandomRouteActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RandomRouteActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RandomRouteActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RandomRouteActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RandomRouteActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RandomRouteActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RandomRouteActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RandomRouteActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RandomRouteActionImpl::GetModelType() const + { + return "RandomRouteAction"; + } + + // children + + RandomRouteActionImpl::RandomRouteActionImpl() + { + /** + * Filling the property to type map + */ + } + + void RandomRouteActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RandomRouteActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RandomRouteActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RandomRouteActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string RandomRouteActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RandomRouteActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RandomRouteActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RandomRouteActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RandomRouteActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + + IOpenScenarioFlexElement* RangeImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RangeImpl::GetLowerLimit() const + { + return _lowerLimit; + } + double RangeImpl::GetUpperLimit() const + { + return _upperLimit; + } + + + void RangeImpl::SetLowerLimit(const double lowerLimit) + { + _lowerLimit = lowerLimit; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT); + _isSetLowerLimit = true; + } + + void RangeImpl::SetUpperLimit(const double upperLimit) + { + _upperLimit = upperLimit; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT); + _isSetUpperLimit = true; + } + + std::shared_ptr RangeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RangeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRange).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRangeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RangeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RangeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RangeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RangeImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT) + { + return GetLowerLimit(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT) + { + return GetUpperLimit(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RangeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RangeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RangeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RangeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RangeImpl::GetModelType() const + { + return "Range"; + } + + void RangeImpl::WriteParameterToLowerLimit(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, parameterName, nullTextMarker /*no textmarker*/); + _lowerLimit = {}; + } + + void RangeImpl::WriteParameterToUpperLimit(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, parameterName, nullTextMarker /*no textmarker*/); + _upperLimit = {}; + } + + std::string RangeImpl::GetParameterFromLowerLimit() const + { + auto lowerLimit = OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT; + return GetParameterNameFromAttribute(lowerLimit); + } + + std::string RangeImpl::GetParameterFromUpperLimit() const + { + auto upperLimit = OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT; + return GetParameterNameFromAttribute(upperLimit); + } + + bool RangeImpl::IsLowerLimitParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT); + if (kIt != keys.end()) + return true; + return false; + } + + bool RangeImpl::IsUpperLimitParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RangeImpl::RangeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, SimpleType::DOUBLE); + } + + void RangeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT) + { + // Simple type + _lowerLimit = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLowerLimit = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT) + { + // Simple type + _upperLimit = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetUpperLimit = true; + } + } + + SimpleType RangeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RangeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RangeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_lowerLimit = GetLowerLimit(); + // Simple type + clonedObject->_upperLimit = GetUpperLimit(); + // clone indicators + // clone children + return clonedObject; + } + + std::string RangeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RangeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RangeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RangeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RangeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RangeImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT) + { + // Simple type + _lowerLimit = value; + AddResolvedParameter(attributeKey); + _isSetLowerLimit = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT) + { + // Simple type + _upperLimit = value; + AddResolvedParameter(attributeKey); + _isSetUpperLimit = true; + } + + } + + + bool RangeImpl::IsSetLowerLimit() const + { + return _isSetLowerLimit; + } + bool RangeImpl::IsSetUpperLimit() const + { + return _isSetUpperLimit; + } + + IOpenScenarioFlexElement* ReachPositionConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double ReachPositionConditionImpl::GetTolerance() const + { + return _tolerance; + } + std::shared_ptr ReachPositionConditionImpl::GetPosition() const + { + return _position; + } + + + void ReachPositionConditionImpl::SetTolerance(const double tolerance) + { + _tolerance = tolerance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE); + _isSetTolerance = true; + } + + void ReachPositionConditionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr ReachPositionConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ReachPositionConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IReachPositionCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IReachPositionConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ReachPositionConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ReachPositionConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ReachPositionConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ReachPositionConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TOLERANCE) + { + return GetTolerance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t ReachPositionConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ReachPositionConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ReachPositionConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ReachPositionConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ReachPositionConditionImpl::GetModelType() const + { + return "ReachPositionCondition"; + } + + void ReachPositionConditionImpl::WriteParameterToTolerance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, parameterName, nullTextMarker /*no textmarker*/); + _tolerance = {}; + } + + std::string ReachPositionConditionImpl::GetParameterFromTolerance() const + { + auto tolerance = OSC_CONSTANTS::ATTRIBUTE__TOLERANCE; + return GetParameterNameFromAttribute(tolerance); + } + + bool ReachPositionConditionImpl::IsToleranceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TOLERANCE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ReachPositionConditionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + ReachPositionConditionImpl::ReachPositionConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, SimpleType::DOUBLE); + } + + void ReachPositionConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TOLERANCE) + { + // Simple type + _tolerance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTolerance = true; + } + } + + SimpleType ReachPositionConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ReachPositionConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ReachPositionConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_tolerance = GetTolerance(); + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string ReachPositionConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ReachPositionConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> ReachPositionConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ReachPositionConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ReachPositionConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ReachPositionConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TOLERANCE) + { + // Simple type + _tolerance = value; + AddResolvedParameter(attributeKey); + _isSetTolerance = true; + } + + } + + + bool ReachPositionConditionImpl::IsSetTolerance() const + { + return _isSetTolerance; + } + bool ReachPositionConditionImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* RelativeAngleConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RelativeAngleConditionImpl::GetAngle() const + { + return _angle; + } + double RelativeAngleConditionImpl::GetAngleTolerance() const + { + return _angleTolerance; + } + AngleType RelativeAngleConditionImpl::GetAngleType() const + { + return _angleType; + } + CoordinateSystem RelativeAngleConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + std::shared_ptr> RelativeAngleConditionImpl::GetEntityRef() const + { + return _entityRef; + } + + + void RelativeAngleConditionImpl::SetAngle(const double angle) + { + _angle = angle; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE); + _isSetAngle = true; + } + + void RelativeAngleConditionImpl::SetAngleTolerance(const double angleTolerance) + { + _angleTolerance = angleTolerance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE); + _isSetAngleTolerance = true; + } + + void RelativeAngleConditionImpl::SetAngleType(const AngleType angleType) + { + _angleType = angleType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE); + _isSetAngleType = true; + } + + void RelativeAngleConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void RelativeAngleConditionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + std::shared_ptr RelativeAngleConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeAngleConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeAngleCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeAngleConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeAngleConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeAngleConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeAngleConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeAngleConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + return GetAngle(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + return GetAngleTolerance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeAngleConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeAngleConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeAngleConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeAngleConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeAngleConditionImpl::GetModelType() const + { + return "RelativeAngleCondition"; + } + + void RelativeAngleConditionImpl::WriteParameterToAngle(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, parameterName, nullTextMarker /*no textmarker*/); + _angle = {}; + } + + void RelativeAngleConditionImpl::WriteParameterToAngleTolerance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, parameterName, nullTextMarker /*no textmarker*/); + _angleTolerance = {}; + } + + void RelativeAngleConditionImpl::WriteParameterToAngleType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _angleType = {}; + } + + void RelativeAngleConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void RelativeAngleConditionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string RelativeAngleConditionImpl::GetParameterFromAngle() const + { + auto angle = OSC_CONSTANTS::ATTRIBUTE__ANGLE; + return GetParameterNameFromAttribute(angle); + } + + std::string RelativeAngleConditionImpl::GetParameterFromAngleTolerance() const + { + auto angleTolerance = OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE; + return GetParameterNameFromAttribute(angleTolerance); + } + + std::string RelativeAngleConditionImpl::GetParameterFromAngleType() const + { + auto angleType = OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE; + return GetParameterNameFromAttribute(angleType); + } + + std::string RelativeAngleConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string RelativeAngleConditionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool RelativeAngleConditionImpl::IsAngleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeAngleConditionImpl::IsAngleToleranceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeAngleConditionImpl::IsAngleTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeAngleConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeAngleConditionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeAngleConditionImpl::RelativeAngleConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void RelativeAngleConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + // Simple type + _angle = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAngle = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + // Simple type + _angleTolerance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAngleTolerance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE) + { + // Enumeration Type + const auto kResult = AngleType::GetFromLiteral(parameterLiteralValue); + if (kResult != AngleType::UNKNOWN) + { + _angleType = kResult; + AddResolvedParameter(attributeKey); + _isSetAngleType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType RelativeAngleConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeAngleConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeAngleConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_angle = GetAngle(); + // Simple type + clonedObject->_angleTolerance = GetAngleTolerance(); + // Enumeration Type + const auto kAngleType = GetAngleType(); + if ( kAngleType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_angleType = AngleType::GetFromLiteral(kAngleType.GetLiteral()); + } + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + // clone children + return clonedObject; + } + + std::string RelativeAngleConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeAngleConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeAngleConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeAngleConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeAngleConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE) + { + auto angleType = GetAngleType(); + return angleType.GetLiteral() != "UNKNOWN" ? angleType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RelativeAngleConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE) + { + // Simple type + _angle = value; + AddResolvedParameter(attributeKey); + _isSetAngle = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE) + { + // Simple type + _angleTolerance = value; + AddResolvedParameter(attributeKey); + _isSetAngleTolerance = true; + } + + } + + + bool RelativeAngleConditionImpl::IsSetAngle() const + { + return _isSetAngle; + } + bool RelativeAngleConditionImpl::IsSetAngleTolerance() const + { + return _isSetAngleTolerance; + } + bool RelativeAngleConditionImpl::IsSetAngleType() const + { + return _isSetAngleType; + } + void RelativeAngleConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {}; + + } + bool RelativeAngleConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + bool RelativeAngleConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* RelativeClearanceConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RelativeClearanceConditionImpl::GetDistanceBackward() const + { + return _distanceBackward; + } + double RelativeClearanceConditionImpl::GetDistanceForward() const + { + return _distanceForward; + } + bool RelativeClearanceConditionImpl::GetFreeSpace() const + { + return _freeSpace; + } + bool RelativeClearanceConditionImpl::GetOppositeLanes() const + { + return _oppositeLanes; + } + std::vector> RelativeClearanceConditionImpl::GetRelativeLaneRange() const + { + std::vector> temp; + for(auto&& elm: _relativeLaneRange) + temp.push_back(elm); + return temp; + } + std::vector> RelativeClearanceConditionImpl::GetWriterRelativeLaneRange() const + { + return _relativeLaneRange; + } + + int RelativeClearanceConditionImpl::GetRelativeLaneRangeSize() const + { + return static_cast(_relativeLaneRange.size()); + } + + std::shared_ptr RelativeClearanceConditionImpl::GetRelativeLaneRangeAtIndex(unsigned int index) const + { + if (index >= 0 && _relativeLaneRange.size() > index) + { + return _relativeLaneRange[index]; + } + return nullptr; + } + std::vector> RelativeClearanceConditionImpl::GetEntityRef() const + { + std::vector> temp; + for(auto&& elm: _entityRef) + temp.push_back(elm); + return temp; + } + std::vector> RelativeClearanceConditionImpl::GetWriterEntityRef() const + { + return _entityRef; + } + + int RelativeClearanceConditionImpl::GetEntityRefSize() const + { + return static_cast(_entityRef.size()); + } + + std::shared_ptr RelativeClearanceConditionImpl::GetEntityRefAtIndex(unsigned int index) const + { + if (index >= 0 && _entityRef.size() > index) + { + return _entityRef[index]; + } + return nullptr; + } + + + void RelativeClearanceConditionImpl::SetDistanceBackward(const double distanceBackward) + { + _distanceBackward = distanceBackward; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD); + _isSetDistanceBackward = true; + } + + void RelativeClearanceConditionImpl::SetDistanceForward(const double distanceForward) + { + _distanceForward = distanceForward; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD); + _isSetDistanceForward = true; + } + + void RelativeClearanceConditionImpl::SetFreeSpace(const bool freeSpace) + { + _freeSpace = freeSpace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE); + _isSetFreeSpace = true; + } + + void RelativeClearanceConditionImpl::SetOppositeLanes(const bool oppositeLanes) + { + _oppositeLanes = oppositeLanes; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES); + _isSetOppositeLanes = true; + } + + void RelativeClearanceConditionImpl::SetRelativeLaneRange(std::vector>& relativeLaneRange) + { + _relativeLaneRange = relativeLaneRange; + _isSetRelativeLaneRange = true; + } + + void RelativeClearanceConditionImpl::SetEntityRef(std::vector>& entityRef) + { + _entityRef = entityRef; + _isSetEntityRef = true; + } + + std::shared_ptr RelativeClearanceConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeClearanceConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeClearanceCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeClearanceConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeClearanceConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeClearanceConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeClearanceConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeClearanceConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD) + { + return GetDistanceBackward(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD) + { + return GetDistanceForward(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeClearanceConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeClearanceConditionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE) + { + return GetFreeSpace(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES) + { + return GetOppositeLanes(); + } + throw KeyNotSupportedException(); + + } + + DateTime RelativeClearanceConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeClearanceConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeClearanceConditionImpl::GetModelType() const + { + return "RelativeClearanceCondition"; + } + + void RelativeClearanceConditionImpl::WriteParameterToDistanceBackward(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, parameterName, nullTextMarker /*no textmarker*/); + _distanceBackward = {}; + } + + void RelativeClearanceConditionImpl::WriteParameterToDistanceForward(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, parameterName, nullTextMarker /*no textmarker*/); + _distanceForward = {}; + } + + void RelativeClearanceConditionImpl::WriteParameterToFreeSpace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, parameterName, nullTextMarker /*no textmarker*/); + _freeSpace = {}; + } + + void RelativeClearanceConditionImpl::WriteParameterToOppositeLanes(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, parameterName, nullTextMarker /*no textmarker*/); + _oppositeLanes = {}; + } + + std::string RelativeClearanceConditionImpl::GetParameterFromDistanceBackward() const + { + auto distanceBackward = OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD; + return GetParameterNameFromAttribute(distanceBackward); + } + + std::string RelativeClearanceConditionImpl::GetParameterFromDistanceForward() const + { + auto distanceForward = OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD; + return GetParameterNameFromAttribute(distanceForward); + } + + std::string RelativeClearanceConditionImpl::GetParameterFromFreeSpace() const + { + auto freeSpace = OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE; + return GetParameterNameFromAttribute(freeSpace); + } + + std::string RelativeClearanceConditionImpl::GetParameterFromOppositeLanes() const + { + auto oppositeLanes = OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES; + return GetParameterNameFromAttribute(oppositeLanes); + } + + bool RelativeClearanceConditionImpl::IsDistanceBackwardParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeClearanceConditionImpl::IsDistanceForwardParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeClearanceConditionImpl::IsFreeSpaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeClearanceConditionImpl::IsOppositeLanesParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeClearanceConditionImpl::RelativeClearanceConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, SimpleType::BOOLEAN); + } + + void RelativeClearanceConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD) + { + // Simple type + _distanceBackward = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDistanceBackward = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD) + { + // Simple type + _distanceForward = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDistanceForward = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE) + { + // Simple type + _freeSpace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreeSpace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES) + { + // Simple type + _oppositeLanes = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOppositeLanes = true; + } + } + + SimpleType RelativeClearanceConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeClearanceConditionImpl::GetChildren() const + { + std::vector> result; + + auto relativeLaneRange = GetWriterRelativeLaneRange(); + if (!relativeLaneRange.empty()) + { + for(auto&& item : relativeLaneRange) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto entityRef = GetWriterEntityRef(); + if (!entityRef.empty()) + { + for(auto&& item : entityRef) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeClearanceConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_distanceBackward = GetDistanceBackward(); + // Simple type + clonedObject->_distanceForward = GetDistanceForward(); + // Simple type + clonedObject->_freeSpace = GetFreeSpace(); + // Simple type + clonedObject->_oppositeLanes = GetOppositeLanes(); + // clone indicators + clonedObject->_isSetDistanceBackward = _isSetDistanceBackward; + clonedObject->_isSetDistanceForward = _isSetDistanceForward; + // clone children + const auto kRelativeLaneRange = GetWriterRelativeLaneRange(); + if (!kRelativeLaneRange.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kRelativeLaneRange) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetRelativeLaneRange(clonedList); + } + const auto kEntityRef = GetWriterEntityRef(); + if (!kEntityRef.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntityRef) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntityRef(clonedList); + } + return clonedObject; + } + + std::string RelativeClearanceConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeClearanceConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeClearanceConditionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_RANGE) + { + std::vector> vect; + for (auto&& elem : GetRelativeLaneRange()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + std::vector> vect; + for (auto&& elem : GetEntityRef()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeClearanceConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RelativeClearanceConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeClearanceConditionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE) + { + // Simple type + _freeSpace = value; + AddResolvedParameter(attributeKey); + _isSetFreeSpace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES) + { + // Simple type + _oppositeLanes = value; + AddResolvedParameter(attributeKey); + _isSetOppositeLanes = true; + } + + } + void RelativeClearanceConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD) + { + // Simple type + _distanceBackward = value; + AddResolvedParameter(attributeKey); + _isSetDistanceBackward = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD) + { + // Simple type + _distanceForward = value; + AddResolvedParameter(attributeKey); + _isSetDistanceForward = true; + } + + } + + + void RelativeClearanceConditionImpl::ResetDistanceBackward() + { + _isSetDistanceBackward = false; + _distanceBackward = {0}; + + } + bool RelativeClearanceConditionImpl::IsSetDistanceBackward() const + { + return _isSetDistanceBackward; + } + void RelativeClearanceConditionImpl::ResetDistanceForward() + { + _isSetDistanceForward = false; + _distanceForward = {0}; + + } + bool RelativeClearanceConditionImpl::IsSetDistanceForward() const + { + return _isSetDistanceForward; + } + bool RelativeClearanceConditionImpl::IsSetFreeSpace() const + { + return _isSetFreeSpace; + } + bool RelativeClearanceConditionImpl::IsSetOppositeLanes() const + { + return _isSetOppositeLanes; + } + void RelativeClearanceConditionImpl::ResetRelativeLaneRange() + { + _isSetRelativeLaneRange = false; + _relativeLaneRange = {}; + + } + bool RelativeClearanceConditionImpl::IsSetRelativeLaneRange() const + { + return _isSetRelativeLaneRange; + } + void RelativeClearanceConditionImpl::ResetEntityRef() + { + _isSetEntityRef = false; + _entityRef = {}; + + } + bool RelativeClearanceConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* RelativeDistanceConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + CoordinateSystem RelativeDistanceConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + std::shared_ptr> RelativeDistanceConditionImpl::GetEntityRef() const + { + return _entityRef; + } + bool RelativeDistanceConditionImpl::GetFreespace() const + { + return _freespace; + } + RelativeDistanceType RelativeDistanceConditionImpl::GetRelativeDistanceType() const + { + return _relativeDistanceType; + } + RoutingAlgorithm RelativeDistanceConditionImpl::GetRoutingAlgorithm() const + { + return _routingAlgorithm; + } + Rule RelativeDistanceConditionImpl::GetRule() const + { + return _rule; + } + double RelativeDistanceConditionImpl::GetValue() const + { + return _value; + } + + + void RelativeDistanceConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void RelativeDistanceConditionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeDistanceConditionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void RelativeDistanceConditionImpl::SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) + { + _relativeDistanceType = relativeDistanceType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + _isSetRelativeDistanceType = true; + } + + void RelativeDistanceConditionImpl::SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) + { + _routingAlgorithm = routingAlgorithm; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + _isSetRoutingAlgorithm = true; + } + + void RelativeDistanceConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void RelativeDistanceConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr RelativeDistanceConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeDistanceConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeDistanceCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeDistanceConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeDistanceConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeDistanceConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeDistanceConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeDistanceConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeDistanceConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeDistanceConditionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime RelativeDistanceConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeDistanceConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeDistanceConditionImpl::GetModelType() const + { + return "RelativeDistanceCondition"; + } + + void RelativeDistanceConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToRelativeDistanceType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _relativeDistanceType = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToRoutingAlgorithm(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, parameterName, nullTextMarker /*no textmarker*/); + _routingAlgorithm = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void RelativeDistanceConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeDistanceConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromRelativeDistanceType() const + { + auto relativeDistanceType = OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE; + return GetParameterNameFromAttribute(relativeDistanceType); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromRoutingAlgorithm() const + { + auto routingAlgorithm = OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM; + return GetParameterNameFromAttribute(routingAlgorithm); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string RelativeDistanceConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeDistanceConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsRelativeDistanceTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsRoutingAlgorithmParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeDistanceConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeDistanceConditionImpl::RelativeDistanceConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void RelativeDistanceConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(parameterLiteralValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + _relativeDistanceType = kResult; + AddResolvedParameter(attributeKey); + _isSetRelativeDistanceType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(parameterLiteralValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + _routingAlgorithm = kResult; + AddResolvedParameter(attributeKey); + _isSetRoutingAlgorithm = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeDistanceConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeDistanceConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeDistanceConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_freespace = GetFreespace(); + // Enumeration Type + const auto kRelativeDistanceType = GetRelativeDistanceType(); + if ( kRelativeDistanceType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_relativeDistanceType = RelativeDistanceType::GetFromLiteral(kRelativeDistanceType.GetLiteral()); + } + // Enumeration Type + const auto kRoutingAlgorithm = GetRoutingAlgorithm(); + if ( kRoutingAlgorithm.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_routingAlgorithm = RoutingAlgorithm::GetFromLiteral(kRoutingAlgorithm.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetRoutingAlgorithm = _isSetRoutingAlgorithm; + // clone children + return clonedObject; + } + + std::string RelativeDistanceConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeDistanceConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeDistanceConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeDistanceConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeDistanceConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + auto relativeDistanceType = GetRelativeDistanceType(); + return relativeDistanceType.GetLiteral() != "UNKNOWN" ? relativeDistanceType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + auto routingAlgorithm = GetRoutingAlgorithm(); + return routingAlgorithm.GetLiteral() != "UNKNOWN" ? routingAlgorithm.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RelativeDistanceConditionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void RelativeDistanceConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void RelativeDistanceConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool RelativeDistanceConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + bool RelativeDistanceConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool RelativeDistanceConditionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + bool RelativeDistanceConditionImpl::IsSetRelativeDistanceType() const + { + return _isSetRelativeDistanceType; + } + void RelativeDistanceConditionImpl::ResetRoutingAlgorithm() + { + _isSetRoutingAlgorithm = false; + _routingAlgorithm = {RoutingAlgorithm::RoutingAlgorithmEnum::UNDEFINED}; + + } + bool RelativeDistanceConditionImpl::IsSetRoutingAlgorithm() const + { + return _isSetRoutingAlgorithm; + } + bool RelativeDistanceConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool RelativeDistanceConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RelativeLanePositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + int RelativeLanePositionImpl::GetDLane() const + { + return _dLane; + } + double RelativeLanePositionImpl::GetDs() const + { + return _ds; + } + double RelativeLanePositionImpl::GetDsLane() const + { + return _dsLane; + } + std::shared_ptr> RelativeLanePositionImpl::GetEntityRef() const + { + return _entityRef; + } + double RelativeLanePositionImpl::GetOffset() const + { + return _offset; + } + std::shared_ptr RelativeLanePositionImpl::GetOrientation() const + { + return _orientation; + } + + + void RelativeLanePositionImpl::SetDLane(const int dLane) + { + _dLane = dLane; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__D_LANE); + _isSetDLane = true; + } + + void RelativeLanePositionImpl::SetDs(const double ds) + { + _ds = ds; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS); + _isSetDs = true; + } + + void RelativeLanePositionImpl::SetDsLane(const double dsLane) + { + _dsLane = dsLane; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS_LANE); + _isSetDsLane = true; + } + + void RelativeLanePositionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeLanePositionImpl::SetOffset(const double offset) + { + _offset = offset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET); + _isSetOffset = true; + } + + void RelativeLanePositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr RelativeLanePositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeLanePositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeLanePosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeLanePositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeLanePositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeLanePositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeLanePositionImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__D_LANE) + { + return GetDLane(); + } + throw KeyNotSupportedException(); + + } + + double RelativeLanePositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DS) + { + return GetDs(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DS_LANE) + { + return GetDsLane(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + return GetOffset(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeLanePositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeLanePositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeLanePositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeLanePositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeLanePositionImpl::GetModelType() const + { + return "RelativeLanePosition"; + } + + void RelativeLanePositionImpl::WriteParameterToDLane(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__D_LANE, parameterName, nullTextMarker /*no textmarker*/); + _dLane = {}; + } + + void RelativeLanePositionImpl::WriteParameterToDs(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, parameterName, nullTextMarker /*no textmarker*/); + _ds = {}; + } + + void RelativeLanePositionImpl::WriteParameterToDsLane(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, parameterName, nullTextMarker /*no textmarker*/); + _dsLane = {}; + } + + void RelativeLanePositionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeLanePositionImpl::WriteParameterToOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _offset = {}; + } + + std::string RelativeLanePositionImpl::GetParameterFromDLane() const + { + auto dLane = OSC_CONSTANTS::ATTRIBUTE__D_LANE; + return GetParameterNameFromAttribute(dLane); + } + + std::string RelativeLanePositionImpl::GetParameterFromDs() const + { + auto ds = OSC_CONSTANTS::ATTRIBUTE__DS; + return GetParameterNameFromAttribute(ds); + } + + std::string RelativeLanePositionImpl::GetParameterFromDsLane() const + { + auto dsLane = OSC_CONSTANTS::ATTRIBUTE__DS_LANE; + return GetParameterNameFromAttribute(dsLane); + } + + std::string RelativeLanePositionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeLanePositionImpl::GetParameterFromOffset() const + { + auto offset = OSC_CONSTANTS::ATTRIBUTE__OFFSET; + return GetParameterNameFromAttribute(offset); + } + + bool RelativeLanePositionImpl::IsDLaneParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__D_LANE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeLanePositionImpl::IsDsParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DS); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeLanePositionImpl::IsDsLaneParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DS_LANE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeLanePositionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeLanePositionImpl::IsOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RelativeLanePositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + RelativeLanePositionImpl::RelativeLanePositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__D_LANE, SimpleType::INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OFFSET, SimpleType::DOUBLE); + } + + void RelativeLanePositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__D_LANE) + { + // Simple type + _dLane = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDLane = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS) + { + // Simple type + _ds = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDs = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS_LANE) + { + // Simple type + _dsLane = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDsLane = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + } + + SimpleType RelativeLanePositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeLanePositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeLanePositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dLane = GetDLane(); + // Simple type + clonedObject->_ds = GetDs(); + // Simple type + clonedObject->_dsLane = GetDsLane(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_offset = GetOffset(); + // clone indicators + clonedObject->_isSetDs = _isSetDs; + clonedObject->_isSetDsLane = _isSetDsLane; + clonedObject->_isSetOffset = _isSetOffset; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string RelativeLanePositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeLanePositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> RelativeLanePositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeLanePositionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeLanePositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeLanePositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS) + { + // Simple type + _ds = value; + AddResolvedParameter(attributeKey); + _isSetDs = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS_LANE) + { + // Simple type + _dsLane = value; + AddResolvedParameter(attributeKey); + _isSetDsLane = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = value; + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + + } + void RelativeLanePositionImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__D_LANE) + { + // Simple type + _dLane = value; + AddResolvedParameter(attributeKey); + _isSetDLane = true; + } + + } + + + bool RelativeLanePositionImpl::IsSetDLane() const + { + return _isSetDLane; + } + void RelativeLanePositionImpl::ResetDs() + { + _isSetDs = false; + _ds = {}; + + } + bool RelativeLanePositionImpl::IsSetDs() const + { + return _isSetDs; + } + void RelativeLanePositionImpl::ResetDsLane() + { + _isSetDsLane = false; + _dsLane = {}; + + } + bool RelativeLanePositionImpl::IsSetDsLane() const + { + return _isSetDsLane; + } + bool RelativeLanePositionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + void RelativeLanePositionImpl::ResetOffset() + { + _isSetOffset = false; + _offset = {0}; + + } + bool RelativeLanePositionImpl::IsSetOffset() const + { + return _isSetOffset; + } + void RelativeLanePositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RelativeLanePositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* RelativeLaneRangeImpl::GetOpenScenarioFlexElement() + { + return this; + } + int RelativeLaneRangeImpl::GetFrom() const + { + return _from; + } + int RelativeLaneRangeImpl::GetTo() const + { + return _to; + } + + + void RelativeLaneRangeImpl::SetFrom(const int from) + { + _from = from; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FROM); + _isSetFrom = true; + } + + void RelativeLaneRangeImpl::SetTo(const int to) + { + _to = to; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TO); + _isSetTo = true; + } + + std::shared_ptr RelativeLaneRangeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeLaneRangeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeLaneRange).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeLaneRangeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeLaneRangeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeLaneRangeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeLaneRangeImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FROM) + { + return GetFrom(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TO) + { + return GetTo(); + } + throw KeyNotSupportedException(); + + } + + double RelativeLaneRangeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RelativeLaneRangeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeLaneRangeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeLaneRangeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeLaneRangeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeLaneRangeImpl::GetModelType() const + { + return "RelativeLaneRange"; + } + + void RelativeLaneRangeImpl::WriteParameterToFrom(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FROM, parameterName, nullTextMarker /*no textmarker*/); + _from = {}; + } + + void RelativeLaneRangeImpl::WriteParameterToTo(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TO, parameterName, nullTextMarker /*no textmarker*/); + _to = {}; + } + + std::string RelativeLaneRangeImpl::GetParameterFromFrom() const + { + auto from = OSC_CONSTANTS::ATTRIBUTE__FROM; + return GetParameterNameFromAttribute(from); + } + + std::string RelativeLaneRangeImpl::GetParameterFromTo() const + { + auto to = OSC_CONSTANTS::ATTRIBUTE__TO; + return GetParameterNameFromAttribute(to); + } + + bool RelativeLaneRangeImpl::IsFromParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FROM); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeLaneRangeImpl::IsToParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TO); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeLaneRangeImpl::RelativeLaneRangeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FROM, SimpleType::INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TO, SimpleType::INT); + } + + void RelativeLaneRangeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FROM) + { + // Simple type + _from = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFrom = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TO) + { + // Simple type + _to = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTo = true; + } + } + + SimpleType RelativeLaneRangeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeLaneRangeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeLaneRangeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_from = GetFrom(); + // Simple type + clonedObject->_to = GetTo(); + // clone indicators + clonedObject->_isSetFrom = _isSetFrom; + clonedObject->_isSetTo = _isSetTo; + // clone children + return clonedObject; + } + + std::string RelativeLaneRangeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeLaneRangeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeLaneRangeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeLaneRangeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RelativeLaneRangeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeLaneRangeImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FROM) + { + // Simple type + _from = value; + AddResolvedParameter(attributeKey); + _isSetFrom = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TO) + { + // Simple type + _to = value; + AddResolvedParameter(attributeKey); + _isSetTo = true; + } + + } + + + void RelativeLaneRangeImpl::ResetFrom() + { + _isSetFrom = false; + _from = {}; + + } + bool RelativeLaneRangeImpl::IsSetFrom() const + { + return _isSetFrom; + } + void RelativeLaneRangeImpl::ResetTo() + { + _isSetTo = false; + _to = {}; + + } + bool RelativeLaneRangeImpl::IsSetTo() const + { + return _isSetTo; + } + + IOpenScenarioFlexElement* RelativeObjectPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RelativeObjectPositionImpl::GetDx() const + { + return _dx; + } + double RelativeObjectPositionImpl::GetDy() const + { + return _dy; + } + double RelativeObjectPositionImpl::GetDz() const + { + return _dz; + } + std::shared_ptr> RelativeObjectPositionImpl::GetEntityRef() const + { + return _entityRef; + } + std::shared_ptr RelativeObjectPositionImpl::GetOrientation() const + { + return _orientation; + } + + + void RelativeObjectPositionImpl::SetDx(const double dx) + { + _dx = dx; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX); + _isSetDx = true; + } + + void RelativeObjectPositionImpl::SetDy(const double dy) + { + _dy = dy; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY); + _isSetDy = true; + } + + void RelativeObjectPositionImpl::SetDz(const double dz) + { + _dz = dz; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ); + _isSetDz = true; + } + + void RelativeObjectPositionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeObjectPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr RelativeObjectPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeObjectPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeObjectPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeObjectPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeObjectPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeObjectPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeObjectPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeObjectPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DX) + { + return GetDx(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DY) + { + return GetDy(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + return GetDz(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeObjectPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeObjectPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeObjectPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeObjectPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeObjectPositionImpl::GetModelType() const + { + return "RelativeObjectPosition"; + } + + void RelativeObjectPositionImpl::WriteParameterToDx(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, parameterName, nullTextMarker /*no textmarker*/); + _dx = {}; + } + + void RelativeObjectPositionImpl::WriteParameterToDy(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, parameterName, nullTextMarker /*no textmarker*/); + _dy = {}; + } + + void RelativeObjectPositionImpl::WriteParameterToDz(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, parameterName, nullTextMarker /*no textmarker*/); + _dz = {}; + } + + void RelativeObjectPositionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string RelativeObjectPositionImpl::GetParameterFromDx() const + { + auto dx = OSC_CONSTANTS::ATTRIBUTE__DX; + return GetParameterNameFromAttribute(dx); + } + + std::string RelativeObjectPositionImpl::GetParameterFromDy() const + { + auto dy = OSC_CONSTANTS::ATTRIBUTE__DY; + return GetParameterNameFromAttribute(dy); + } + + std::string RelativeObjectPositionImpl::GetParameterFromDz() const + { + auto dz = OSC_CONSTANTS::ATTRIBUTE__DZ; + return GetParameterNameFromAttribute(dz); + } + + std::string RelativeObjectPositionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool RelativeObjectPositionImpl::IsDxParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DX); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeObjectPositionImpl::IsDyParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DY); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeObjectPositionImpl::IsDzParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DZ); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeObjectPositionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RelativeObjectPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + RelativeObjectPositionImpl::RelativeObjectPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DX, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DZ, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void RelativeObjectPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DY) + { + // Simple type + _dy = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDy = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType RelativeObjectPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeObjectPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeObjectPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dx = GetDx(); + // Simple type + clonedObject->_dy = GetDy(); + // Simple type + clonedObject->_dz = GetDz(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + clonedObject->_isSetDz = _isSetDz; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string RelativeObjectPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeObjectPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> RelativeObjectPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeObjectPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeObjectPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeObjectPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = value; + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DY) + { + // Simple type + _dy = value; + AddResolvedParameter(attributeKey); + _isSetDy = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = value; + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + + } + + + bool RelativeObjectPositionImpl::IsSetDx() const + { + return _isSetDx; + } + bool RelativeObjectPositionImpl::IsSetDy() const + { + return _isSetDy; + } + void RelativeObjectPositionImpl::ResetDz() + { + _isSetDz = false; + _dz = {0}; + + } + bool RelativeObjectPositionImpl::IsSetDz() const + { + return _isSetDz; + } + bool RelativeObjectPositionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + void RelativeObjectPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RelativeObjectPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* RelativeRoadPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RelativeRoadPositionImpl::GetDs() const + { + return _ds; + } + double RelativeRoadPositionImpl::GetDt() const + { + return _dt; + } + std::shared_ptr> RelativeRoadPositionImpl::GetEntityRef() const + { + return _entityRef; + } + std::shared_ptr RelativeRoadPositionImpl::GetOrientation() const + { + return _orientation; + } + + + void RelativeRoadPositionImpl::SetDs(const double ds) + { + _ds = ds; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS); + _isSetDs = true; + } + + void RelativeRoadPositionImpl::SetDt(const double dt) + { + _dt = dt; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DT); + _isSetDt = true; + } + + void RelativeRoadPositionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeRoadPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr RelativeRoadPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeRoadPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeRoadPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeRoadPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeRoadPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeRoadPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeRoadPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeRoadPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DS) + { + return GetDs(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DT) + { + return GetDt(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeRoadPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeRoadPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeRoadPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeRoadPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeRoadPositionImpl::GetModelType() const + { + return "RelativeRoadPosition"; + } + + void RelativeRoadPositionImpl::WriteParameterToDs(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, parameterName, nullTextMarker /*no textmarker*/); + _ds = {}; + } + + void RelativeRoadPositionImpl::WriteParameterToDt(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DT, parameterName, nullTextMarker /*no textmarker*/); + _dt = {}; + } + + void RelativeRoadPositionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string RelativeRoadPositionImpl::GetParameterFromDs() const + { + auto ds = OSC_CONSTANTS::ATTRIBUTE__DS; + return GetParameterNameFromAttribute(ds); + } + + std::string RelativeRoadPositionImpl::GetParameterFromDt() const + { + auto dt = OSC_CONSTANTS::ATTRIBUTE__DT; + return GetParameterNameFromAttribute(dt); + } + + std::string RelativeRoadPositionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool RelativeRoadPositionImpl::IsDsParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DS); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeRoadPositionImpl::IsDtParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DT); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeRoadPositionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RelativeRoadPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + RelativeRoadPositionImpl::RelativeRoadPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DT, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void RelativeRoadPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS) + { + // Simple type + _ds = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDs = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DT) + { + // Simple type + _dt = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDt = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType RelativeRoadPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeRoadPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeRoadPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_ds = GetDs(); + // Simple type + clonedObject->_dt = GetDt(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string RelativeRoadPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeRoadPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> RelativeRoadPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeRoadPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeRoadPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeRoadPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DS) + { + // Simple type + _ds = value; + AddResolvedParameter(attributeKey); + _isSetDs = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DT) + { + // Simple type + _dt = value; + AddResolvedParameter(attributeKey); + _isSetDt = true; + } + + } + + + bool RelativeRoadPositionImpl::IsSetDs() const + { + return _isSetDs; + } + bool RelativeRoadPositionImpl::IsSetDt() const + { + return _isSetDt; + } + bool RelativeRoadPositionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + void RelativeRoadPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RelativeRoadPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* RelativeSpeedConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + DirectionalDimension RelativeSpeedConditionImpl::GetDirection() const + { + return _direction; + } + std::shared_ptr> RelativeSpeedConditionImpl::GetEntityRef() const + { + return _entityRef; + } + Rule RelativeSpeedConditionImpl::GetRule() const + { + return _rule; + } + double RelativeSpeedConditionImpl::GetValue() const + { + return _value; + } + + + void RelativeSpeedConditionImpl::SetDirection(const DirectionalDimension direction) + { + _direction = direction; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + _isSetDirection = true; + } + + void RelativeSpeedConditionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeSpeedConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void RelativeSpeedConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr RelativeSpeedConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeSpeedConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeSpeedCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeSpeedConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeSpeedConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeSpeedConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeSpeedConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeSpeedConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeSpeedConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeSpeedConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeSpeedConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeSpeedConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeSpeedConditionImpl::GetModelType() const + { + return "RelativeSpeedCondition"; + } + + void RelativeSpeedConditionImpl::WriteParameterToDirection(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, parameterName, nullTextMarker /*no textmarker*/); + _direction = {}; + } + + void RelativeSpeedConditionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeSpeedConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void RelativeSpeedConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeSpeedConditionImpl::GetParameterFromDirection() const + { + auto direction = OSC_CONSTANTS::ATTRIBUTE__DIRECTION; + return GetParameterNameFromAttribute(direction); + } + + std::string RelativeSpeedConditionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeSpeedConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string RelativeSpeedConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeSpeedConditionImpl::IsDirectionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeSpeedConditionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeSpeedConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeSpeedConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeSpeedConditionImpl::RelativeSpeedConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void RelativeSpeedConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(parameterLiteralValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + _direction = kResult; + AddResolvedParameter(attributeKey); + _isSetDirection = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeSpeedConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeSpeedConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeSpeedConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDirection = GetDirection(); + if ( kDirection.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_direction = DirectionalDimension::GetFromLiteral(kDirection.GetLiteral()); + } + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetDirection = _isSetDirection; + // clone children + return clonedObject; + } + + std::string RelativeSpeedConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeSpeedConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeSpeedConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeSpeedConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeSpeedConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + auto direction = GetDirection(); + return direction.GetLiteral() != "UNKNOWN" ? direction.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RelativeSpeedConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void RelativeSpeedConditionImpl::ResetDirection() + { + _isSetDirection = false; + _direction = {}; + + } + bool RelativeSpeedConditionImpl::IsSetDirection() const + { + return _isSetDirection; + } + bool RelativeSpeedConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool RelativeSpeedConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool RelativeSpeedConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RelativeSpeedToMasterImpl::GetOpenScenarioFlexElement() + { + return this; + } + SpeedTargetValueType RelativeSpeedToMasterImpl::GetSpeedTargetValueType() const + { + return _speedTargetValueType; + } + double RelativeSpeedToMasterImpl::GetValue() const + { + return _value; + } + std::shared_ptr RelativeSpeedToMasterImpl::GetSteadyState() const + { + return _steadyState; + } + + + void RelativeSpeedToMasterImpl::SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) + { + _speedTargetValueType = speedTargetValueType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE); + _isSetSpeedTargetValueType = true; + } + + void RelativeSpeedToMasterImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void RelativeSpeedToMasterImpl::SetSteadyState(std::shared_ptr steadyState) + { + _steadyState = steadyState; + _isSetSteadyState = true; + } + + std::shared_ptr RelativeSpeedToMasterImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeSpeedToMasterImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeSpeedToMaster).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeSpeedToMasterWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeSpeedToMasterImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeSpeedToMasterImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeSpeedToMasterImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeSpeedToMasterImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeSpeedToMasterImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeSpeedToMasterImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeSpeedToMasterImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeSpeedToMasterImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeSpeedToMasterImpl::GetModelType() const + { + return "RelativeSpeedToMaster"; + } + + void RelativeSpeedToMasterImpl::WriteParameterToSpeedTargetValueType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _speedTargetValueType = {}; + } + + void RelativeSpeedToMasterImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeSpeedToMasterImpl::GetParameterFromSpeedTargetValueType() const + { + auto speedTargetValueType = OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE; + return GetParameterNameFromAttribute(speedTargetValueType); + } + + std::string RelativeSpeedToMasterImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeSpeedToMasterImpl::IsSpeedTargetValueTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeSpeedToMasterImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RelativeSpeedToMasterImpl::GetWriterSteadyState() const + { + return std::dynamic_pointer_cast(_steadyState); + } + + RelativeSpeedToMasterImpl::RelativeSpeedToMasterImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void RelativeSpeedToMasterImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE) + { + // Enumeration Type + const auto kResult = SpeedTargetValueType::GetFromLiteral(parameterLiteralValue); + if (kResult != SpeedTargetValueType::UNKNOWN) + { + _speedTargetValueType = kResult; + AddResolvedParameter(attributeKey); + _isSetSpeedTargetValueType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeSpeedToMasterImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeSpeedToMasterImpl::GetChildren() const + { + std::vector> result; + + const auto kSteadyState = GetWriterSteadyState(); + if (kSteadyState) + { + result.push_back(std::dynamic_pointer_cast(kSteadyState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeSpeedToMasterImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kSpeedTargetValueType = GetSpeedTargetValueType(); + if ( kSpeedTargetValueType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_speedTargetValueType = SpeedTargetValueType::GetFromLiteral(kSpeedTargetValueType.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + const auto kSteadyState = GetWriterSteadyState(); + if (kSteadyState) + { + auto clonedChild = std::dynamic_pointer_cast(kSteadyState)->Clone(); + auto clonedChildISteadyState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSteadyState(std::dynamic_pointer_cast(clonedChildISteadyState)); + } + return clonedObject; + } + + std::string RelativeSpeedToMasterImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeSpeedToMasterImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__STEADY_STATE) + { + return std::dynamic_pointer_cast(GetSteadyState()); + } + throw KeyNotSupportedException(); + } + + std::vector> RelativeSpeedToMasterImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeSpeedToMasterImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RelativeSpeedToMasterImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE) + { + auto speedTargetValueType = GetSpeedTargetValueType(); + return speedTargetValueType.GetLiteral() != "UNKNOWN" ? speedTargetValueType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RelativeSpeedToMasterImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool RelativeSpeedToMasterImpl::IsSetSpeedTargetValueType() const + { + return _isSetSpeedTargetValueType; + } + bool RelativeSpeedToMasterImpl::IsSetValue() const + { + return _isSetValue; + } + void RelativeSpeedToMasterImpl::ResetSteadyState() + { + _isSetSteadyState = false; + _steadyState = {}; + + } + bool RelativeSpeedToMasterImpl::IsSetSteadyState() const + { + return _isSetSteadyState; + } + + IOpenScenarioFlexElement* RelativeTargetLaneImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> RelativeTargetLaneImpl::GetEntityRef() const + { + return _entityRef; + } + int RelativeTargetLaneImpl::GetValue() const + { + return _value; + } + + + void RelativeTargetLaneImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeTargetLaneImpl::SetValue(const int value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr RelativeTargetLaneImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeTargetLaneImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeTargetLane).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeTargetLaneWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeTargetLaneImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeTargetLaneImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeTargetLaneImpl::GetIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + double RelativeTargetLaneImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RelativeTargetLaneImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeTargetLaneImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeTargetLaneImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeTargetLaneImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeTargetLaneImpl::GetModelType() const + { + return "RelativeTargetLane"; + } + + void RelativeTargetLaneImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeTargetLaneImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeTargetLaneImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeTargetLaneImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeTargetLaneImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeTargetLaneImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeTargetLaneImpl::RelativeTargetLaneImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::INT); + } + + void RelativeTargetLaneImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeTargetLaneImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeTargetLaneImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeTargetLaneImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string RelativeTargetLaneImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetLaneImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeTargetLaneImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetLaneImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeTargetLaneImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeTargetLaneImpl::ResolveIntExpression(std::string& attributeKey, int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool RelativeTargetLaneImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool RelativeTargetLaneImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RelativeTargetLaneOffsetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> RelativeTargetLaneOffsetImpl::GetEntityRef() const + { + return _entityRef; + } + double RelativeTargetLaneOffsetImpl::GetValue() const + { + return _value; + } + + + void RelativeTargetLaneOffsetImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeTargetLaneOffsetImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr RelativeTargetLaneOffsetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeTargetLaneOffsetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeTargetLaneOffset).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeTargetLaneOffsetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeTargetLaneOffsetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeTargetLaneOffsetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeTargetLaneOffsetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeTargetLaneOffsetImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeTargetLaneOffsetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeTargetLaneOffsetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeTargetLaneOffsetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeTargetLaneOffsetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeTargetLaneOffsetImpl::GetModelType() const + { + return "RelativeTargetLaneOffset"; + } + + void RelativeTargetLaneOffsetImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeTargetLaneOffsetImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeTargetLaneOffsetImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeTargetLaneOffsetImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeTargetLaneOffsetImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeTargetLaneOffsetImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeTargetLaneOffsetImpl::RelativeTargetLaneOffsetImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void RelativeTargetLaneOffsetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeTargetLaneOffsetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeTargetLaneOffsetImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeTargetLaneOffsetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string RelativeTargetLaneOffsetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetLaneOffsetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeTargetLaneOffsetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetLaneOffsetImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeTargetLaneOffsetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeTargetLaneOffsetImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool RelativeTargetLaneOffsetImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool RelativeTargetLaneOffsetImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RelativeTargetSpeedImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool RelativeTargetSpeedImpl::GetContinuous() const + { + return _continuous; + } + std::shared_ptr> RelativeTargetSpeedImpl::GetEntityRef() const + { + return _entityRef; + } + SpeedTargetValueType RelativeTargetSpeedImpl::GetSpeedTargetValueType() const + { + return _speedTargetValueType; + } + double RelativeTargetSpeedImpl::GetValue() const + { + return _value; + } + + + void RelativeTargetSpeedImpl::SetContinuous(const bool continuous) + { + _continuous = continuous; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + _isSetContinuous = true; + } + + void RelativeTargetSpeedImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeTargetSpeedImpl::SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) + { + _speedTargetValueType = speedTargetValueType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE); + _isSetSpeedTargetValueType = true; + } + + void RelativeTargetSpeedImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr RelativeTargetSpeedImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeTargetSpeedImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeTargetSpeed).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeTargetSpeedWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeTargetSpeedImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeTargetSpeedImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeTargetSpeedImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeTargetSpeedImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeTargetSpeedImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeTargetSpeedImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + return GetContinuous(); + } + throw KeyNotSupportedException(); + + } + + DateTime RelativeTargetSpeedImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeTargetSpeedImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeTargetSpeedImpl::GetModelType() const + { + return "RelativeTargetSpeed"; + } + + void RelativeTargetSpeedImpl::WriteParameterToContinuous(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, parameterName, nullTextMarker /*no textmarker*/); + _continuous = {}; + } + + void RelativeTargetSpeedImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void RelativeTargetSpeedImpl::WriteParameterToSpeedTargetValueType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _speedTargetValueType = {}; + } + + void RelativeTargetSpeedImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string RelativeTargetSpeedImpl::GetParameterFromContinuous() const + { + auto continuous = OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS; + return GetParameterNameFromAttribute(continuous); + } + + std::string RelativeTargetSpeedImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string RelativeTargetSpeedImpl::GetParameterFromSpeedTargetValueType() const + { + auto speedTargetValueType = OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE; + return GetParameterNameFromAttribute(speedTargetValueType); + } + + std::string RelativeTargetSpeedImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool RelativeTargetSpeedImpl::IsContinuousParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeTargetSpeedImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeTargetSpeedImpl::IsSpeedTargetValueTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeTargetSpeedImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RelativeTargetSpeedImpl::RelativeTargetSpeedImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void RelativeTargetSpeedImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE) + { + // Enumeration Type + const auto kResult = SpeedTargetValueType::GetFromLiteral(parameterLiteralValue); + if (kResult != SpeedTargetValueType::UNKNOWN) + { + _speedTargetValueType = kResult; + AddResolvedParameter(attributeKey); + _isSetSpeedTargetValueType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType RelativeTargetSpeedImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeTargetSpeedImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeTargetSpeedImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_continuous = GetContinuous(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Enumeration Type + const auto kSpeedTargetValueType = GetSpeedTargetValueType(); + if ( kSpeedTargetValueType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_speedTargetValueType = SpeedTargetValueType::GetFromLiteral(kSpeedTargetValueType.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string RelativeTargetSpeedImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetSpeedImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RelativeTargetSpeedImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeTargetSpeedImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeTargetSpeedImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE) + { + auto speedTargetValueType = GetSpeedTargetValueType(); + return speedTargetValueType.GetLiteral() != "UNKNOWN" ? speedTargetValueType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RelativeTargetSpeedImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = value; + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + + } + void RelativeTargetSpeedImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool RelativeTargetSpeedImpl::IsSetContinuous() const + { + return _isSetContinuous; + } + bool RelativeTargetSpeedImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool RelativeTargetSpeedImpl::IsSetSpeedTargetValueType() const + { + return _isSetSpeedTargetValueType; + } + bool RelativeTargetSpeedImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* RelativeWorldPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RelativeWorldPositionImpl::GetDx() const + { + return _dx; + } + double RelativeWorldPositionImpl::GetDy() const + { + return _dy; + } + double RelativeWorldPositionImpl::GetDz() const + { + return _dz; + } + std::shared_ptr> RelativeWorldPositionImpl::GetEntityRef() const + { + return _entityRef; + } + std::shared_ptr RelativeWorldPositionImpl::GetOrientation() const + { + return _orientation; + } + + + void RelativeWorldPositionImpl::SetDx(const double dx) + { + _dx = dx; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX); + _isSetDx = true; + } + + void RelativeWorldPositionImpl::SetDy(const double dy) + { + _dy = dy; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY); + _isSetDy = true; + } + + void RelativeWorldPositionImpl::SetDz(const double dz) + { + _dz = dz; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ); + _isSetDz = true; + } + + void RelativeWorldPositionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void RelativeWorldPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr RelativeWorldPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RelativeWorldPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRelativeWorldPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRelativeWorldPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RelativeWorldPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RelativeWorldPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RelativeWorldPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RelativeWorldPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DX) + { + return GetDx(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DY) + { + return GetDy(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + return GetDz(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RelativeWorldPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RelativeWorldPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RelativeWorldPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RelativeWorldPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RelativeWorldPositionImpl::GetModelType() const + { + return "RelativeWorldPosition"; + } + + void RelativeWorldPositionImpl::WriteParameterToDx(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, parameterName, nullTextMarker /*no textmarker*/); + _dx = {}; + } + + void RelativeWorldPositionImpl::WriteParameterToDy(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, parameterName, nullTextMarker /*no textmarker*/); + _dy = {}; + } + + void RelativeWorldPositionImpl::WriteParameterToDz(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, parameterName, nullTextMarker /*no textmarker*/); + _dz = {}; + } + + void RelativeWorldPositionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + std::string RelativeWorldPositionImpl::GetParameterFromDx() const + { + auto dx = OSC_CONSTANTS::ATTRIBUTE__DX; + return GetParameterNameFromAttribute(dx); + } + + std::string RelativeWorldPositionImpl::GetParameterFromDy() const + { + auto dy = OSC_CONSTANTS::ATTRIBUTE__DY; + return GetParameterNameFromAttribute(dy); + } + + std::string RelativeWorldPositionImpl::GetParameterFromDz() const + { + auto dz = OSC_CONSTANTS::ATTRIBUTE__DZ; + return GetParameterNameFromAttribute(dz); + } + + std::string RelativeWorldPositionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + bool RelativeWorldPositionImpl::IsDxParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DX); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeWorldPositionImpl::IsDyParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DY); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeWorldPositionImpl::IsDzParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DZ); + if (kIt != keys.end()) + return true; + return false; + } + + bool RelativeWorldPositionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RelativeWorldPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + RelativeWorldPositionImpl::RelativeWorldPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DX, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DZ, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + } + + void RelativeWorldPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DY) + { + // Simple type + _dy = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDy = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + } + + SimpleType RelativeWorldPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RelativeWorldPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RelativeWorldPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dx = GetDx(); + // Simple type + clonedObject->_dy = GetDy(); + // Simple type + clonedObject->_dz = GetDz(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // clone indicators + clonedObject->_isSetDz = _isSetDz; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string RelativeWorldPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeWorldPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> RelativeWorldPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RelativeWorldPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string RelativeWorldPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RelativeWorldPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = value; + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DY) + { + // Simple type + _dy = value; + AddResolvedParameter(attributeKey); + _isSetDy = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = value; + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + + } + + + bool RelativeWorldPositionImpl::IsSetDx() const + { + return _isSetDx; + } + bool RelativeWorldPositionImpl::IsSetDy() const + { + return _isSetDy; + } + void RelativeWorldPositionImpl::ResetDz() + { + _isSetDz = false; + _dz = {0}; + + } + bool RelativeWorldPositionImpl::IsSetDz() const + { + return _isSetDz; + } + bool RelativeWorldPositionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + void RelativeWorldPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RelativeWorldPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* RoadConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RoadConditionImpl::GetFrictionScaleFactor() const + { + return _frictionScaleFactor; + } + Wetness RoadConditionImpl::GetWetness() const + { + return _wetness; + } + std::shared_ptr RoadConditionImpl::GetProperties() const + { + return _properties; + } + + + void RoadConditionImpl::SetFrictionScaleFactor(const double frictionScaleFactor) + { + _frictionScaleFactor = frictionScaleFactor; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR); + _isSetFrictionScaleFactor = true; + } + + void RoadConditionImpl::SetWetness(const Wetness wetness) + { + _wetness = wetness; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WETNESS); + _isSetWetness = true; + } + + void RoadConditionImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr RoadConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoadConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoadCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoadConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoadConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoadConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoadConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoadConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR) + { + return GetFrictionScaleFactor(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RoadConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoadConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoadConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoadConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoadConditionImpl::GetModelType() const + { + return "RoadCondition"; + } + + void RoadConditionImpl::WriteParameterToFrictionScaleFactor(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, parameterName, nullTextMarker /*no textmarker*/); + _frictionScaleFactor = {}; + } + + void RoadConditionImpl::WriteParameterToWetness(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WETNESS, parameterName, nullTextMarker /*no textmarker*/); + _wetness = {}; + } + + std::string RoadConditionImpl::GetParameterFromFrictionScaleFactor() const + { + auto frictionScaleFactor = OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR; + return GetParameterNameFromAttribute(frictionScaleFactor); + } + + std::string RoadConditionImpl::GetParameterFromWetness() const + { + auto wetness = OSC_CONSTANTS::ATTRIBUTE__WETNESS; + return GetParameterNameFromAttribute(wetness); + } + + bool RoadConditionImpl::IsFrictionScaleFactorParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR); + if (kIt != keys.end()) + return true; + return false; + } + + bool RoadConditionImpl::IsWetnessParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WETNESS); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RoadConditionImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + RoadConditionImpl::RoadConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WETNESS, SimpleType::ENUM_TYPE); + } + + void RoadConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR) + { + // Simple type + _frictionScaleFactor = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFrictionScaleFactor = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WETNESS) + { + // Enumeration Type + const auto kResult = Wetness::GetFromLiteral(parameterLiteralValue); + if (kResult != Wetness::UNKNOWN) + { + _wetness = kResult; + AddResolvedParameter(attributeKey); + _isSetWetness = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType RoadConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoadConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoadConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_frictionScaleFactor = GetFrictionScaleFactor(); + // Enumeration Type + const auto kWetness = GetWetness(); + if ( kWetness.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_wetness = Wetness::GetFromLiteral(kWetness.GetLiteral()); + } + // clone indicators + clonedObject->_isSetWetness = _isSetWetness; + // clone children + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string RoadConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> RoadConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoadConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WETNESS) + { + auto wetness = GetWetness(); + return wetness.GetLiteral() != "UNKNOWN" ? wetness.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void RoadConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR) + { + // Simple type + _frictionScaleFactor = value; + AddResolvedParameter(attributeKey); + _isSetFrictionScaleFactor = true; + } + + } + + + bool RoadConditionImpl::IsSetFrictionScaleFactor() const + { + return _isSetFrictionScaleFactor; + } + void RoadConditionImpl::ResetWetness() + { + _isSetWetness = false; + _wetness = {}; + + } + bool RoadConditionImpl::IsSetWetness() const + { + return _isSetWetness; + } + void RoadConditionImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool RoadConditionImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* RoadCursorImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string RoadCursorImpl::GetRoadId() const + { + return _roadId; + } + double RoadCursorImpl::GetS() const + { + return _s; + } + std::vector> RoadCursorImpl::GetLane() const + { + std::vector> temp; + for(auto&& elm: _lane) + temp.push_back(elm); + return temp; + } + std::vector> RoadCursorImpl::GetWriterLane() const + { + return _lane; + } + + int RoadCursorImpl::GetLaneSize() const + { + return static_cast(_lane.size()); + } + + std::shared_ptr RoadCursorImpl::GetLaneAtIndex(unsigned int index) const + { + if (index >= 0 && _lane.size() > index) + { + return _lane[index]; + } + return nullptr; + } + + + void RoadCursorImpl::SetRoadId(const std::string roadId) + { + _roadId = roadId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + _isSetRoadId = true; + } + + void RoadCursorImpl::SetS(const double s) + { + _s = s; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S); + _isSetS = true; + } + + void RoadCursorImpl::SetLane(std::vector>& lane) + { + _lane = lane; + _isSetLane = true; + } + + std::shared_ptr RoadCursorImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoadCursorImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoadCursor).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoadCursorWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoadCursorImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoadCursorImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoadCursorImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoadCursorImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__S) + { + return GetS(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RoadCursorImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoadCursorImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoadCursorImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoadCursorImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoadCursorImpl::GetModelType() const + { + return "RoadCursor"; + } + + void RoadCursorImpl::WriteParameterToRoadId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, parameterName, nullTextMarker /*no textmarker*/); + _roadId = {}; + } + + void RoadCursorImpl::WriteParameterToS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, parameterName, nullTextMarker /*no textmarker*/); + _s = {}; + } + + std::string RoadCursorImpl::GetParameterFromRoadId() const + { + auto roadId = OSC_CONSTANTS::ATTRIBUTE__ROAD_ID; + return GetParameterNameFromAttribute(roadId); + } + + std::string RoadCursorImpl::GetParameterFromS() const + { + auto s = OSC_CONSTANTS::ATTRIBUTE__S; + return GetParameterNameFromAttribute(s); + } + + bool RoadCursorImpl::IsRoadIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + if (kIt != keys.end()) + return true; + return false; + } + + bool RoadCursorImpl::IsSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__S); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RoadCursorImpl::RoadCursorImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__S, SimpleType::DOUBLE); + } + + void RoadCursorImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetS = true; + } + } + + SimpleType RoadCursorImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoadCursorImpl::GetChildren() const + { + std::vector> result; + + auto lane = GetWriterLane(); + if (!lane.empty()) + { + for(auto&& item : lane) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoadCursorImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_roadId = GetRoadId(); + // Simple type + clonedObject->_s = GetS(); + // clone indicators + clonedObject->_isSetS = _isSetS; + // clone children + const auto kLane = GetWriterLane(); + if (!kLane.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kLane) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetLane(clonedList); + } + return clonedObject; + } + + std::string RoadCursorImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + return GetRoadId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadCursorImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RoadCursorImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LANE) + { + std::vector> vect; + for (auto&& elem : GetLane()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadCursorImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoadCursorImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RoadCursorImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = value; + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + + } + void RoadCursorImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = value; + AddResolvedParameter(attributeKey); + _isSetS = true; + } + + } + + + bool RoadCursorImpl::IsSetRoadId() const + { + return _isSetRoadId; + } + void RoadCursorImpl::ResetS() + { + _isSetS = false; + _s = {}; + + } + bool RoadCursorImpl::IsSetS() const + { + return _isSetS; + } + void RoadCursorImpl::ResetLane() + { + _isSetLane = false; + _lane = {}; + + } + bool RoadCursorImpl::IsSetLane() const + { + return _isSetLane; + } + + IOpenScenarioFlexElement* RoadNetworkImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr RoadNetworkImpl::GetLogicFile() const + { + return _logicFile; + } + std::shared_ptr RoadNetworkImpl::GetSceneGraphFile() const + { + return _sceneGraphFile; + } + std::vector> RoadNetworkImpl::GetTrafficSignals() const + { + std::vector> temp; + for(auto&& elm: _trafficSignals) + temp.push_back(elm); + return temp; + } + std::vector> RoadNetworkImpl::GetWriterTrafficSignals() const + { + return _trafficSignals; + } + + int RoadNetworkImpl::GetTrafficSignalsSize() const + { + return static_cast(_trafficSignals.size()); + } + + std::shared_ptr RoadNetworkImpl::GetTrafficSignalsAtIndex(unsigned int index) const + { + if (index >= 0 && _trafficSignals.size() > index) + { + return _trafficSignals[index]; + } + return nullptr; + } + std::shared_ptr RoadNetworkImpl::GetUsedArea() const + { + return _usedArea; + } + + + void RoadNetworkImpl::SetLogicFile(std::shared_ptr logicFile) + { + _logicFile = logicFile; + _isSetLogicFile = true; + } + + void RoadNetworkImpl::SetSceneGraphFile(std::shared_ptr sceneGraphFile) + { + _sceneGraphFile = sceneGraphFile; + _isSetSceneGraphFile = true; + } + + void RoadNetworkImpl::SetTrafficSignals(std::vector>& trafficSignals) + { + _trafficSignals = trafficSignals; + _isSetTrafficSignals = true; + } + + void RoadNetworkImpl::SetUsedArea(std::shared_ptr usedArea) + { + _usedArea = usedArea; + _isSetUsedArea = true; + } + + std::shared_ptr RoadNetworkImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoadNetworkImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoadNetwork).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoadNetworkWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoadNetworkImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoadNetworkImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoadNetworkImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoadNetworkImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RoadNetworkImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoadNetworkImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoadNetworkImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoadNetworkImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoadNetworkImpl::GetModelType() const + { + return "RoadNetwork"; + } + + // children + std::shared_ptr RoadNetworkImpl::GetWriterLogicFile() const + { + return std::dynamic_pointer_cast(_logicFile); + } + std::shared_ptr RoadNetworkImpl::GetWriterSceneGraphFile() const + { + return std::dynamic_pointer_cast(_sceneGraphFile); + } + std::shared_ptr RoadNetworkImpl::GetWriterUsedArea() const + { + return std::dynamic_pointer_cast(_usedArea); + } + + RoadNetworkImpl::RoadNetworkImpl() + { + /** + * Filling the property to type map + */ + } + + void RoadNetworkImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RoadNetworkImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoadNetworkImpl::GetChildren() const + { + std::vector> result; + + const auto kLogicFile = GetWriterLogicFile(); + if (kLogicFile) + { + result.push_back(std::dynamic_pointer_cast(kLogicFile)); + } + const auto kSceneGraphFile = GetWriterSceneGraphFile(); + if (kSceneGraphFile) + { + result.push_back(std::dynamic_pointer_cast(kSceneGraphFile)); + } + auto trafficSignals = GetWriterTrafficSignals(); + if (!trafficSignals.empty()) + { + for(auto&& item : trafficSignals) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kUsedArea = GetWriterUsedArea(); + if (kUsedArea) + { + result.push_back(std::dynamic_pointer_cast(kUsedArea)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoadNetworkImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kLogicFile = GetWriterLogicFile(); + if (kLogicFile) + { + auto clonedChild = std::dynamic_pointer_cast(kLogicFile)->Clone(); + auto clonedChildIFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLogicFile(std::dynamic_pointer_cast(clonedChildIFile)); + } + const auto kSceneGraphFile = GetWriterSceneGraphFile(); + if (kSceneGraphFile) + { + auto clonedChild = std::dynamic_pointer_cast(kSceneGraphFile)->Clone(); + auto clonedChildIFile = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSceneGraphFile(std::dynamic_pointer_cast(clonedChildIFile)); + } + const auto kTrafficSignals = GetWriterTrafficSignals(); + if (!kTrafficSignals.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kTrafficSignals) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetTrafficSignals(clonedList); + } + const auto kUsedArea = GetWriterUsedArea(); + if (kUsedArea) + { + auto clonedChild = std::dynamic_pointer_cast(kUsedArea)->Clone(); + auto clonedChildIUsedArea = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUsedArea(std::dynamic_pointer_cast(clonedChildIUsedArea)); + } + return clonedObject; + } + + std::string RoadNetworkImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadNetworkImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__LOGIC_FILE) + { + return std::dynamic_pointer_cast(GetLogicFile()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SCENE_GRAPH_FILE) + { + return std::dynamic_pointer_cast(GetSceneGraphFile()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USED_AREA) + { + return std::dynamic_pointer_cast(GetUsedArea()); + } + throw KeyNotSupportedException(); + } + + std::vector> RoadNetworkImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER) + { + std::vector> vect; + for (auto&& elem : GetTrafficSignals()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadNetworkImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoadNetworkImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void RoadNetworkImpl::ResetLogicFile() + { + _isSetLogicFile = false; + _logicFile = {}; + + } + bool RoadNetworkImpl::IsSetLogicFile() const + { + return _isSetLogicFile; + } + void RoadNetworkImpl::ResetSceneGraphFile() + { + _isSetSceneGraphFile = false; + _sceneGraphFile = {}; + + } + bool RoadNetworkImpl::IsSetSceneGraphFile() const + { + return _isSetSceneGraphFile; + } + void RoadNetworkImpl::ResetTrafficSignals() + { + _isSetTrafficSignals = false; + _trafficSignals = {}; + + } + bool RoadNetworkImpl::IsSetTrafficSignals() const + { + return _isSetTrafficSignals; + } + void RoadNetworkImpl::ResetUsedArea() + { + _isSetUsedArea = false; + _usedArea = {}; + + } + bool RoadNetworkImpl::IsSetUsedArea() const + { + return _isSetUsedArea; + } + + IOpenScenarioFlexElement* RoadPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string RoadPositionImpl::GetRoadId() const + { + return _roadId; + } + double RoadPositionImpl::GetS() const + { + return _s; + } + double RoadPositionImpl::GetT() const + { + return _t; + } + std::shared_ptr RoadPositionImpl::GetOrientation() const + { + return _orientation; + } + + + void RoadPositionImpl::SetRoadId(const std::string roadId) + { + _roadId = roadId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + _isSetRoadId = true; + } + + void RoadPositionImpl::SetS(const double s) + { + _s = s; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S); + _isSetS = true; + } + + void RoadPositionImpl::SetT(const double t) + { + _t = t; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T); + _isSetT = true; + } + + void RoadPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + std::shared_ptr RoadPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoadPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoadPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoadPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoadPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoadPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoadPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoadPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__S) + { + return GetS(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__T) + { + return GetT(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RoadPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoadPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoadPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoadPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoadPositionImpl::GetModelType() const + { + return "RoadPosition"; + } + + void RoadPositionImpl::WriteParameterToRoadId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, parameterName, nullTextMarker /*no textmarker*/); + _roadId = {}; + } + + void RoadPositionImpl::WriteParameterToS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, parameterName, nullTextMarker /*no textmarker*/); + _s = {}; + } + + void RoadPositionImpl::WriteParameterToT(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, parameterName, nullTextMarker /*no textmarker*/); + _t = {}; + } + + std::string RoadPositionImpl::GetParameterFromRoadId() const + { + auto roadId = OSC_CONSTANTS::ATTRIBUTE__ROAD_ID; + return GetParameterNameFromAttribute(roadId); + } + + std::string RoadPositionImpl::GetParameterFromS() const + { + auto s = OSC_CONSTANTS::ATTRIBUTE__S; + return GetParameterNameFromAttribute(s); + } + + std::string RoadPositionImpl::GetParameterFromT() const + { + auto t = OSC_CONSTANTS::ATTRIBUTE__T; + return GetParameterNameFromAttribute(t); + } + + bool RoadPositionImpl::IsRoadIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROAD_ID); + if (kIt != keys.end()) + return true; + return false; + } + + bool RoadPositionImpl::IsSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__S); + if (kIt != keys.end()) + return true; + return false; + } + + bool RoadPositionImpl::IsTParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__T); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr RoadPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + + RoadPositionImpl::RoadPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__S, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__T, SimpleType::DOUBLE); + } + + void RoadPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetT = true; + } + } + + SimpleType RoadPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoadPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoadPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_roadId = GetRoadId(); + // Simple type + clonedObject->_s = GetS(); + // Simple type + clonedObject->_t = GetT(); + // clone indicators + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + return clonedObject; + } + + std::string RoadPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + return GetRoadId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + throw KeyNotSupportedException(); + } + + std::vector> RoadPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoadPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RoadPositionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROAD_ID) + { + // Simple type + _roadId = value; + AddResolvedParameter(attributeKey); + _isSetRoadId = true; + } + + } + void RoadPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = value; + AddResolvedParameter(attributeKey); + _isSetS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = value; + AddResolvedParameter(attributeKey); + _isSetT = true; + } + + } + + + bool RoadPositionImpl::IsSetRoadId() const + { + return _isSetRoadId; + } + bool RoadPositionImpl::IsSetS() const + { + return _isSetS; + } + bool RoadPositionImpl::IsSetT() const + { + return _isSetT; + } + void RoadPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RoadPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + + IOpenScenarioFlexElement* RoadRangeImpl::GetOpenScenarioFlexElement() + { + return this; + } + double RoadRangeImpl::GetLength() const + { + return _length; + } + std::vector> RoadRangeImpl::GetRoadCursor() const + { + std::vector> temp; + for(auto&& elm: _roadCursor) + temp.push_back(elm); + return temp; + } + std::vector> RoadRangeImpl::GetWriterRoadCursor() const + { + return _roadCursor; + } + + int RoadRangeImpl::GetRoadCursorSize() const + { + return static_cast(_roadCursor.size()); + } + + std::shared_ptr RoadRangeImpl::GetRoadCursorAtIndex(unsigned int index) const + { + if (index >= 0 && _roadCursor.size() > index) + { + return _roadCursor[index]; + } + return nullptr; + } + + + void RoadRangeImpl::SetLength(const double length) + { + _length = length; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH); + _isSetLength = true; + } + + void RoadRangeImpl::SetRoadCursor(std::vector>& roadCursor) + { + _roadCursor = roadCursor; + _isSetRoadCursor = true; + } + + std::shared_ptr RoadRangeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoadRangeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoadRange).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoadRangeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoadRangeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoadRangeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoadRangeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoadRangeImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + return GetLength(); + } + throw KeyNotSupportedException(); + + } + + uint16_t RoadRangeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoadRangeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoadRangeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoadRangeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoadRangeImpl::GetModelType() const + { + return "RoadRange"; + } + + void RoadRangeImpl::WriteParameterToLength(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, parameterName, nullTextMarker /*no textmarker*/); + _length = {}; + } + + std::string RoadRangeImpl::GetParameterFromLength() const + { + auto length = OSC_CONSTANTS::ATTRIBUTE__LENGTH; + return GetParameterNameFromAttribute(length); + } + + bool RoadRangeImpl::IsLengthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__LENGTH); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RoadRangeImpl::RoadRangeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__LENGTH, SimpleType::DOUBLE); + } + + void RoadRangeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + } + + SimpleType RoadRangeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoadRangeImpl::GetChildren() const + { + std::vector> result; + + auto roadCursor = GetWriterRoadCursor(); + if (!roadCursor.empty()) + { + for(auto&& item : roadCursor) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoadRangeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_length = GetLength(); + // clone indicators + clonedObject->_isSetLength = _isSetLength; + // clone children + const auto kRoadCursor = GetWriterRoadCursor(); + if (!kRoadCursor.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kRoadCursor) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetRoadCursor(clonedList); + } + return clonedObject; + } + + std::string RoadRangeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadRangeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RoadRangeImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROAD_CURSOR) + { + std::vector> vect; + for (auto&& elem : GetRoadCursor()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RoadRangeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoadRangeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RoadRangeImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__LENGTH) + { + // Simple type + _length = value; + AddResolvedParameter(attributeKey); + _isSetLength = true; + } + + } + + + void RoadRangeImpl::ResetLength() + { + _isSetLength = false; + _length = {}; + + } + bool RoadRangeImpl::IsSetLength() const + { + return _isSetLength; + } + bool RoadRangeImpl::IsSetRoadCursor() const + { + return _isSetRoadCursor; + } + + IOpenScenarioFlexElement* RouteImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool RouteImpl::GetClosed() const + { + return _closed; + } + std::string RouteImpl::GetName() const + { + return _name; + } + std::vector> RouteImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> RouteImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int RouteImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr RouteImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::vector> RouteImpl::GetWaypoints() const + { + std::vector> temp; + for(auto&& elm: _waypoints) + temp.push_back(elm); + return temp; + } + std::vector> RouteImpl::GetWriterWaypoints() const + { + return _waypoints; + } + + int RouteImpl::GetWaypointsSize() const + { + return static_cast(_waypoints.size()); + } + + std::shared_ptr RouteImpl::GetWaypointsAtIndex(unsigned int index) const + { + if (index >= 0 && _waypoints.size() > index) + { + return _waypoints[index]; + } + return nullptr; + } + + + void RouteImpl::SetClosed(const bool closed) + { + _closed = closed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED); + _isSetClosed = true; + } + + void RouteImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void RouteImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void RouteImpl::SetWaypoints(std::vector>& waypoints) + { + _waypoints = waypoints; + _isSetWaypoints = true; + } + + std::shared_ptr RouteImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RouteImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoute).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRouteWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RouteImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RouteImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RouteImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RouteImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RouteImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RouteImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + return GetClosed(); + } + throw KeyNotSupportedException(); + + } + + DateTime RouteImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RouteImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RouteImpl::GetModelType() const + { + return "Route"; + } + + void RouteImpl::WriteParameterToClosed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED, parameterName, nullTextMarker /*no textmarker*/); + _closed = {}; + } + + void RouteImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string RouteImpl::GetParameterFromClosed() const + { + auto closed = OSC_CONSTANTS::ATTRIBUTE__CLOSED; + return GetParameterNameFromAttribute(closed); + } + + std::string RouteImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool RouteImpl::IsClosedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CLOSED); + if (kIt != keys.end()) + return true; + return false; + } + + bool RouteImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + RouteImpl::RouteImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CLOSED, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void RouteImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + // Simple type + _closed = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetClosed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType RouteImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool RouteImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> RouteImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RouteImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto waypoints = GetWriterWaypoints(); + if (!waypoints.empty()) + { + for(auto&& item : waypoints) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RouteImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_closed = GetClosed(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kWaypoints = GetWriterWaypoints(); + if (!kWaypoints.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kWaypoints) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetWaypoints(clonedList); + } + return clonedObject; + } + + std::string RouteImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> RouteImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__WAYPOINT) + { + std::vector> vect; + for (auto&& elem : GetWaypoints()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RouteImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void RouteImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + // Simple type + _closed = value; + AddResolvedParameter(attributeKey); + _isSetClosed = true; + } + + } + void RouteImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool RouteImpl::IsSetClosed() const + { + return _isSetClosed; + } + bool RouteImpl::IsSetName() const + { + return _isSetName; + } + void RouteImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool RouteImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool RouteImpl::IsSetWaypoints() const + { + return _isSetWaypoints; + } + + IOpenScenarioFlexElement* RouteCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr RouteCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void RouteCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr RouteCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RouteCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRouteCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRouteCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RouteCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RouteCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RouteCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RouteCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RouteCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RouteCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RouteCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RouteCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RouteCatalogLocationImpl::GetModelType() const + { + return "RouteCatalogLocation"; + } + + // children + std::shared_ptr RouteCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + RouteCatalogLocationImpl::RouteCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void RouteCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RouteCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RouteCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RouteCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string RouteCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> RouteCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RouteCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool RouteCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* RoutePositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr RoutePositionImpl::GetRouteRef() const + { + return _routeRef; + } + std::shared_ptr RoutePositionImpl::GetOrientation() const + { + return _orientation; + } + std::shared_ptr RoutePositionImpl::GetInRoutePosition() const + { + return _inRoutePosition; + } + + + void RoutePositionImpl::SetRouteRef(std::shared_ptr routeRef) + { + _routeRef = routeRef; + _isSetRouteRef = true; + } + + void RoutePositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + void RoutePositionImpl::SetInRoutePosition(std::shared_ptr inRoutePosition) + { + _inRoutePosition = inRoutePosition; + _isSetInRoutePosition = true; + } + + std::shared_ptr RoutePositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoutePositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoutePosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoutePositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoutePositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoutePositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoutePositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoutePositionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RoutePositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoutePositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoutePositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoutePositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoutePositionImpl::GetModelType() const + { + return "RoutePosition"; + } + + // children + std::shared_ptr RoutePositionImpl::GetWriterRouteRef() const + { + return std::dynamic_pointer_cast(_routeRef); + } + std::shared_ptr RoutePositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + std::shared_ptr RoutePositionImpl::GetWriterInRoutePosition() const + { + return std::dynamic_pointer_cast(_inRoutePosition); + } + + RoutePositionImpl::RoutePositionImpl() + { + /** + * Filling the property to type map + */ + } + + void RoutePositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RoutePositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoutePositionImpl::GetChildren() const + { + std::vector> result; + + const auto kRouteRef = GetWriterRouteRef(); + if (kRouteRef) + { + result.push_back(std::dynamic_pointer_cast(kRouteRef)); + } + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + const auto kInRoutePosition = GetWriterInRoutePosition(); + if (kInRoutePosition) + { + result.push_back(std::dynamic_pointer_cast(kInRoutePosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoutePositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRouteRef = GetWriterRouteRef(); + if (kRouteRef) + { + auto clonedChild = std::dynamic_pointer_cast(kRouteRef)->Clone(); + auto clonedChildIRouteRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRouteRef(std::dynamic_pointer_cast(clonedChildIRouteRef)); + } + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + const auto kInRoutePosition = GetWriterInRoutePosition(); + if (kInRoutePosition) + { + auto clonedChild = std::dynamic_pointer_cast(kInRoutePosition)->Clone(); + auto clonedChildIInRoutePosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetInRoutePosition(std::dynamic_pointer_cast(clonedChildIInRoutePosition)); + } + return clonedObject; + } + + std::string RoutePositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RoutePositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTE_REF) + { + return std::dynamic_pointer_cast(GetRouteRef()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + + if (key == OSC_CONSTANTS::ELEMENT__IN_ROUTE_POSITION) + { + return std::dynamic_pointer_cast(GetInRoutePosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> RoutePositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RoutePositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoutePositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool RoutePositionImpl::IsSetRouteRef() const + { + return _isSetRouteRef; + } + void RoutePositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool RoutePositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + bool RoutePositionImpl::IsSetInRoutePosition() const + { + return _isSetInRoutePosition; + } + + IOpenScenarioFlexElement* RouteRefImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr RouteRefImpl::GetRoute() const + { + return _route; + } + std::shared_ptr RouteRefImpl::GetCatalogReference() const + { + return _catalogReference; + } + + + void RouteRefImpl::SetRoute(std::shared_ptr route) + { + _route = route; + _catalogReference = {}; + _isSetRoute = true; + } + + void RouteRefImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _route = {}; + _isSetCatalogReference = true; + } + + std::shared_ptr RouteRefImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RouteRefImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRouteRef).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRouteRefWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RouteRefImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RouteRefImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RouteRefImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RouteRefImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RouteRefImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RouteRefImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RouteRefImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RouteRefImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RouteRefImpl::GetModelType() const + { + return "RouteRef"; + } + + // children + std::shared_ptr RouteRefImpl::GetWriterRoute() const + { + return std::dynamic_pointer_cast(_route); + } + std::shared_ptr RouteRefImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + + RouteRefImpl::RouteRefImpl() + { + /** + * Filling the property to type map + */ + } + + void RouteRefImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RouteRefImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RouteRefImpl::GetChildren() const + { + std::vector> result; + + const auto kRoute = GetWriterRoute(); + if (kRoute) + { + result.push_back(std::dynamic_pointer_cast(kRoute)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RouteRefImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRoute = GetWriterRoute(); + if (kRoute) + { + auto clonedChild = std::dynamic_pointer_cast(kRoute)->Clone(); + auto clonedChildIRoute = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoute(std::dynamic_pointer_cast(clonedChildIRoute)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + return clonedObject; + } + + std::string RouteRefImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteRefImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROUTE) + { + return std::dynamic_pointer_cast(GetRoute()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> RouteRefImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RouteRefImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RouteRefImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool RouteRefImpl::IsSetRoute() const + { + return _isSetRoute; + } + bool RouteRefImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + + IOpenScenarioFlexElement* RoutingActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr RoutingActionImpl::GetAssignRouteAction() const + { + return _assignRouteAction; + } + std::shared_ptr RoutingActionImpl::GetFollowTrajectoryAction() const + { + return _followTrajectoryAction; + } + std::shared_ptr RoutingActionImpl::GetAcquirePositionAction() const + { + return _acquirePositionAction; + } + std::shared_ptr RoutingActionImpl::GetRandomRouteAction() const + { + return _randomRouteAction; + } + + + void RoutingActionImpl::SetAssignRouteAction(std::shared_ptr assignRouteAction) + { + _assignRouteAction = assignRouteAction; + _followTrajectoryAction = {}; + _acquirePositionAction = {}; + _randomRouteAction = {}; + _isSetAssignRouteAction = true; + } + + void RoutingActionImpl::SetFollowTrajectoryAction(std::shared_ptr followTrajectoryAction) + { + _followTrajectoryAction = followTrajectoryAction; + _assignRouteAction = {}; + _acquirePositionAction = {}; + _randomRouteAction = {}; + _isSetFollowTrajectoryAction = true; + } + + void RoutingActionImpl::SetAcquirePositionAction(std::shared_ptr acquirePositionAction) + { + _acquirePositionAction = acquirePositionAction; + _assignRouteAction = {}; + _followTrajectoryAction = {}; + _randomRouteAction = {}; + _isSetAcquirePositionAction = true; + } + + void RoutingActionImpl::SetRandomRouteAction(std::shared_ptr randomRouteAction) + { + _randomRouteAction = randomRouteAction; + _assignRouteAction = {}; + _followTrajectoryAction = {}; + _acquirePositionAction = {}; + _isSetRandomRouteAction = true; + } + + std::shared_ptr RoutingActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(RoutingActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IRoutingAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IRoutingActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr RoutingActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t RoutingActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int RoutingActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double RoutingActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t RoutingActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool RoutingActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime RoutingActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr RoutingActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string RoutingActionImpl::GetModelType() const + { + return "RoutingAction"; + } + + // children + std::shared_ptr RoutingActionImpl::GetWriterAssignRouteAction() const + { + return std::dynamic_pointer_cast(_assignRouteAction); + } + std::shared_ptr RoutingActionImpl::GetWriterFollowTrajectoryAction() const + { + return std::dynamic_pointer_cast(_followTrajectoryAction); + } + std::shared_ptr RoutingActionImpl::GetWriterAcquirePositionAction() const + { + return std::dynamic_pointer_cast(_acquirePositionAction); + } + std::shared_ptr RoutingActionImpl::GetWriterRandomRouteAction() const + { + return std::dynamic_pointer_cast(_randomRouteAction); + } + + RoutingActionImpl::RoutingActionImpl() + { + /** + * Filling the property to type map + */ + } + + void RoutingActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType RoutingActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> RoutingActionImpl::GetChildren() const + { + std::vector> result; + + const auto kAssignRouteAction = GetWriterAssignRouteAction(); + if (kAssignRouteAction) + { + result.push_back(std::dynamic_pointer_cast(kAssignRouteAction)); + } + const auto kFollowTrajectoryAction = GetWriterFollowTrajectoryAction(); + if (kFollowTrajectoryAction) + { + result.push_back(std::dynamic_pointer_cast(kFollowTrajectoryAction)); + } + const auto kAcquirePositionAction = GetWriterAcquirePositionAction(); + if (kAcquirePositionAction) + { + result.push_back(std::dynamic_pointer_cast(kAcquirePositionAction)); + } + const auto kRandomRouteAction = GetWriterRandomRouteAction(); + if (kRandomRouteAction) + { + result.push_back(std::dynamic_pointer_cast(kRandomRouteAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr RoutingActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kAssignRouteAction = GetWriterAssignRouteAction(); + if (kAssignRouteAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAssignRouteAction)->Clone(); + auto clonedChildIAssignRouteAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAssignRouteAction(std::dynamic_pointer_cast(clonedChildIAssignRouteAction)); + } + const auto kFollowTrajectoryAction = GetWriterFollowTrajectoryAction(); + if (kFollowTrajectoryAction) + { + auto clonedChild = std::dynamic_pointer_cast(kFollowTrajectoryAction)->Clone(); + auto clonedChildIFollowTrajectoryAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFollowTrajectoryAction(std::dynamic_pointer_cast(clonedChildIFollowTrajectoryAction)); + } + const auto kAcquirePositionAction = GetWriterAcquirePositionAction(); + if (kAcquirePositionAction) + { + auto clonedChild = std::dynamic_pointer_cast(kAcquirePositionAction)->Clone(); + auto clonedChildIAcquirePositionAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAcquirePositionAction(std::dynamic_pointer_cast(clonedChildIAcquirePositionAction)); + } + const auto kRandomRouteAction = GetWriterRandomRouteAction(); + if (kRandomRouteAction) + { + auto clonedChild = std::dynamic_pointer_cast(kRandomRouteAction)->Clone(); + auto clonedChildIRandomRouteAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRandomRouteAction(std::dynamic_pointer_cast(clonedChildIRandomRouteAction)); + } + return clonedObject; + } + + std::string RoutingActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr RoutingActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION) + { + return std::dynamic_pointer_cast(GetAssignRouteAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION) + { + return std::dynamic_pointer_cast(GetFollowTrajectoryAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION) + { + return std::dynamic_pointer_cast(GetAcquirePositionAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION) + { + return std::dynamic_pointer_cast(GetRandomRouteAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> RoutingActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr RoutingActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string RoutingActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool RoutingActionImpl::IsSetAssignRouteAction() const + { + return _isSetAssignRouteAction; + } + bool RoutingActionImpl::IsSetFollowTrajectoryAction() const + { + return _isSetFollowTrajectoryAction; + } + bool RoutingActionImpl::IsSetAcquirePositionAction() const + { + return _isSetAcquirePositionAction; + } + bool RoutingActionImpl::IsSetRandomRouteAction() const + { + return _isSetRandomRouteAction; + } + + IOpenScenarioFlexElement* ScenarioDefinitionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ScenarioDefinitionImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> ScenarioDefinitionImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int ScenarioDefinitionImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr ScenarioDefinitionImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::vector> ScenarioDefinitionImpl::GetVariableDeclarations() const + { + std::vector> temp; + for(auto&& elm: _variableDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> ScenarioDefinitionImpl::GetWriterVariableDeclarations() const + { + return _variableDeclarations; + } + + int ScenarioDefinitionImpl::GetVariableDeclarationsSize() const + { + return static_cast(_variableDeclarations.size()); + } + + std::shared_ptr ScenarioDefinitionImpl::GetVariableDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _variableDeclarations.size() > index) + { + return _variableDeclarations[index]; + } + return nullptr; + } + std::vector> ScenarioDefinitionImpl::GetMonitorDeclarations() const + { + std::vector> temp; + for(auto&& elm: _monitorDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> ScenarioDefinitionImpl::GetWriterMonitorDeclarations() const + { + return _monitorDeclarations; + } + + int ScenarioDefinitionImpl::GetMonitorDeclarationsSize() const + { + return static_cast(_monitorDeclarations.size()); + } + + std::shared_ptr ScenarioDefinitionImpl::GetMonitorDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _monitorDeclarations.size() > index) + { + return _monitorDeclarations[index]; + } + return nullptr; + } + std::shared_ptr ScenarioDefinitionImpl::GetCatalogLocations() const + { + return _catalogLocations; + } + std::shared_ptr ScenarioDefinitionImpl::GetRoadNetwork() const + { + return _roadNetwork; + } + std::shared_ptr ScenarioDefinitionImpl::GetEntities() const + { + return _entities; + } + std::shared_ptr ScenarioDefinitionImpl::GetStoryboard() const + { + return _storyboard; + } + + + void ScenarioDefinitionImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void ScenarioDefinitionImpl::SetVariableDeclarations(std::vector>& variableDeclarations) + { + _variableDeclarations = variableDeclarations; + _isSetVariableDeclarations = true; + } + + void ScenarioDefinitionImpl::SetMonitorDeclarations(std::vector>& monitorDeclarations) + { + _monitorDeclarations = monitorDeclarations; + _isSetMonitorDeclarations = true; + } + + void ScenarioDefinitionImpl::SetCatalogLocations(std::shared_ptr catalogLocations) + { + _catalogLocations = catalogLocations; + _isSetCatalogLocations = true; + } + + void ScenarioDefinitionImpl::SetRoadNetwork(std::shared_ptr roadNetwork) + { + _roadNetwork = roadNetwork; + _isSetRoadNetwork = true; + } + + void ScenarioDefinitionImpl::SetEntities(std::shared_ptr entities) + { + _entities = entities; + _isSetEntities = true; + } + + void ScenarioDefinitionImpl::SetStoryboard(std::shared_ptr storyboard) + { + _storyboard = storyboard; + _isSetStoryboard = true; + } + + std::shared_ptr ScenarioDefinitionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ScenarioDefinitionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IScenarioDefinition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IScenarioDefinitionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ScenarioDefinitionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ScenarioDefinitionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ScenarioDefinitionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ScenarioDefinitionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ScenarioDefinitionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ScenarioDefinitionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ScenarioDefinitionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ScenarioDefinitionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ScenarioDefinitionImpl::GetModelType() const + { + return "ScenarioDefinition"; + } + + // children + std::shared_ptr ScenarioDefinitionImpl::GetWriterCatalogLocations() const + { + return std::dynamic_pointer_cast(_catalogLocations); + } + std::shared_ptr ScenarioDefinitionImpl::GetWriterRoadNetwork() const + { + return std::dynamic_pointer_cast(_roadNetwork); + } + std::shared_ptr ScenarioDefinitionImpl::GetWriterEntities() const + { + return std::dynamic_pointer_cast(_entities); + } + std::shared_ptr ScenarioDefinitionImpl::GetWriterStoryboard() const + { + return std::dynamic_pointer_cast(_storyboard); + } + + ScenarioDefinitionImpl::ScenarioDefinitionImpl() + { + /** + * Filling the property to type map + */ + } + + void ScenarioDefinitionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ScenarioDefinitionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool ScenarioDefinitionImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> ScenarioDefinitionImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ScenarioDefinitionImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto variableDeclarations = GetWriterVariableDeclarations(); + if (!variableDeclarations.empty()) + { + for(auto&& item : variableDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto monitorDeclarations = GetWriterMonitorDeclarations(); + if (!monitorDeclarations.empty()) + { + for(auto&& item : monitorDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kCatalogLocations = GetWriterCatalogLocations(); + if (kCatalogLocations) + { + result.push_back(std::dynamic_pointer_cast(kCatalogLocations)); + } + const auto kRoadNetwork = GetWriterRoadNetwork(); + if (kRoadNetwork) + { + result.push_back(std::dynamic_pointer_cast(kRoadNetwork)); + } + const auto kEntities = GetWriterEntities(); + if (kEntities) + { + result.push_back(std::dynamic_pointer_cast(kEntities)); + } + const auto kStoryboard = GetWriterStoryboard(); + if (kStoryboard) + { + result.push_back(std::dynamic_pointer_cast(kStoryboard)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ScenarioDefinitionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kVariableDeclarations = GetWriterVariableDeclarations(); + if (!kVariableDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kVariableDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetVariableDeclarations(clonedList); + } + const auto kMonitorDeclarations = GetWriterMonitorDeclarations(); + if (!kMonitorDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kMonitorDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetMonitorDeclarations(clonedList); + } + const auto kCatalogLocations = GetWriterCatalogLocations(); + if (kCatalogLocations) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogLocations)->Clone(); + auto clonedChildICatalogLocations = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogLocations(std::dynamic_pointer_cast(clonedChildICatalogLocations)); + } + const auto kRoadNetwork = GetWriterRoadNetwork(); + if (kRoadNetwork) + { + auto clonedChild = std::dynamic_pointer_cast(kRoadNetwork)->Clone(); + auto clonedChildIRoadNetwork = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRoadNetwork(std::dynamic_pointer_cast(clonedChildIRoadNetwork)); + } + const auto kEntities = GetWriterEntities(); + if (kEntities) + { + auto clonedChild = std::dynamic_pointer_cast(kEntities)->Clone(); + auto clonedChildIEntities = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntities(std::dynamic_pointer_cast(clonedChildIEntities)); + } + const auto kStoryboard = GetWriterStoryboard(); + if (kStoryboard) + { + auto clonedChild = std::dynamic_pointer_cast(kStoryboard)->Clone(); + auto clonedChildIStoryboard = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStoryboard(std::dynamic_pointer_cast(clonedChildIStoryboard)); + } + return clonedObject; + } + + std::string ScenarioDefinitionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioDefinitionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS) + { + return std::dynamic_pointer_cast(GetCatalogLocations()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROAD_NETWORK) + { + return std::dynamic_pointer_cast(GetRoadNetwork()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITIES) + { + return std::dynamic_pointer_cast(GetEntities()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STORYBOARD) + { + return std::dynamic_pointer_cast(GetStoryboard()); + } + throw KeyNotSupportedException(); + } + + std::vector> ScenarioDefinitionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } if (key == OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetVariableDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } if (key == OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetMonitorDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioDefinitionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ScenarioDefinitionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void ScenarioDefinitionImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool ScenarioDefinitionImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + void ScenarioDefinitionImpl::ResetVariableDeclarations() + { + _isSetVariableDeclarations = false; + _variableDeclarations = {}; + + } + bool ScenarioDefinitionImpl::IsSetVariableDeclarations() const + { + return _isSetVariableDeclarations; + } + void ScenarioDefinitionImpl::ResetMonitorDeclarations() + { + _isSetMonitorDeclarations = false; + _monitorDeclarations = {}; + + } + bool ScenarioDefinitionImpl::IsSetMonitorDeclarations() const + { + return _isSetMonitorDeclarations; + } + bool ScenarioDefinitionImpl::IsSetCatalogLocations() const + { + return _isSetCatalogLocations; + } + bool ScenarioDefinitionImpl::IsSetRoadNetwork() const + { + return _isSetRoadNetwork; + } + bool ScenarioDefinitionImpl::IsSetEntities() const + { + return _isSetEntities; + } + bool ScenarioDefinitionImpl::IsSetStoryboard() const + { + return _isSetStoryboard; + } + + IOpenScenarioFlexElement* ScenarioObjectImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string ScenarioObjectImpl::GetName() const + { + return _name; + } + std::shared_ptr ScenarioObjectImpl::GetEntityObject() const + { + return _entityObject; + } + std::vector> ScenarioObjectImpl::GetObjectController() const + { + std::vector> temp; + for(auto&& elm: _objectController) + temp.push_back(elm); + return temp; + } + std::vector> ScenarioObjectImpl::GetWriterObjectController() const + { + return _objectController; + } + + int ScenarioObjectImpl::GetObjectControllerSize() const + { + return static_cast(_objectController.size()); + } + + std::shared_ptr ScenarioObjectImpl::GetObjectControllerAtIndex(unsigned int index) const + { + if (index >= 0 && _objectController.size() > index) + { + return _objectController[index]; + } + return nullptr; + } + + + void ScenarioObjectImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void ScenarioObjectImpl::SetEntityObject(std::shared_ptr entityObject) + { + _entityObject = entityObject; + _isSetEntityObject = true; + } + + void ScenarioObjectImpl::SetObjectController(std::vector>& objectController) + { + _objectController = objectController; + _isSetObjectController = true; + } + + std::shared_ptr ScenarioObjectImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ScenarioObjectImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IScenarioObject).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IScenarioObjectWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ScenarioObjectImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ScenarioObjectImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ScenarioObjectImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ScenarioObjectImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ScenarioObjectImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ScenarioObjectImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ScenarioObjectImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ScenarioObjectImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ScenarioObjectImpl::GetModelType() const + { + return "ScenarioObject"; + } + + void ScenarioObjectImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string ScenarioObjectImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool ScenarioObjectImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr ScenarioObjectImpl::GetWriterEntityObject() const + { + return std::dynamic_pointer_cast(_entityObject); + } + + ScenarioObjectImpl::ScenarioObjectImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void ScenarioObjectImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType ScenarioObjectImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ScenarioObjectImpl::GetChildren() const + { + std::vector> result; + + const auto kEntityObject = GetWriterEntityObject(); + if (kEntityObject) + { + result.push_back(std::dynamic_pointer_cast(kEntityObject)); + } + auto objectController = GetWriterObjectController(); + if (!objectController.empty()) + { + for(auto&& item : objectController) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ScenarioObjectImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kEntityObject = GetWriterEntityObject(); + if (kEntityObject) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityObject)->Clone(); + auto clonedChildIEntityObject = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityObject(std::dynamic_pointer_cast(clonedChildIEntityObject)); + } + const auto kObjectController = GetWriterObjectController(); + if (!kObjectController.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kObjectController) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetObjectController(clonedList); + } + return clonedObject; + } + + std::string ScenarioObjectImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioObjectImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_OBJECT) + { + return std::dynamic_pointer_cast(GetEntityObject()); + } + throw KeyNotSupportedException(); + } + + std::vector> ScenarioObjectImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER) + { + std::vector> vect; + for (auto&& elem : GetObjectController()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioObjectImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ScenarioObjectImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void ScenarioObjectImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool ScenarioObjectImpl::IsSetName() const + { + return _isSetName; + } + bool ScenarioObjectImpl::IsSetEntityObject() const + { + return _isSetEntityObject; + } + void ScenarioObjectImpl::ResetObjectController() + { + _isSetObjectController = false; + _objectController = {}; + + } + bool ScenarioObjectImpl::IsSetObjectController() const + { + return _isSetObjectController; + } + + IOpenScenarioFlexElement* ScenarioObjectTemplateImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ScenarioObjectTemplateImpl::GetEntitiyObject() const + { + return _entitiyObject; + } + std::vector> ScenarioObjectTemplateImpl::GetObjectController() const + { + std::vector> temp; + for(auto&& elm: _objectController) + temp.push_back(elm); + return temp; + } + std::vector> ScenarioObjectTemplateImpl::GetWriterObjectController() const + { + return _objectController; + } + + int ScenarioObjectTemplateImpl::GetObjectControllerSize() const + { + return static_cast(_objectController.size()); + } + + std::shared_ptr ScenarioObjectTemplateImpl::GetObjectControllerAtIndex(unsigned int index) const + { + if (index >= 0 && _objectController.size() > index) + { + return _objectController[index]; + } + return nullptr; + } + + + void ScenarioObjectTemplateImpl::SetEntitiyObject(std::shared_ptr entitiyObject) + { + _entitiyObject = entitiyObject; + _isSetEntitiyObject = true; + } + + void ScenarioObjectTemplateImpl::SetObjectController(std::vector>& objectController) + { + _objectController = objectController; + _isSetObjectController = true; + } + + std::shared_ptr ScenarioObjectTemplateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ScenarioObjectTemplateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IScenarioObjectTemplate).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IScenarioObjectTemplateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ScenarioObjectTemplateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ScenarioObjectTemplateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ScenarioObjectTemplateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ScenarioObjectTemplateImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ScenarioObjectTemplateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ScenarioObjectTemplateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ScenarioObjectTemplateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ScenarioObjectTemplateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ScenarioObjectTemplateImpl::GetModelType() const + { + return "ScenarioObjectTemplate"; + } + + // children + std::shared_ptr ScenarioObjectTemplateImpl::GetWriterEntitiyObject() const + { + return std::dynamic_pointer_cast(_entitiyObject); + } + + ScenarioObjectTemplateImpl::ScenarioObjectTemplateImpl() + { + /** + * Filling the property to type map + */ + } + + void ScenarioObjectTemplateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ScenarioObjectTemplateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ScenarioObjectTemplateImpl::GetChildren() const + { + std::vector> result; + + const auto kEntitiyObject = GetWriterEntitiyObject(); + if (kEntitiyObject) + { + result.push_back(std::dynamic_pointer_cast(kEntitiyObject)); + } + auto objectController = GetWriterObjectController(); + if (!objectController.empty()) + { + for(auto&& item : objectController) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ScenarioObjectTemplateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEntitiyObject = GetWriterEntitiyObject(); + if (kEntitiyObject) + { + auto clonedChild = std::dynamic_pointer_cast(kEntitiyObject)->Clone(); + auto clonedChildIEntityObject = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntitiyObject(std::dynamic_pointer_cast(clonedChildIEntityObject)); + } + const auto kObjectController = GetWriterObjectController(); + if (!kObjectController.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kObjectController) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetObjectController(clonedList); + } + return clonedObject; + } + + std::string ScenarioObjectTemplateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioObjectTemplateImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITIY_OBJECT) + { + return std::dynamic_pointer_cast(GetEntitiyObject()); + } + throw KeyNotSupportedException(); + } + + std::vector> ScenarioObjectTemplateImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER) + { + std::vector> vect; + for (auto&& elem : GetObjectController()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ScenarioObjectTemplateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ScenarioObjectTemplateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ScenarioObjectTemplateImpl::IsSetEntitiyObject() const + { + return _isSetEntitiyObject; + } + void ScenarioObjectTemplateImpl::ResetObjectController() + { + _isSetObjectController = false; + _objectController = {}; + + } + bool ScenarioObjectTemplateImpl::IsSetObjectController() const + { + return _isSetObjectController; + } + + IOpenScenarioFlexElement* SelectedEntitiesImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> SelectedEntitiesImpl::GetEntityRef() const + { + std::vector> temp; + for(auto&& elm: _entityRef) + temp.push_back(elm); + return temp; + } + std::vector> SelectedEntitiesImpl::GetWriterEntityRef() const + { + return _entityRef; + } + + int SelectedEntitiesImpl::GetEntityRefSize() const + { + return static_cast(_entityRef.size()); + } + + std::shared_ptr SelectedEntitiesImpl::GetEntityRefAtIndex(unsigned int index) const + { + if (index >= 0 && _entityRef.size() > index) + { + return _entityRef[index]; + } + return nullptr; + } + std::vector> SelectedEntitiesImpl::GetByType() const + { + std::vector> temp; + for(auto&& elm: _byType) + temp.push_back(elm); + return temp; + } + std::vector> SelectedEntitiesImpl::GetWriterByType() const + { + return _byType; + } + + int SelectedEntitiesImpl::GetByTypeSize() const + { + return static_cast(_byType.size()); + } + + std::shared_ptr SelectedEntitiesImpl::GetByTypeAtIndex(unsigned int index) const + { + if (index >= 0 && _byType.size() > index) + { + return _byType[index]; + } + return nullptr; + } + + + void SelectedEntitiesImpl::SetEntityRef(std::vector>& entityRef) + { + _entityRef = entityRef; + _byType = {}; + _isSetEntityRef = true; + } + + void SelectedEntitiesImpl::SetByType(std::vector>& byType) + { + _byType = byType; + _entityRef = {}; + _isSetByType = true; + } + + std::shared_ptr SelectedEntitiesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SelectedEntitiesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISelectedEntities).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISelectedEntitiesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SelectedEntitiesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SelectedEntitiesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SelectedEntitiesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SelectedEntitiesImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SelectedEntitiesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SelectedEntitiesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SelectedEntitiesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SelectedEntitiesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SelectedEntitiesImpl::GetModelType() const + { + return "SelectedEntities"; + } + + // children + + SelectedEntitiesImpl::SelectedEntitiesImpl() + { + /** + * Filling the property to type map + */ + } + + void SelectedEntitiesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType SelectedEntitiesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SelectedEntitiesImpl::GetChildren() const + { + std::vector> result; + + auto entityRef = GetWriterEntityRef(); + if (!entityRef.empty()) + { + for(auto&& item : entityRef) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto byType = GetWriterByType(); + if (!byType.empty()) + { + for(auto&& item : byType) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SelectedEntitiesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kEntityRef = GetWriterEntityRef(); + if (!kEntityRef.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntityRef) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntityRef(clonedList); + } + const auto kByType = GetWriterByType(); + if (!kByType.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kByType) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetByType(clonedList); + } + return clonedObject; + } + + std::string SelectedEntitiesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SelectedEntitiesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SelectedEntitiesImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + std::vector> vect; + for (auto&& elem : GetEntityRef()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__BY_TYPE) + { + std::vector> vect; + for (auto&& elem : GetByType()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SelectedEntitiesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SelectedEntitiesImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool SelectedEntitiesImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool SelectedEntitiesImpl::IsSetByType() const + { + return _isSetByType; + } + + IOpenScenarioFlexElement* SensorReferenceImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string SensorReferenceImpl::GetName() const + { + return _name; + } + + + void SensorReferenceImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + std::shared_ptr SensorReferenceImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SensorReferenceImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISensorReference).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISensorReferenceWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SensorReferenceImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SensorReferenceImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SensorReferenceImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SensorReferenceImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SensorReferenceImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SensorReferenceImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SensorReferenceImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SensorReferenceImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SensorReferenceImpl::GetModelType() const + { + return "SensorReference"; + } + + void SensorReferenceImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string SensorReferenceImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool SensorReferenceImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SensorReferenceImpl::SensorReferenceImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void SensorReferenceImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType SensorReferenceImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SensorReferenceImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SensorReferenceImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + return clonedObject; + } + + std::string SensorReferenceImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SensorReferenceImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SensorReferenceImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SensorReferenceImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SensorReferenceImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void SensorReferenceImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool SensorReferenceImpl::IsSetName() const + { + return _isSetName; + } + + IOpenScenarioFlexElement* SensorReferenceSetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> SensorReferenceSetImpl::GetSensorReferences() const + { + std::vector> temp; + for(auto&& elm: _sensorReferences) + temp.push_back(elm); + return temp; + } + std::vector> SensorReferenceSetImpl::GetWriterSensorReferences() const + { + return _sensorReferences; + } + + int SensorReferenceSetImpl::GetSensorReferencesSize() const + { + return static_cast(_sensorReferences.size()); + } + + std::shared_ptr SensorReferenceSetImpl::GetSensorReferencesAtIndex(unsigned int index) const + { + if (index >= 0 && _sensorReferences.size() > index) + { + return _sensorReferences[index]; + } + return nullptr; + } + + + void SensorReferenceSetImpl::SetSensorReferences(std::vector>& sensorReferences) + { + _sensorReferences = sensorReferences; + _isSetSensorReferences = true; + } + + std::shared_ptr SensorReferenceSetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SensorReferenceSetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISensorReferenceSet).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISensorReferenceSetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SensorReferenceSetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SensorReferenceSetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SensorReferenceSetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SensorReferenceSetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SensorReferenceSetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SensorReferenceSetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SensorReferenceSetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SensorReferenceSetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SensorReferenceSetImpl::GetModelType() const + { + return "SensorReferenceSet"; + } + + // children + + SensorReferenceSetImpl::SensorReferenceSetImpl() + { + /** + * Filling the property to type map + */ + } + + void SensorReferenceSetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType SensorReferenceSetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SensorReferenceSetImpl::GetChildren() const + { + std::vector> result; + + auto sensorReferences = GetWriterSensorReferences(); + if (!sensorReferences.empty()) + { + for(auto&& item : sensorReferences) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SensorReferenceSetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kSensorReferences = GetWriterSensorReferences(); + if (!kSensorReferences.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kSensorReferences) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetSensorReferences(clonedList); + } + return clonedObject; + } + + std::string SensorReferenceSetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SensorReferenceSetImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SensorReferenceSetImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE) + { + std::vector> vect; + for (auto&& elem : GetSensorReferences()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SensorReferenceSetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SensorReferenceSetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool SensorReferenceSetImpl::IsSetSensorReferences() const + { + return _isSetSensorReferences; + } + + IOpenScenarioFlexElement* SetMonitorActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> SetMonitorActionImpl::GetMonitorRef() const + { + return _monitorRef; + } + bool SetMonitorActionImpl::GetValue() const + { + return _value; + } + + + void SetMonitorActionImpl::SetMonitorRef(std::shared_ptr> monitorRef) + { + _monitorRef = monitorRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF); + _isSetMonitorRef = true; + } + + void SetMonitorActionImpl::SetValue(const bool value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr SetMonitorActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SetMonitorActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISetMonitorAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISetMonitorActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SetMonitorActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SetMonitorActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SetMonitorActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SetMonitorActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SetMonitorActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SetMonitorActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + DateTime SetMonitorActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SetMonitorActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SetMonitorActionImpl::GetModelType() const + { + return "SetMonitorAction"; + } + + void SetMonitorActionImpl::WriteParameterToMonitorRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, parameterName, nullTextMarker /*no textmarker*/); + _monitorRef = {}; + } + + void SetMonitorActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string SetMonitorActionImpl::GetParameterFromMonitorRef() const + { + auto monitorRef = OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF; + return GetParameterNameFromAttribute(monitorRef); + } + + std::string SetMonitorActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool SetMonitorActionImpl::IsMonitorRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool SetMonitorActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SetMonitorActionImpl::SetMonitorActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::BOOLEAN); + } + + void SetMonitorActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _monitorRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetMonitorRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType SetMonitorActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SetMonitorActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SetMonitorActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetMonitorRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_monitorRef = proxy; + + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string SetMonitorActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF) + { + // Get the Proxy + auto monitorRef = GetMonitorRef(); + return monitorRef!= nullptr ? monitorRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SetMonitorActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SetMonitorActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SetMonitorActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF) + { + // Get the Proxy + auto monitorRef = GetMonitorRef(); + return monitorRef != nullptr ? std::dynamic_pointer_cast(monitorRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string SetMonitorActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void SetMonitorActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool SetMonitorActionImpl::IsSetMonitorRef() const + { + return _isSetMonitorRef; + } + bool SetMonitorActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ShapeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr ShapeImpl::GetPolyline() const + { + return _polyline; + } + std::shared_ptr ShapeImpl::GetClothoid() const + { + return _clothoid; + } + std::shared_ptr ShapeImpl::GetClothoidSpline() const + { + return _clothoidSpline; + } + std::shared_ptr ShapeImpl::GetNurbs() const + { + return _nurbs; + } + + + void ShapeImpl::SetPolyline(std::shared_ptr polyline) + { + _polyline = polyline; + _clothoid = {}; + _clothoidSpline = {}; + _nurbs = {}; + _isSetPolyline = true; + } + + void ShapeImpl::SetClothoid(std::shared_ptr clothoid) + { + _clothoid = clothoid; + _polyline = {}; + _clothoidSpline = {}; + _nurbs = {}; + _isSetClothoid = true; + } + + void ShapeImpl::SetClothoidSpline(std::shared_ptr clothoidSpline) + { + _clothoidSpline = clothoidSpline; + _polyline = {}; + _clothoid = {}; + _nurbs = {}; + _isSetClothoidSpline = true; + } + + void ShapeImpl::SetNurbs(std::shared_ptr nurbs) + { + _nurbs = nurbs; + _polyline = {}; + _clothoid = {}; + _clothoidSpline = {}; + _isSetNurbs = true; + } + + std::shared_ptr ShapeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ShapeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IShape).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IShapeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ShapeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ShapeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ShapeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ShapeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ShapeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ShapeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ShapeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ShapeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ShapeImpl::GetModelType() const + { + return "Shape"; + } + + // children + std::shared_ptr ShapeImpl::GetWriterPolyline() const + { + return std::dynamic_pointer_cast(_polyline); + } + std::shared_ptr ShapeImpl::GetWriterClothoid() const + { + return std::dynamic_pointer_cast(_clothoid); + } + std::shared_ptr ShapeImpl::GetWriterClothoidSpline() const + { + return std::dynamic_pointer_cast(_clothoidSpline); + } + std::shared_ptr ShapeImpl::GetWriterNurbs() const + { + return std::dynamic_pointer_cast(_nurbs); + } + + ShapeImpl::ShapeImpl() + { + /** + * Filling the property to type map + */ + } + + void ShapeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ShapeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ShapeImpl::GetChildren() const + { + std::vector> result; + + const auto kPolyline = GetWriterPolyline(); + if (kPolyline) + { + result.push_back(std::dynamic_pointer_cast(kPolyline)); + } + const auto kClothoid = GetWriterClothoid(); + if (kClothoid) + { + result.push_back(std::dynamic_pointer_cast(kClothoid)); + } + const auto kClothoidSpline = GetWriterClothoidSpline(); + if (kClothoidSpline) + { + result.push_back(std::dynamic_pointer_cast(kClothoidSpline)); + } + const auto kNurbs = GetWriterNurbs(); + if (kNurbs) + { + result.push_back(std::dynamic_pointer_cast(kNurbs)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ShapeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPolyline = GetWriterPolyline(); + if (kPolyline) + { + auto clonedChild = std::dynamic_pointer_cast(kPolyline)->Clone(); + auto clonedChildIPolyline = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPolyline(std::dynamic_pointer_cast(clonedChildIPolyline)); + } + const auto kClothoid = GetWriterClothoid(); + if (kClothoid) + { + auto clonedChild = std::dynamic_pointer_cast(kClothoid)->Clone(); + auto clonedChildIClothoid = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetClothoid(std::dynamic_pointer_cast(clonedChildIClothoid)); + } + const auto kClothoidSpline = GetWriterClothoidSpline(); + if (kClothoidSpline) + { + auto clonedChild = std::dynamic_pointer_cast(kClothoidSpline)->Clone(); + auto clonedChildIClothoidSpline = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetClothoidSpline(std::dynamic_pointer_cast(clonedChildIClothoidSpline)); + } + const auto kNurbs = GetWriterNurbs(); + if (kNurbs) + { + auto clonedChild = std::dynamic_pointer_cast(kNurbs)->Clone(); + auto clonedChildINurbs = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetNurbs(std::dynamic_pointer_cast(clonedChildINurbs)); + } + return clonedObject; + } + + std::string ShapeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ShapeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POLYLINE) + { + return std::dynamic_pointer_cast(GetPolyline()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CLOTHOID) + { + return std::dynamic_pointer_cast(GetClothoid()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE) + { + return std::dynamic_pointer_cast(GetClothoidSpline()); + } + + if (key == OSC_CONSTANTS::ELEMENT__NURBS) + { + return std::dynamic_pointer_cast(GetNurbs()); + } + throw KeyNotSupportedException(); + } + + std::vector> ShapeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ShapeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ShapeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ShapeImpl::IsSetPolyline() const + { + return _isSetPolyline; + } + bool ShapeImpl::IsSetClothoid() const + { + return _isSetClothoid; + } + bool ShapeImpl::IsSetClothoidSpline() const + { + return _isSetClothoidSpline; + } + bool ShapeImpl::IsSetNurbs() const + { + return _isSetNurbs; + } + + IOpenScenarioFlexElement* SimulationTimeConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + Rule SimulationTimeConditionImpl::GetRule() const + { + return _rule; + } + double SimulationTimeConditionImpl::GetValue() const + { + return _value; + } + + + void SimulationTimeConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void SimulationTimeConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr SimulationTimeConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SimulationTimeConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISimulationTimeCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISimulationTimeConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SimulationTimeConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SimulationTimeConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SimulationTimeConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SimulationTimeConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t SimulationTimeConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SimulationTimeConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SimulationTimeConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SimulationTimeConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SimulationTimeConditionImpl::GetModelType() const + { + return "SimulationTimeCondition"; + } + + void SimulationTimeConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void SimulationTimeConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string SimulationTimeConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string SimulationTimeConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool SimulationTimeConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool SimulationTimeConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SimulationTimeConditionImpl::SimulationTimeConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void SimulationTimeConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType SimulationTimeConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SimulationTimeConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SimulationTimeConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string SimulationTimeConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SimulationTimeConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SimulationTimeConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SimulationTimeConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SimulationTimeConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void SimulationTimeConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool SimulationTimeConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool SimulationTimeConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* SpeedActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr SpeedActionImpl::GetSpeedActionDynamics() const + { + return _speedActionDynamics; + } + std::shared_ptr SpeedActionImpl::GetSpeedActionTarget() const + { + return _speedActionTarget; + } + + + void SpeedActionImpl::SetSpeedActionDynamics(std::shared_ptr speedActionDynamics) + { + _speedActionDynamics = speedActionDynamics; + _isSetSpeedActionDynamics = true; + } + + void SpeedActionImpl::SetSpeedActionTarget(std::shared_ptr speedActionTarget) + { + _speedActionTarget = speedActionTarget; + _isSetSpeedActionTarget = true; + } + + std::shared_ptr SpeedActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SpeedActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISpeedAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISpeedActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SpeedActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SpeedActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SpeedActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SpeedActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SpeedActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SpeedActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SpeedActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SpeedActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SpeedActionImpl::GetModelType() const + { + return "SpeedAction"; + } + + // children + std::shared_ptr SpeedActionImpl::GetWriterSpeedActionDynamics() const + { + return std::dynamic_pointer_cast(_speedActionDynamics); + } + std::shared_ptr SpeedActionImpl::GetWriterSpeedActionTarget() const + { + return std::dynamic_pointer_cast(_speedActionTarget); + } + + SpeedActionImpl::SpeedActionImpl() + { + /** + * Filling the property to type map + */ + } + + void SpeedActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType SpeedActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SpeedActionImpl::GetChildren() const + { + std::vector> result; + + const auto kSpeedActionDynamics = GetWriterSpeedActionDynamics(); + if (kSpeedActionDynamics) + { + result.push_back(std::dynamic_pointer_cast(kSpeedActionDynamics)); + } + const auto kSpeedActionTarget = GetWriterSpeedActionTarget(); + if (kSpeedActionTarget) + { + result.push_back(std::dynamic_pointer_cast(kSpeedActionTarget)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SpeedActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kSpeedActionDynamics = GetWriterSpeedActionDynamics(); + if (kSpeedActionDynamics) + { + auto clonedChild = std::dynamic_pointer_cast(kSpeedActionDynamics)->Clone(); + auto clonedChildITransitionDynamics = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSpeedActionDynamics(std::dynamic_pointer_cast(clonedChildITransitionDynamics)); + } + const auto kSpeedActionTarget = GetWriterSpeedActionTarget(); + if (kSpeedActionTarget) + { + auto clonedChild = std::dynamic_pointer_cast(kSpeedActionTarget)->Clone(); + auto clonedChildISpeedActionTarget = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSpeedActionTarget(std::dynamic_pointer_cast(clonedChildISpeedActionTarget)); + } + return clonedObject; + } + + std::string SpeedActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_ACTION_DYNAMICS) + { + return std::dynamic_pointer_cast(GetSpeedActionDynamics()); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_ACTION_TARGET) + { + return std::dynamic_pointer_cast(GetSpeedActionTarget()); + } + throw KeyNotSupportedException(); + } + + std::vector> SpeedActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SpeedActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool SpeedActionImpl::IsSetSpeedActionDynamics() const + { + return _isSetSpeedActionDynamics; + } + bool SpeedActionImpl::IsSetSpeedActionTarget() const + { + return _isSetSpeedActionTarget; + } + + IOpenScenarioFlexElement* SpeedActionTargetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr SpeedActionTargetImpl::GetRelativeTargetSpeed() const + { + return _relativeTargetSpeed; + } + std::shared_ptr SpeedActionTargetImpl::GetAbsoluteTargetSpeed() const + { + return _absoluteTargetSpeed; + } + + + void SpeedActionTargetImpl::SetRelativeTargetSpeed(std::shared_ptr relativeTargetSpeed) + { + _relativeTargetSpeed = relativeTargetSpeed; + _absoluteTargetSpeed = {}; + _isSetRelativeTargetSpeed = true; + } + + void SpeedActionTargetImpl::SetAbsoluteTargetSpeed(std::shared_ptr absoluteTargetSpeed) + { + _absoluteTargetSpeed = absoluteTargetSpeed; + _relativeTargetSpeed = {}; + _isSetAbsoluteTargetSpeed = true; + } + + std::shared_ptr SpeedActionTargetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SpeedActionTargetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISpeedActionTarget).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISpeedActionTargetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SpeedActionTargetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SpeedActionTargetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SpeedActionTargetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SpeedActionTargetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SpeedActionTargetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SpeedActionTargetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SpeedActionTargetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SpeedActionTargetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SpeedActionTargetImpl::GetModelType() const + { + return "SpeedActionTarget"; + } + + // children + std::shared_ptr SpeedActionTargetImpl::GetWriterRelativeTargetSpeed() const + { + return std::dynamic_pointer_cast(_relativeTargetSpeed); + } + std::shared_ptr SpeedActionTargetImpl::GetWriterAbsoluteTargetSpeed() const + { + return std::dynamic_pointer_cast(_absoluteTargetSpeed); + } + + SpeedActionTargetImpl::SpeedActionTargetImpl() + { + /** + * Filling the property to type map + */ + } + + void SpeedActionTargetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType SpeedActionTargetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SpeedActionTargetImpl::GetChildren() const + { + std::vector> result; + + const auto kRelativeTargetSpeed = GetWriterRelativeTargetSpeed(); + if (kRelativeTargetSpeed) + { + result.push_back(std::dynamic_pointer_cast(kRelativeTargetSpeed)); + } + const auto kAbsoluteTargetSpeed = GetWriterAbsoluteTargetSpeed(); + if (kAbsoluteTargetSpeed) + { + result.push_back(std::dynamic_pointer_cast(kAbsoluteTargetSpeed)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SpeedActionTargetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRelativeTargetSpeed = GetWriterRelativeTargetSpeed(); + if (kRelativeTargetSpeed) + { + auto clonedChild = std::dynamic_pointer_cast(kRelativeTargetSpeed)->Clone(); + auto clonedChildIRelativeTargetSpeed = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRelativeTargetSpeed(std::dynamic_pointer_cast(clonedChildIRelativeTargetSpeed)); + } + const auto kAbsoluteTargetSpeed = GetWriterAbsoluteTargetSpeed(); + if (kAbsoluteTargetSpeed) + { + auto clonedChild = std::dynamic_pointer_cast(kAbsoluteTargetSpeed)->Clone(); + auto clonedChildIAbsoluteTargetSpeed = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAbsoluteTargetSpeed(std::dynamic_pointer_cast(clonedChildIAbsoluteTargetSpeed)); + } + return clonedObject; + } + + std::string SpeedActionTargetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedActionTargetImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED) + { + return std::dynamic_pointer_cast(GetRelativeTargetSpeed()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED) + { + return std::dynamic_pointer_cast(GetAbsoluteTargetSpeed()); + } + throw KeyNotSupportedException(); + } + + std::vector> SpeedActionTargetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedActionTargetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SpeedActionTargetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool SpeedActionTargetImpl::IsSetRelativeTargetSpeed() const + { + return _isSetRelativeTargetSpeed; + } + bool SpeedActionTargetImpl::IsSetAbsoluteTargetSpeed() const + { + return _isSetAbsoluteTargetSpeed; + } + + IOpenScenarioFlexElement* SpeedConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + DirectionalDimension SpeedConditionImpl::GetDirection() const + { + return _direction; + } + Rule SpeedConditionImpl::GetRule() const + { + return _rule; + } + double SpeedConditionImpl::GetValue() const + { + return _value; + } + + + void SpeedConditionImpl::SetDirection(const DirectionalDimension direction) + { + _direction = direction; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + _isSetDirection = true; + } + + void SpeedConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void SpeedConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr SpeedConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SpeedConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISpeedCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISpeedConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SpeedConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SpeedConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SpeedConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SpeedConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t SpeedConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SpeedConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SpeedConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SpeedConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SpeedConditionImpl::GetModelType() const + { + return "SpeedCondition"; + } + + void SpeedConditionImpl::WriteParameterToDirection(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, parameterName, nullTextMarker /*no textmarker*/); + _direction = {}; + } + + void SpeedConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void SpeedConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string SpeedConditionImpl::GetParameterFromDirection() const + { + auto direction = OSC_CONSTANTS::ATTRIBUTE__DIRECTION; + return GetParameterNameFromAttribute(direction); + } + + std::string SpeedConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string SpeedConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool SpeedConditionImpl::IsDirectionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool SpeedConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool SpeedConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SpeedConditionImpl::SpeedConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void SpeedConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(parameterLiteralValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + _direction = kResult; + AddResolvedParameter(attributeKey); + _isSetDirection = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType SpeedConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SpeedConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SpeedConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDirection = GetDirection(); + if ( kDirection.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_direction = DirectionalDimension::GetFromLiteral(kDirection.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetDirection = _isSetDirection; + // clone children + return clonedObject; + } + + std::string SpeedConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SpeedConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SpeedConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + auto direction = GetDirection(); + return direction.GetLiteral() != "UNKNOWN" ? direction.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void SpeedConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void SpeedConditionImpl::ResetDirection() + { + _isSetDirection = false; + _direction = {}; + + } + bool SpeedConditionImpl::IsSetDirection() const + { + return _isSetDirection; + } + bool SpeedConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool SpeedConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* SpeedProfileActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> SpeedProfileActionImpl::GetEntityRef() const + { + return _entityRef; + } + FollowingMode SpeedProfileActionImpl::GetFollowingMode() const + { + return _followingMode; + } + std::shared_ptr SpeedProfileActionImpl::GetDynamicConstraints() const + { + return _dynamicConstraints; + } + std::vector> SpeedProfileActionImpl::GetSpeedProfileEntry() const + { + std::vector> temp; + for(auto&& elm: _speedProfileEntry) + temp.push_back(elm); + return temp; + } + std::vector> SpeedProfileActionImpl::GetWriterSpeedProfileEntry() const + { + return _speedProfileEntry; + } + + int SpeedProfileActionImpl::GetSpeedProfileEntrySize() const + { + return static_cast(_speedProfileEntry.size()); + } + + std::shared_ptr SpeedProfileActionImpl::GetSpeedProfileEntryAtIndex(unsigned int index) const + { + if (index >= 0 && _speedProfileEntry.size() > index) + { + return _speedProfileEntry[index]; + } + return nullptr; + } + + + void SpeedProfileActionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void SpeedProfileActionImpl::SetFollowingMode(const FollowingMode followingMode) + { + _followingMode = followingMode; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + _isSetFollowingMode = true; + } + + void SpeedProfileActionImpl::SetDynamicConstraints(std::shared_ptr dynamicConstraints) + { + _dynamicConstraints = dynamicConstraints; + _isSetDynamicConstraints = true; + } + + void SpeedProfileActionImpl::SetSpeedProfileEntry(std::vector>& speedProfileEntry) + { + _speedProfileEntry = speedProfileEntry; + _isSetSpeedProfileEntry = true; + } + + std::shared_ptr SpeedProfileActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SpeedProfileActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISpeedProfileAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISpeedProfileActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SpeedProfileActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SpeedProfileActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SpeedProfileActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SpeedProfileActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SpeedProfileActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SpeedProfileActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SpeedProfileActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SpeedProfileActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SpeedProfileActionImpl::GetModelType() const + { + return "SpeedProfileAction"; + } + + void SpeedProfileActionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void SpeedProfileActionImpl::WriteParameterToFollowingMode(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, parameterName, nullTextMarker /*no textmarker*/); + _followingMode = {}; + } + + std::string SpeedProfileActionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string SpeedProfileActionImpl::GetParameterFromFollowingMode() const + { + auto followingMode = OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE; + return GetParameterNameFromAttribute(followingMode); + } + + bool SpeedProfileActionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool SpeedProfileActionImpl::IsFollowingModeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr SpeedProfileActionImpl::GetWriterDynamicConstraints() const + { + return std::dynamic_pointer_cast(_dynamicConstraints); + } + + SpeedProfileActionImpl::SpeedProfileActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, SimpleType::ENUM_TYPE); + } + + void SpeedProfileActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(parameterLiteralValue); + if (kResult != FollowingMode::UNKNOWN) + { + _followingMode = kResult; + AddResolvedParameter(attributeKey); + _isSetFollowingMode = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType SpeedProfileActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SpeedProfileActionImpl::GetChildren() const + { + std::vector> result; + + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + result.push_back(std::dynamic_pointer_cast(kDynamicConstraints)); + } + auto speedProfileEntry = GetWriterSpeedProfileEntry(); + if (!speedProfileEntry.empty()) + { + for(auto&& item : speedProfileEntry) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SpeedProfileActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Enumeration Type + const auto kFollowingMode = GetFollowingMode(); + if ( kFollowingMode.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_followingMode = FollowingMode::GetFromLiteral(kFollowingMode.GetLiteral()); + } + // clone indicators + clonedObject->_isSetEntityRef = _isSetEntityRef; + // clone children + const auto kDynamicConstraints = GetWriterDynamicConstraints(); + if (kDynamicConstraints) + { + auto clonedChild = std::dynamic_pointer_cast(kDynamicConstraints)->Clone(); + auto clonedChildIDynamicConstraints = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDynamicConstraints(std::dynamic_pointer_cast(clonedChildIDynamicConstraints)); + } + const auto kSpeedProfileEntry = GetWriterSpeedProfileEntry(); + if (!kSpeedProfileEntry.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kSpeedProfileEntry) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetSpeedProfileEntry(clonedList); + } + return clonedObject; + } + + std::string SpeedProfileActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedProfileActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS) + { + return std::dynamic_pointer_cast(GetDynamicConstraints()); + } + throw KeyNotSupportedException(); + } + + std::vector> SpeedProfileActionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetSpeedProfileEntry()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedProfileActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string SpeedProfileActionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + auto followingMode = GetFollowingMode(); + return followingMode.GetLiteral() != "UNKNOWN" ? followingMode.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + void SpeedProfileActionImpl::ResetEntityRef() + { + _isSetEntityRef = false; + _entityRef = nullptr; + + } + bool SpeedProfileActionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool SpeedProfileActionImpl::IsSetFollowingMode() const + { + return _isSetFollowingMode; + } + void SpeedProfileActionImpl::ResetDynamicConstraints() + { + _isSetDynamicConstraints = false; + _dynamicConstraints = {}; + + } + bool SpeedProfileActionImpl::IsSetDynamicConstraints() const + { + return _isSetDynamicConstraints; + } + bool SpeedProfileActionImpl::IsSetSpeedProfileEntry() const + { + return _isSetSpeedProfileEntry; + } + + IOpenScenarioFlexElement* SpeedProfileEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + double SpeedProfileEntryImpl::GetSpeed() const + { + return _speed; + } + double SpeedProfileEntryImpl::GetTime() const + { + return _time; + } + + + void SpeedProfileEntryImpl::SetSpeed(const double speed) + { + _speed = speed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED); + _isSetSpeed = true; + } + + void SpeedProfileEntryImpl::SetTime(const double time) + { + _time = time; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME); + _isSetTime = true; + } + + std::shared_ptr SpeedProfileEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SpeedProfileEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISpeedProfileEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISpeedProfileEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SpeedProfileEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SpeedProfileEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SpeedProfileEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SpeedProfileEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + return GetSpeed(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + return GetTime(); + } + throw KeyNotSupportedException(); + + } + + uint16_t SpeedProfileEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SpeedProfileEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SpeedProfileEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SpeedProfileEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SpeedProfileEntryImpl::GetModelType() const + { + return "SpeedProfileEntry"; + } + + void SpeedProfileEntryImpl::WriteParameterToSpeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, parameterName, nullTextMarker /*no textmarker*/); + _speed = {}; + } + + void SpeedProfileEntryImpl::WriteParameterToTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, parameterName, nullTextMarker /*no textmarker*/); + _time = {}; + } + + std::string SpeedProfileEntryImpl::GetParameterFromSpeed() const + { + auto speed = OSC_CONSTANTS::ATTRIBUTE__SPEED; + return GetParameterNameFromAttribute(speed); + } + + std::string SpeedProfileEntryImpl::GetParameterFromTime() const + { + auto time = OSC_CONSTANTS::ATTRIBUTE__TIME; + return GetParameterNameFromAttribute(time); + } + + bool SpeedProfileEntryImpl::IsSpeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPEED); + if (kIt != keys.end()) + return true; + return false; + } + + bool SpeedProfileEntryImpl::IsTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SpeedProfileEntryImpl::SpeedProfileEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPEED, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME, SimpleType::DOUBLE); + } + + void SpeedProfileEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + } + + SimpleType SpeedProfileEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SpeedProfileEntryImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SpeedProfileEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_speed = GetSpeed(); + // Simple type + clonedObject->_time = GetTime(); + // clone indicators + clonedObject->_isSetTime = _isSetTime; + // clone children + return clonedObject; + } + + std::string SpeedProfileEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedProfileEntryImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SpeedProfileEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SpeedProfileEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SpeedProfileEntryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void SpeedProfileEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = value; + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = value; + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + + } + + + bool SpeedProfileEntryImpl::IsSetSpeed() const + { + return _isSetSpeed; + } + void SpeedProfileEntryImpl::ResetTime() + { + _isSetTime = false; + _time = {}; + + } + bool SpeedProfileEntryImpl::IsSetTime() const + { + return _isSetTime; + } + + IOpenScenarioFlexElement* StandStillConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double StandStillConditionImpl::GetDuration() const + { + return _duration; + } + + + void StandStillConditionImpl::SetDuration(const double duration) + { + _duration = duration; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION); + _isSetDuration = true; + } + + std::shared_ptr StandStillConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StandStillConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStandStillCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStandStillConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StandStillConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StandStillConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StandStillConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StandStillConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + return GetDuration(); + } + throw KeyNotSupportedException(); + + } + + uint16_t StandStillConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StandStillConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StandStillConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StandStillConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StandStillConditionImpl::GetModelType() const + { + return "StandStillCondition"; + } + + void StandStillConditionImpl::WriteParameterToDuration(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, parameterName, nullTextMarker /*no textmarker*/); + _duration = {}; + } + + std::string StandStillConditionImpl::GetParameterFromDuration() const + { + auto duration = OSC_CONSTANTS::ATTRIBUTE__DURATION; + return GetParameterNameFromAttribute(duration); + } + + bool StandStillConditionImpl::IsDurationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DURATION); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + StandStillConditionImpl::StandStillConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DURATION, SimpleType::DOUBLE); + } + + void StandStillConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + } + + SimpleType StandStillConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StandStillConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StandStillConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_duration = GetDuration(); + // clone indicators + // clone children + return clonedObject; + } + + std::string StandStillConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr StandStillConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> StandStillConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr StandStillConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StandStillConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void StandStillConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DURATION) + { + // Simple type + _duration = value; + AddResolvedParameter(attributeKey); + _isSetDuration = true; + } + + } + + + bool StandStillConditionImpl::IsSetDuration() const + { + return _isSetDuration; + } + + IOpenScenarioFlexElement* SteadyStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr SteadyStateImpl::GetTargetDistanceSteadyState() const + { + return _targetDistanceSteadyState; + } + std::shared_ptr SteadyStateImpl::GetTargetTimeSteadyState() const + { + return _targetTimeSteadyState; + } + + + void SteadyStateImpl::SetTargetDistanceSteadyState(std::shared_ptr targetDistanceSteadyState) + { + _targetDistanceSteadyState = targetDistanceSteadyState; + _targetTimeSteadyState = {}; + _isSetTargetDistanceSteadyState = true; + } + + void SteadyStateImpl::SetTargetTimeSteadyState(std::shared_ptr targetTimeSteadyState) + { + _targetTimeSteadyState = targetTimeSteadyState; + _targetDistanceSteadyState = {}; + _isSetTargetTimeSteadyState = true; + } + + std::shared_ptr SteadyStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SteadyStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISteadyState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISteadyStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SteadyStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SteadyStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SteadyStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SteadyStateImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t SteadyStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SteadyStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SteadyStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SteadyStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SteadyStateImpl::GetModelType() const + { + return "SteadyState"; + } + + // children + std::shared_ptr SteadyStateImpl::GetWriterTargetDistanceSteadyState() const + { + return std::dynamic_pointer_cast(_targetDistanceSteadyState); + } + std::shared_ptr SteadyStateImpl::GetWriterTargetTimeSteadyState() const + { + return std::dynamic_pointer_cast(_targetTimeSteadyState); + } + + SteadyStateImpl::SteadyStateImpl() + { + /** + * Filling the property to type map + */ + } + + void SteadyStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType SteadyStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SteadyStateImpl::GetChildren() const + { + std::vector> result; + + const auto kTargetDistanceSteadyState = GetWriterTargetDistanceSteadyState(); + if (kTargetDistanceSteadyState) + { + result.push_back(std::dynamic_pointer_cast(kTargetDistanceSteadyState)); + } + const auto kTargetTimeSteadyState = GetWriterTargetTimeSteadyState(); + if (kTargetTimeSteadyState) + { + result.push_back(std::dynamic_pointer_cast(kTargetTimeSteadyState)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SteadyStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTargetDistanceSteadyState = GetWriterTargetDistanceSteadyState(); + if (kTargetDistanceSteadyState) + { + auto clonedChild = std::dynamic_pointer_cast(kTargetDistanceSteadyState)->Clone(); + auto clonedChildITargetDistanceSteadyState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTargetDistanceSteadyState(std::dynamic_pointer_cast(clonedChildITargetDistanceSteadyState)); + } + const auto kTargetTimeSteadyState = GetWriterTargetTimeSteadyState(); + if (kTargetTimeSteadyState) + { + auto clonedChild = std::dynamic_pointer_cast(kTargetTimeSteadyState)->Clone(); + auto clonedChildITargetTimeSteadyState = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTargetTimeSteadyState(std::dynamic_pointer_cast(clonedChildITargetTimeSteadyState)); + } + return clonedObject; + } + + std::string SteadyStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SteadyStateImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE) + { + return std::dynamic_pointer_cast(GetTargetDistanceSteadyState()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE) + { + return std::dynamic_pointer_cast(GetTargetTimeSteadyState()); + } + throw KeyNotSupportedException(); + } + + std::vector> SteadyStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SteadyStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SteadyStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool SteadyStateImpl::IsSetTargetDistanceSteadyState() const + { + return _isSetTargetDistanceSteadyState; + } + bool SteadyStateImpl::IsSetTargetTimeSteadyState() const + { + return _isSetTargetTimeSteadyState; + } + + IOpenScenarioFlexElement* StochasticImpl::GetOpenScenarioFlexElement() + { + return this; + } + uint32_t StochasticImpl::GetNumberOfTestRuns() const + { + return _numberOfTestRuns; + } + double StochasticImpl::GetRandomSeed() const + { + return _randomSeed; + } + std::vector> StochasticImpl::GetStochasticDistributions() const + { + std::vector> temp; + for(auto&& elm: _stochasticDistributions) + temp.push_back(elm); + return temp; + } + std::vector> StochasticImpl::GetWriterStochasticDistributions() const + { + return _stochasticDistributions; + } + + int StochasticImpl::GetStochasticDistributionsSize() const + { + return static_cast(_stochasticDistributions.size()); + } + + std::shared_ptr StochasticImpl::GetStochasticDistributionsAtIndex(unsigned int index) const + { + if (index >= 0 && _stochasticDistributions.size() > index) + { + return _stochasticDistributions[index]; + } + return nullptr; + } + + + void StochasticImpl::SetNumberOfTestRuns(const uint32_t numberOfTestRuns) + { + _numberOfTestRuns = numberOfTestRuns; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS); + _isSetNumberOfTestRuns = true; + } + + void StochasticImpl::SetRandomSeed(const double randomSeed) + { + _randomSeed = randomSeed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED); + _isSetRandomSeed = true; + } + + void StochasticImpl::SetStochasticDistributions(std::vector>& stochasticDistributions) + { + _stochasticDistributions = stochasticDistributions; + _isSetStochasticDistributions = true; + } + + std::shared_ptr StochasticImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StochasticImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStochastic).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStochasticWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StochasticImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StochasticImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS) + { + return GetNumberOfTestRuns(); + } + throw KeyNotSupportedException(); + + } + + int StochasticImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StochasticImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED) + { + return GetRandomSeed(); + } + throw KeyNotSupportedException(); + + } + + uint16_t StochasticImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StochasticImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StochasticImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StochasticImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StochasticImpl::GetModelType() const + { + return "Stochastic"; + } + + void StochasticImpl::WriteParameterToNumberOfTestRuns(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, parameterName, nullTextMarker /*no textmarker*/); + _numberOfTestRuns = {}; + } + + void StochasticImpl::WriteParameterToRandomSeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, parameterName, nullTextMarker /*no textmarker*/); + _randomSeed = {}; + } + + std::string StochasticImpl::GetParameterFromNumberOfTestRuns() const + { + auto numberOfTestRuns = OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS; + return GetParameterNameFromAttribute(numberOfTestRuns); + } + + std::string StochasticImpl::GetParameterFromRandomSeed() const + { + auto randomSeed = OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED; + return GetParameterNameFromAttribute(randomSeed); + } + + bool StochasticImpl::IsNumberOfTestRunsParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS); + if (kIt != keys.end()) + return true; + return false; + } + + bool StochasticImpl::IsRandomSeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + StochasticImpl::StochasticImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, SimpleType::UNSIGNED_INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, SimpleType::DOUBLE); + } + + void StochasticImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS) + { + // Simple type + _numberOfTestRuns = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetNumberOfTestRuns = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED) + { + // Simple type + _randomSeed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRandomSeed = true; + } + } + + SimpleType StochasticImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StochasticImpl::GetChildren() const + { + std::vector> result; + + auto stochasticDistributions = GetWriterStochasticDistributions(); + if (!stochasticDistributions.empty()) + { + for(auto&& item : stochasticDistributions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StochasticImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_numberOfTestRuns = GetNumberOfTestRuns(); + // Simple type + clonedObject->_randomSeed = GetRandomSeed(); + // clone indicators + clonedObject->_isSetRandomSeed = _isSetRandomSeed; + // clone children + const auto kStochasticDistributions = GetWriterStochasticDistributions(); + if (!kStochasticDistributions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kStochasticDistributions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetStochasticDistributions(clonedList); + } + return clonedObject; + } + + std::string StochasticImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> StochasticImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION) + { + std::vector> vect; + for (auto&& elem : GetStochasticDistributions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StochasticImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void StochasticImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS) + { + // Simple type + _numberOfTestRuns = value; + AddResolvedParameter(attributeKey); + _isSetNumberOfTestRuns = true; + } + + } + void StochasticImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED) + { + // Simple type + _randomSeed = value; + AddResolvedParameter(attributeKey); + _isSetRandomSeed = true; + } + + } + + + bool StochasticImpl::IsSetNumberOfTestRuns() const + { + return _isSetNumberOfTestRuns; + } + void StochasticImpl::ResetRandomSeed() + { + _isSetRandomSeed = false; + _randomSeed = {}; + + } + bool StochasticImpl::IsSetRandomSeed() const + { + return _isSetRandomSeed; + } + bool StochasticImpl::IsSetStochasticDistributions() const + { + return _isSetStochasticDistributions; + } + + IOpenScenarioFlexElement* StochasticDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string StochasticDistributionImpl::GetParameterName() const + { + return _parameterName; + } + std::shared_ptr StochasticDistributionImpl::GetStochasticDistributionType() const + { + return _stochasticDistributionType; + } + + + void StochasticDistributionImpl::SetParameterName(const std::string parameterName) + { + _parameterName = parameterName; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME); + _isSetParameterName = true; + } + + void StochasticDistributionImpl::SetStochasticDistributionType(std::shared_ptr stochasticDistributionType) + { + _stochasticDistributionType = stochasticDistributionType; + _isSetStochasticDistributionType = true; + } + + std::shared_ptr StochasticDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StochasticDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStochasticDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStochasticDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StochasticDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StochasticDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StochasticDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StochasticDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t StochasticDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StochasticDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StochasticDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StochasticDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StochasticDistributionImpl::GetModelType() const + { + return "StochasticDistribution"; + } + + void StochasticDistributionImpl::WriteParameterToParameterName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, parameterName, nullTextMarker /*no textmarker*/); + _parameterName = {}; + } + + std::string StochasticDistributionImpl::GetParameterFromParameterName() const + { + auto parameterName = OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME; + return GetParameterNameFromAttribute(parameterName); + } + + bool StochasticDistributionImpl::IsParameterNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr StochasticDistributionImpl::GetWriterStochasticDistributionType() const + { + return std::dynamic_pointer_cast(_stochasticDistributionType); + } + + StochasticDistributionImpl::StochasticDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, SimpleType::STRING); + } + + void StochasticDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + // Simple type + _parameterName = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetParameterName = true; + } + } + + SimpleType StochasticDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StochasticDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kStochasticDistributionType = GetWriterStochasticDistributionType(); + if (kStochasticDistributionType) + { + result.push_back(std::dynamic_pointer_cast(kStochasticDistributionType)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StochasticDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_parameterName = GetParameterName(); + // clone indicators + // clone children + const auto kStochasticDistributionType = GetWriterStochasticDistributionType(); + if (kStochasticDistributionType) + { + auto clonedChild = std::dynamic_pointer_cast(kStochasticDistributionType)->Clone(); + auto clonedChildIStochasticDistributionType = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStochasticDistributionType(std::dynamic_pointer_cast(clonedChildIStochasticDistributionType)); + } + return clonedObject; + } + + std::string StochasticDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + return GetParameterName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION_TYPE) + { + return std::dynamic_pointer_cast(GetStochasticDistributionType()); + } + throw KeyNotSupportedException(); + } + + std::vector> StochasticDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StochasticDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void StochasticDistributionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME) + { + // Simple type + _parameterName = value; + AddResolvedParameter(attributeKey); + _isSetParameterName = true; + } + + } + + + bool StochasticDistributionImpl::IsSetParameterName() const + { + return _isSetParameterName; + } + bool StochasticDistributionImpl::IsSetStochasticDistributionType() const + { + return _isSetStochasticDistributionType; + } + + IOpenScenarioFlexElement* StochasticDistributionTypeImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr StochasticDistributionTypeImpl::GetProbabilityDistributionSet() const + { + return _probabilityDistributionSet; + } + std::shared_ptr StochasticDistributionTypeImpl::GetNormalDistribution() const + { + return _normalDistribution; + } + std::shared_ptr StochasticDistributionTypeImpl::GetLogNormalDistribution() const + { + return _logNormalDistribution; + } + std::shared_ptr StochasticDistributionTypeImpl::GetUniformDistribution() const + { + return _uniformDistribution; + } + std::shared_ptr StochasticDistributionTypeImpl::GetPoissonDistribution() const + { + return _poissonDistribution; + } + std::shared_ptr StochasticDistributionTypeImpl::GetHistogram() const + { + return _histogram; + } + std::shared_ptr StochasticDistributionTypeImpl::GetUserDefinedDistribution() const + { + return _userDefinedDistribution; + } + + + void StochasticDistributionTypeImpl::SetProbabilityDistributionSet(std::shared_ptr probabilityDistributionSet) + { + _probabilityDistributionSet = probabilityDistributionSet; + _normalDistribution = {}; + _logNormalDistribution = {}; + _uniformDistribution = {}; + _poissonDistribution = {}; + _histogram = {}; + _userDefinedDistribution = {}; + _isSetProbabilityDistributionSet = true; + } + + void StochasticDistributionTypeImpl::SetNormalDistribution(std::shared_ptr normalDistribution) + { + _normalDistribution = normalDistribution; + _probabilityDistributionSet = {}; + _logNormalDistribution = {}; + _uniformDistribution = {}; + _poissonDistribution = {}; + _histogram = {}; + _userDefinedDistribution = {}; + _isSetNormalDistribution = true; + } + + void StochasticDistributionTypeImpl::SetLogNormalDistribution(std::shared_ptr logNormalDistribution) + { + _logNormalDistribution = logNormalDistribution; + _probabilityDistributionSet = {}; + _normalDistribution = {}; + _uniformDistribution = {}; + _poissonDistribution = {}; + _histogram = {}; + _userDefinedDistribution = {}; + _isSetLogNormalDistribution = true; + } + + void StochasticDistributionTypeImpl::SetUniformDistribution(std::shared_ptr uniformDistribution) + { + _uniformDistribution = uniformDistribution; + _probabilityDistributionSet = {}; + _normalDistribution = {}; + _logNormalDistribution = {}; + _poissonDistribution = {}; + _histogram = {}; + _userDefinedDistribution = {}; + _isSetUniformDistribution = true; + } + + void StochasticDistributionTypeImpl::SetPoissonDistribution(std::shared_ptr poissonDistribution) + { + _poissonDistribution = poissonDistribution; + _probabilityDistributionSet = {}; + _normalDistribution = {}; + _logNormalDistribution = {}; + _uniformDistribution = {}; + _histogram = {}; + _userDefinedDistribution = {}; + _isSetPoissonDistribution = true; + } + + void StochasticDistributionTypeImpl::SetHistogram(std::shared_ptr histogram) + { + _histogram = histogram; + _probabilityDistributionSet = {}; + _normalDistribution = {}; + _logNormalDistribution = {}; + _uniformDistribution = {}; + _poissonDistribution = {}; + _userDefinedDistribution = {}; + _isSetHistogram = true; + } + + void StochasticDistributionTypeImpl::SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) + { + _userDefinedDistribution = userDefinedDistribution; + _probabilityDistributionSet = {}; + _normalDistribution = {}; + _logNormalDistribution = {}; + _uniformDistribution = {}; + _poissonDistribution = {}; + _histogram = {}; + _isSetUserDefinedDistribution = true; + } + + std::shared_ptr StochasticDistributionTypeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StochasticDistributionTypeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStochasticDistributionType).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStochasticDistributionTypeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StochasticDistributionTypeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StochasticDistributionTypeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StochasticDistributionTypeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StochasticDistributionTypeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t StochasticDistributionTypeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StochasticDistributionTypeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StochasticDistributionTypeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StochasticDistributionTypeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StochasticDistributionTypeImpl::GetModelType() const + { + return "StochasticDistributionType"; + } + + // children + std::shared_ptr StochasticDistributionTypeImpl::GetWriterProbabilityDistributionSet() const + { + return std::dynamic_pointer_cast(_probabilityDistributionSet); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterNormalDistribution() const + { + return std::dynamic_pointer_cast(_normalDistribution); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterLogNormalDistribution() const + { + return std::dynamic_pointer_cast(_logNormalDistribution); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterUniformDistribution() const + { + return std::dynamic_pointer_cast(_uniformDistribution); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterPoissonDistribution() const + { + return std::dynamic_pointer_cast(_poissonDistribution); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterHistogram() const + { + return std::dynamic_pointer_cast(_histogram); + } + std::shared_ptr StochasticDistributionTypeImpl::GetWriterUserDefinedDistribution() const + { + return std::dynamic_pointer_cast(_userDefinedDistribution); + } + + StochasticDistributionTypeImpl::StochasticDistributionTypeImpl() + { + /** + * Filling the property to type map + */ + } + + void StochasticDistributionTypeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType StochasticDistributionTypeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StochasticDistributionTypeImpl::GetChildren() const + { + std::vector> result; + + const auto kProbabilityDistributionSet = GetWriterProbabilityDistributionSet(); + if (kProbabilityDistributionSet) + { + result.push_back(std::dynamic_pointer_cast(kProbabilityDistributionSet)); + } + const auto kNormalDistribution = GetWriterNormalDistribution(); + if (kNormalDistribution) + { + result.push_back(std::dynamic_pointer_cast(kNormalDistribution)); + } + const auto kLogNormalDistribution = GetWriterLogNormalDistribution(); + if (kLogNormalDistribution) + { + result.push_back(std::dynamic_pointer_cast(kLogNormalDistribution)); + } + const auto kUniformDistribution = GetWriterUniformDistribution(); + if (kUniformDistribution) + { + result.push_back(std::dynamic_pointer_cast(kUniformDistribution)); + } + const auto kPoissonDistribution = GetWriterPoissonDistribution(); + if (kPoissonDistribution) + { + result.push_back(std::dynamic_pointer_cast(kPoissonDistribution)); + } + const auto kHistogram = GetWriterHistogram(); + if (kHistogram) + { + result.push_back(std::dynamic_pointer_cast(kHistogram)); + } + const auto kUserDefinedDistribution = GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + result.push_back(std::dynamic_pointer_cast(kUserDefinedDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StochasticDistributionTypeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kProbabilityDistributionSet = GetWriterProbabilityDistributionSet(); + if (kProbabilityDistributionSet) + { + auto clonedChild = std::dynamic_pointer_cast(kProbabilityDistributionSet)->Clone(); + auto clonedChildIProbabilityDistributionSet = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProbabilityDistributionSet(std::dynamic_pointer_cast(clonedChildIProbabilityDistributionSet)); + } + const auto kNormalDistribution = GetWriterNormalDistribution(); + if (kNormalDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kNormalDistribution)->Clone(); + auto clonedChildINormalDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetNormalDistribution(std::dynamic_pointer_cast(clonedChildINormalDistribution)); + } + const auto kLogNormalDistribution = GetWriterLogNormalDistribution(); + if (kLogNormalDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kLogNormalDistribution)->Clone(); + auto clonedChildILogNormalDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetLogNormalDistribution(std::dynamic_pointer_cast(clonedChildILogNormalDistribution)); + } + const auto kUniformDistribution = GetWriterUniformDistribution(); + if (kUniformDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kUniformDistribution)->Clone(); + auto clonedChildIUniformDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUniformDistribution(std::dynamic_pointer_cast(clonedChildIUniformDistribution)); + } + const auto kPoissonDistribution = GetWriterPoissonDistribution(); + if (kPoissonDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kPoissonDistribution)->Clone(); + auto clonedChildIPoissonDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPoissonDistribution(std::dynamic_pointer_cast(clonedChildIPoissonDistribution)); + } + const auto kHistogram = GetWriterHistogram(); + if (kHistogram) + { + auto clonedChild = std::dynamic_pointer_cast(kHistogram)->Clone(); + auto clonedChildIHistogram = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetHistogram(std::dynamic_pointer_cast(clonedChildIHistogram)); + } + const auto kUserDefinedDistribution = GetWriterUserDefinedDistribution(); + if (kUserDefinedDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kUserDefinedDistribution)->Clone(); + auto clonedChildIUserDefinedDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetUserDefinedDistribution(std::dynamic_pointer_cast(clonedChildIUserDefinedDistribution)); + } + return clonedObject; + } + + std::string StochasticDistributionTypeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticDistributionTypeImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET) + { + return std::dynamic_pointer_cast(GetProbabilityDistributionSet()); + } + + if (key == OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetNormalDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetLogNormalDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetUniformDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetPoissonDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__HISTOGRAM) + { + return std::dynamic_pointer_cast(GetHistogram()); + } + + if (key == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetUserDefinedDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> StochasticDistributionTypeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr StochasticDistributionTypeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StochasticDistributionTypeImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool StochasticDistributionTypeImpl::IsSetProbabilityDistributionSet() const + { + return _isSetProbabilityDistributionSet; + } + bool StochasticDistributionTypeImpl::IsSetNormalDistribution() const + { + return _isSetNormalDistribution; + } + bool StochasticDistributionTypeImpl::IsSetLogNormalDistribution() const + { + return _isSetLogNormalDistribution; + } + bool StochasticDistributionTypeImpl::IsSetUniformDistribution() const + { + return _isSetUniformDistribution; + } + bool StochasticDistributionTypeImpl::IsSetPoissonDistribution() const + { + return _isSetPoissonDistribution; + } + bool StochasticDistributionTypeImpl::IsSetHistogram() const + { + return _isSetHistogram; + } + bool StochasticDistributionTypeImpl::IsSetUserDefinedDistribution() const + { + return _isSetUserDefinedDistribution; + } + + IOpenScenarioFlexElement* StoryImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string StoryImpl::GetName() const + { + return _name; + } + std::vector> StoryImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> StoryImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int StoryImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr StoryImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::vector> StoryImpl::GetActs() const + { + std::vector> temp; + for(auto&& elm: _acts) + temp.push_back(elm); + return temp; + } + std::vector> StoryImpl::GetWriterActs() const + { + return _acts; + } + + int StoryImpl::GetActsSize() const + { + return static_cast(_acts.size()); + } + + std::shared_ptr StoryImpl::GetActsAtIndex(unsigned int index) const + { + if (index >= 0 && _acts.size() > index) + { + return _acts[index]; + } + return nullptr; + } + + + void StoryImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void StoryImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void StoryImpl::SetActs(std::vector>& acts) + { + _acts = acts; + _isSetActs = true; + } + + std::shared_ptr StoryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StoryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStory).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStoryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StoryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StoryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StoryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StoryImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t StoryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StoryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StoryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StoryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StoryImpl::GetModelType() const + { + return "Story"; + } + + void StoryImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string StoryImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool StoryImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + StoryImpl::StoryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void StoryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType StoryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool StoryImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> StoryImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StoryImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + auto acts = GetWriterActs(); + if (!acts.empty()) + { + for(auto&& item : acts) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StoryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kActs = GetWriterActs(); + if (!kActs.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kActs) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetActs(clonedList); + } + return clonedObject; + } + + std::string StoryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> StoryImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + if (key == OSC_CONSTANTS::ELEMENT__ACT) + { + std::vector> vect; + for (auto&& elem : GetActs()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StoryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void StoryImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool StoryImpl::IsSetName() const + { + return _isSetName; + } + void StoryImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool StoryImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool StoryImpl::IsSetActs() const + { + return _isSetActs; + } + + IOpenScenarioFlexElement* StoryboardImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr StoryboardImpl::GetInit() const + { + return _init; + } + std::vector> StoryboardImpl::GetStories() const + { + std::vector> temp; + for(auto&& elm: _stories) + temp.push_back(elm); + return temp; + } + std::vector> StoryboardImpl::GetWriterStories() const + { + return _stories; + } + + int StoryboardImpl::GetStoriesSize() const + { + return static_cast(_stories.size()); + } + + std::shared_ptr StoryboardImpl::GetStoriesAtIndex(unsigned int index) const + { + if (index >= 0 && _stories.size() > index) + { + return _stories[index]; + } + return nullptr; + } + std::shared_ptr StoryboardImpl::GetStopTrigger() const + { + return _stopTrigger; + } + + + void StoryboardImpl::SetInit(std::shared_ptr init) + { + _init = init; + _isSetInit = true; + } + + void StoryboardImpl::SetStories(std::vector>& stories) + { + _stories = stories; + _isSetStories = true; + } + + void StoryboardImpl::SetStopTrigger(std::shared_ptr stopTrigger) + { + _stopTrigger = stopTrigger; + _isSetStopTrigger = true; + } + + std::shared_ptr StoryboardImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StoryboardImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStoryboard).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStoryboardWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StoryboardImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StoryboardImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StoryboardImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StoryboardImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t StoryboardImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StoryboardImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StoryboardImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StoryboardImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StoryboardImpl::GetModelType() const + { + return "Storyboard"; + } + + // children + std::shared_ptr StoryboardImpl::GetWriterInit() const + { + return std::dynamic_pointer_cast(_init); + } + std::shared_ptr StoryboardImpl::GetWriterStopTrigger() const + { + return std::dynamic_pointer_cast(_stopTrigger); + } + + StoryboardImpl::StoryboardImpl() + { + /** + * Filling the property to type map + */ + } + + void StoryboardImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType StoryboardImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StoryboardImpl::GetChildren() const + { + std::vector> result; + + const auto kInit = GetWriterInit(); + if (kInit) + { + result.push_back(std::dynamic_pointer_cast(kInit)); + } + auto stories = GetWriterStories(); + if (!stories.empty()) + { + for(auto&& item : stories) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kStopTrigger = GetWriterStopTrigger(); + if (kStopTrigger) + { + result.push_back(std::dynamic_pointer_cast(kStopTrigger)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StoryboardImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kInit = GetWriterInit(); + if (kInit) + { + auto clonedChild = std::dynamic_pointer_cast(kInit)->Clone(); + auto clonedChildIInit = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetInit(std::dynamic_pointer_cast(clonedChildIInit)); + } + const auto kStories = GetWriterStories(); + if (!kStories.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kStories) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetStories(clonedList); + } + const auto kStopTrigger = GetWriterStopTrigger(); + if (kStopTrigger) + { + auto clonedChild = std::dynamic_pointer_cast(kStopTrigger)->Clone(); + auto clonedChildITrigger = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetStopTrigger(std::dynamic_pointer_cast(clonedChildITrigger)); + } + return clonedObject; + } + + std::string StoryboardImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryboardImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__INIT) + { + return std::dynamic_pointer_cast(GetInit()); + } + + if (key == OSC_CONSTANTS::ELEMENT__STOP_TRIGGER) + { + return std::dynamic_pointer_cast(GetStopTrigger()); + } + throw KeyNotSupportedException(); + } + + std::vector> StoryboardImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__STORY) + { + std::vector> vect; + for (auto&& elem : GetStories()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryboardImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string StoryboardImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool StoryboardImpl::IsSetInit() const + { + return _isSetInit; + } + void StoryboardImpl::ResetStories() + { + _isSetStories = false; + _stories = {}; + + } + bool StoryboardImpl::IsSetStories() const + { + return _isSetStories; + } + void StoryboardImpl::ResetStopTrigger() + { + _isSetStopTrigger = false; + _stopTrigger = {}; + + } + bool StoryboardImpl::IsSetStopTrigger() const + { + return _isSetStopTrigger; + } + + IOpenScenarioFlexElement* StoryboardElementStateConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + StoryboardElementState StoryboardElementStateConditionImpl::GetState() const + { + return _state; + } + std::shared_ptr> StoryboardElementStateConditionImpl::GetStoryboardElementRef() const + { + return _storyboardElementRef; + } + StoryboardElementType StoryboardElementStateConditionImpl::GetStoryboardElementType() const + { + return _storyboardElementType; + } + + + void StoryboardElementStateConditionImpl::SetState(const StoryboardElementState state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + void StoryboardElementStateConditionImpl::SetStoryboardElementRef(std::shared_ptr> storyboardElementRef) + { + _storyboardElementRef = storyboardElementRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF); + _isSetStoryboardElementRef = true; + } + + void StoryboardElementStateConditionImpl::SetStoryboardElementType(const StoryboardElementType storyboardElementType) + { + _storyboardElementType = storyboardElementType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE); + _isSetStoryboardElementType = true; + } + + std::shared_ptr StoryboardElementStateConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(StoryboardElementStateConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IStoryboardElementStateCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IStoryboardElementStateConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr StoryboardElementStateConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t StoryboardElementStateConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int StoryboardElementStateConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double StoryboardElementStateConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t StoryboardElementStateConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool StoryboardElementStateConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime StoryboardElementStateConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr StoryboardElementStateConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string StoryboardElementStateConditionImpl::GetModelType() const + { + return "StoryboardElementStateCondition"; + } + + void StoryboardElementStateConditionImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + void StoryboardElementStateConditionImpl::WriteParameterToStoryboardElementRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, parameterName, nullTextMarker /*no textmarker*/); + _storyboardElementRef = {}; + } + + void StoryboardElementStateConditionImpl::WriteParameterToStoryboardElementType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _storyboardElementType = {}; + } + + std::string StoryboardElementStateConditionImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + std::string StoryboardElementStateConditionImpl::GetParameterFromStoryboardElementRef() const + { + auto storyboardElementRef = OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF; + return GetParameterNameFromAttribute(storyboardElementRef); + } + + std::string StoryboardElementStateConditionImpl::GetParameterFromStoryboardElementType() const + { + auto storyboardElementType = OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE; + return GetParameterNameFromAttribute(storyboardElementType); + } + + bool StoryboardElementStateConditionImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool StoryboardElementStateConditionImpl::IsStoryboardElementRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool StoryboardElementStateConditionImpl::IsStoryboardElementTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + StoryboardElementStateConditionImpl::StoryboardElementStateConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, SimpleType::ENUM_TYPE); + } + + void StoryboardElementStateConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Enumeration Type + const auto kResult = StoryboardElementState::GetFromLiteral(parameterLiteralValue); + if (kResult != StoryboardElementState::UNKNOWN) + { + _state = kResult; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _storyboardElementRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetStoryboardElementRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE) + { + // Enumeration Type + const auto kResult = StoryboardElementType::GetFromLiteral(parameterLiteralValue); + if (kResult != StoryboardElementType::UNKNOWN) + { + _storyboardElementType = kResult; + AddResolvedParameter(attributeKey); + _isSetStoryboardElementType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType StoryboardElementStateConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> StoryboardElementStateConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr StoryboardElementStateConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kState = GetState(); + if ( kState.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_state = StoryboardElementState::GetFromLiteral(kState.GetLiteral()); + } + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetStoryboardElementRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_storyboardElementRef = proxy; + + // Enumeration Type + const auto kStoryboardElementType = GetStoryboardElementType(); + if ( kStoryboardElementType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_storyboardElementType = StoryboardElementType::GetFromLiteral(kStoryboardElementType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string StoryboardElementStateConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF) + { + // Get the Proxy + auto storyboardElementRef = GetStoryboardElementRef(); + return storyboardElementRef!= nullptr ? storyboardElementRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryboardElementStateConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> StoryboardElementStateConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr StoryboardElementStateConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF) + { + // Get the Proxy + auto storyboardElementRef = GetStoryboardElementRef(); + return storyboardElementRef != nullptr ? std::dynamic_pointer_cast(storyboardElementRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string StoryboardElementStateConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + auto state = GetState(); + return state.GetLiteral() != "UNKNOWN" ? state.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE) + { + auto storyboardElementType = GetStoryboardElementType(); + return storyboardElementType.GetLiteral() != "UNKNOWN" ? storyboardElementType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool StoryboardElementStateConditionImpl::IsSetState() const + { + return _isSetState; + } + bool StoryboardElementStateConditionImpl::IsSetStoryboardElementRef() const + { + return _isSetStoryboardElementRef; + } + bool StoryboardElementStateConditionImpl::IsSetStoryboardElementType() const + { + return _isSetStoryboardElementType; + } + + IOpenScenarioFlexElement* SunImpl::GetOpenScenarioFlexElement() + { + return this; + } + double SunImpl::GetAzimuth() const + { + return _azimuth; + } + double SunImpl::GetElevation() const + { + return _elevation; + } + double SunImpl::GetIlluminance() const + { + return _illuminance; + } + double SunImpl::GetIntensity() const + { + return _intensity; + } + + + void SunImpl::SetAzimuth(const double azimuth) + { + _azimuth = azimuth; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + _isSetAzimuth = true; + } + + void SunImpl::SetElevation(const double elevation) + { + _elevation = elevation; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + _isSetElevation = true; + } + + void SunImpl::SetIlluminance(const double illuminance) + { + _illuminance = illuminance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE); + _isSetIlluminance = true; + } + + void SunImpl::SetIntensity(const double intensity) + { + _intensity = intensity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + _isSetIntensity = true; + } + + std::shared_ptr SunImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SunImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISun).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISunWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SunImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SunImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SunImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SunImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH) + { + return GetAzimuth(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ELEVATION) + { + return GetElevation(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE) + { + return GetIlluminance(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + return GetIntensity(); + } + throw KeyNotSupportedException(); + + } + + uint16_t SunImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SunImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SunImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SunImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SunImpl::GetModelType() const + { + return "Sun"; + } + + void SunImpl::WriteParameterToAzimuth(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, parameterName, nullTextMarker /*no textmarker*/); + _azimuth = {}; + } + + void SunImpl::WriteParameterToElevation(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, parameterName, nullTextMarker /*no textmarker*/); + _elevation = {}; + } + + void SunImpl::WriteParameterToIlluminance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, parameterName, nullTextMarker /*no textmarker*/); + _illuminance = {}; + } + + void SunImpl::WriteParameterToIntensity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, parameterName, nullTextMarker /*no textmarker*/); + _intensity = {}; + } + + std::string SunImpl::GetParameterFromAzimuth() const + { + auto azimuth = OSC_CONSTANTS::ATTRIBUTE__AZIMUTH; + return GetParameterNameFromAttribute(azimuth); + } + + std::string SunImpl::GetParameterFromElevation() const + { + auto elevation = OSC_CONSTANTS::ATTRIBUTE__ELEVATION; + return GetParameterNameFromAttribute(elevation); + } + + std::string SunImpl::GetParameterFromIlluminance() const + { + auto illuminance = OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE; + return GetParameterNameFromAttribute(illuminance); + } + + std::string SunImpl::GetParameterFromIntensity() const + { + auto intensity = OSC_CONSTANTS::ATTRIBUTE__INTENSITY; + return GetParameterNameFromAttribute(intensity); + } + + bool SunImpl::IsAzimuthParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__AZIMUTH); + if (kIt != keys.end()) + return true; + return false; + } + + bool SunImpl::IsElevationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ELEVATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool SunImpl::IsIlluminanceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool SunImpl::IsIntensityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__INTENSITY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + SunImpl::SunImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, SimpleType::DOUBLE); + } + + void SunImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH) + { + // Simple type + _azimuth = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAzimuth = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ELEVATION) + { + // Simple type + _elevation = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetElevation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE) + { + // Simple type + _illuminance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetIlluminance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + // Simple type + _intensity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetIntensity = true; + } + } + + SimpleType SunImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SunImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SunImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_azimuth = GetAzimuth(); + // Simple type + clonedObject->_elevation = GetElevation(); + // Simple type + clonedObject->_illuminance = GetIlluminance(); + // Simple type + clonedObject->_intensity = GetIntensity(); + // clone indicators + clonedObject->_isSetIlluminance = _isSetIlluminance; + clonedObject->_isSetIntensity = _isSetIntensity; + // clone children + return clonedObject; + } + + std::string SunImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr SunImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> SunImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SunImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string SunImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void SunImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__AZIMUTH) + { + // Simple type + _azimuth = value; + AddResolvedParameter(attributeKey); + _isSetAzimuth = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ELEVATION) + { + // Simple type + _elevation = value; + AddResolvedParameter(attributeKey); + _isSetElevation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE) + { + // Simple type + _illuminance = value; + AddResolvedParameter(attributeKey); + _isSetIlluminance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INTENSITY) + { + // Simple type + _intensity = value; + AddResolvedParameter(attributeKey); + _isSetIntensity = true; + } + + } + + + bool SunImpl::IsSetAzimuth() const + { + return _isSetAzimuth; + } + bool SunImpl::IsSetElevation() const + { + return _isSetElevation; + } + void SunImpl::ResetIlluminance() + { + _isSetIlluminance = false; + _illuminance = {0}; + + } + bool SunImpl::IsSetIlluminance() const + { + return _isSetIlluminance; + } + void SunImpl::ResetIntensity() + { + _isSetIntensity = false; + _intensity = {}; + + } + bool SunImpl::IsSetIntensity() const + { + return _isSetIntensity; + } + + IOpenScenarioFlexElement* SynchronizeActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> SynchronizeActionImpl::GetMasterEntityRef() const + { + return _masterEntityRef; + } + double SynchronizeActionImpl::GetTargetTolerance() const + { + return _targetTolerance; + } + double SynchronizeActionImpl::GetTargetToleranceMaster() const + { + return _targetToleranceMaster; + } + std::shared_ptr SynchronizeActionImpl::GetTargetPositionMaster() const + { + return _targetPositionMaster; + } + std::shared_ptr SynchronizeActionImpl::GetTargetPosition() const + { + return _targetPosition; + } + std::shared_ptr SynchronizeActionImpl::GetFinalSpeed() const + { + return _finalSpeed; + } + + + void SynchronizeActionImpl::SetMasterEntityRef(std::shared_ptr> masterEntityRef) + { + _masterEntityRef = masterEntityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF); + _isSetMasterEntityRef = true; + } + + void SynchronizeActionImpl::SetTargetTolerance(const double targetTolerance) + { + _targetTolerance = targetTolerance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE); + _isSetTargetTolerance = true; + } + + void SynchronizeActionImpl::SetTargetToleranceMaster(const double targetToleranceMaster) + { + _targetToleranceMaster = targetToleranceMaster; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER); + _isSetTargetToleranceMaster = true; + } + + void SynchronizeActionImpl::SetTargetPositionMaster(std::shared_ptr targetPositionMaster) + { + _targetPositionMaster = targetPositionMaster; + _isSetTargetPositionMaster = true; + } + + void SynchronizeActionImpl::SetTargetPosition(std::shared_ptr targetPosition) + { + _targetPosition = targetPosition; + _isSetTargetPosition = true; + } + + void SynchronizeActionImpl::SetFinalSpeed(std::shared_ptr finalSpeed) + { + _finalSpeed = finalSpeed; + _isSetFinalSpeed = true; + } + + std::shared_ptr SynchronizeActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(SynchronizeActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ISynchronizeAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ISynchronizeActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr SynchronizeActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t SynchronizeActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int SynchronizeActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double SynchronizeActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE) + { + return GetTargetTolerance(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER) + { + return GetTargetToleranceMaster(); + } + throw KeyNotSupportedException(); + + } + + uint16_t SynchronizeActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool SynchronizeActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime SynchronizeActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr SynchronizeActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string SynchronizeActionImpl::GetModelType() const + { + return "SynchronizeAction"; + } + + void SynchronizeActionImpl::WriteParameterToMasterEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _masterEntityRef = {}; + } + + void SynchronizeActionImpl::WriteParameterToTargetTolerance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, parameterName, nullTextMarker /*no textmarker*/); + _targetTolerance = {}; + } + + void SynchronizeActionImpl::WriteParameterToTargetToleranceMaster(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, parameterName, nullTextMarker /*no textmarker*/); + _targetToleranceMaster = {}; + } + + std::string SynchronizeActionImpl::GetParameterFromMasterEntityRef() const + { + auto masterEntityRef = OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF; + return GetParameterNameFromAttribute(masterEntityRef); + } + + std::string SynchronizeActionImpl::GetParameterFromTargetTolerance() const + { + auto targetTolerance = OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE; + return GetParameterNameFromAttribute(targetTolerance); + } + + std::string SynchronizeActionImpl::GetParameterFromTargetToleranceMaster() const + { + auto targetToleranceMaster = OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER; + return GetParameterNameFromAttribute(targetToleranceMaster); + } + + bool SynchronizeActionImpl::IsMasterEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool SynchronizeActionImpl::IsTargetToleranceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE); + if (kIt != keys.end()) + return true; + return false; + } + + bool SynchronizeActionImpl::IsTargetToleranceMasterParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr SynchronizeActionImpl::GetWriterTargetPositionMaster() const + { + return std::dynamic_pointer_cast(_targetPositionMaster); + } + std::shared_ptr SynchronizeActionImpl::GetWriterTargetPosition() const + { + return std::dynamic_pointer_cast(_targetPosition); + } + std::shared_ptr SynchronizeActionImpl::GetWriterFinalSpeed() const + { + return std::dynamic_pointer_cast(_finalSpeed); + } + + SynchronizeActionImpl::SynchronizeActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, SimpleType::DOUBLE); + } + + void SynchronizeActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _masterEntityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetMasterEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE) + { + // Simple type + _targetTolerance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTargetTolerance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER) + { + // Simple type + _targetToleranceMaster = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTargetToleranceMaster = true; + } + } + + SimpleType SynchronizeActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> SynchronizeActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTargetPositionMaster = GetWriterTargetPositionMaster(); + if (kTargetPositionMaster) + { + result.push_back(std::dynamic_pointer_cast(kTargetPositionMaster)); + } + const auto kTargetPosition = GetWriterTargetPosition(); + if (kTargetPosition) + { + result.push_back(std::dynamic_pointer_cast(kTargetPosition)); + } + const auto kFinalSpeed = GetWriterFinalSpeed(); + if (kFinalSpeed) + { + result.push_back(std::dynamic_pointer_cast(kFinalSpeed)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr SynchronizeActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetMasterEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_masterEntityRef = proxy; + + // Simple type + clonedObject->_targetTolerance = GetTargetTolerance(); + // Simple type + clonedObject->_targetToleranceMaster = GetTargetToleranceMaster(); + // clone indicators + clonedObject->_isSetTargetTolerance = _isSetTargetTolerance; + clonedObject->_isSetTargetToleranceMaster = _isSetTargetToleranceMaster; + // clone children + const auto kTargetPositionMaster = GetWriterTargetPositionMaster(); + if (kTargetPositionMaster) + { + auto clonedChild = std::dynamic_pointer_cast(kTargetPositionMaster)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTargetPositionMaster(std::dynamic_pointer_cast(clonedChildIPosition)); + } + const auto kTargetPosition = GetWriterTargetPosition(); + if (kTargetPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kTargetPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTargetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + const auto kFinalSpeed = GetWriterFinalSpeed(); + if (kFinalSpeed) + { + auto clonedChild = std::dynamic_pointer_cast(kFinalSpeed)->Clone(); + auto clonedChildIFinalSpeed = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFinalSpeed(std::dynamic_pointer_cast(clonedChildIFinalSpeed)); + } + return clonedObject; + } + + std::string SynchronizeActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF) + { + // Get the Proxy + auto masterEntityRef = GetMasterEntityRef(); + return masterEntityRef!= nullptr ? masterEntityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr SynchronizeActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TARGET_POSITION_MASTER) + { + return std::dynamic_pointer_cast(GetTargetPositionMaster()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TARGET_POSITION) + { + return std::dynamic_pointer_cast(GetTargetPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__FINAL_SPEED) + { + return std::dynamic_pointer_cast(GetFinalSpeed()); + } + throw KeyNotSupportedException(); + } + + std::vector> SynchronizeActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr SynchronizeActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF) + { + // Get the Proxy + auto masterEntityRef = GetMasterEntityRef(); + return masterEntityRef != nullptr ? std::dynamic_pointer_cast(masterEntityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string SynchronizeActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void SynchronizeActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE) + { + // Simple type + _targetTolerance = value; + AddResolvedParameter(attributeKey); + _isSetTargetTolerance = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER) + { + // Simple type + _targetToleranceMaster = value; + AddResolvedParameter(attributeKey); + _isSetTargetToleranceMaster = true; + } + + } + + + bool SynchronizeActionImpl::IsSetMasterEntityRef() const + { + return _isSetMasterEntityRef; + } + void SynchronizeActionImpl::ResetTargetTolerance() + { + _isSetTargetTolerance = false; + _targetTolerance = {}; + + } + bool SynchronizeActionImpl::IsSetTargetTolerance() const + { + return _isSetTargetTolerance; + } + void SynchronizeActionImpl::ResetTargetToleranceMaster() + { + _isSetTargetToleranceMaster = false; + _targetToleranceMaster = {}; + + } + bool SynchronizeActionImpl::IsSetTargetToleranceMaster() const + { + return _isSetTargetToleranceMaster; + } + bool SynchronizeActionImpl::IsSetTargetPositionMaster() const + { + return _isSetTargetPositionMaster; + } + bool SynchronizeActionImpl::IsSetTargetPosition() const + { + return _isSetTargetPosition; + } + void SynchronizeActionImpl::ResetFinalSpeed() + { + _isSetFinalSpeed = false; + _finalSpeed = {}; + + } + bool SynchronizeActionImpl::IsSetFinalSpeed() const + { + return _isSetFinalSpeed; + } + + IOpenScenarioFlexElement* TargetDistanceSteadyStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TargetDistanceSteadyStateImpl::GetDistance() const + { + return _distance; + } + + + void TargetDistanceSteadyStateImpl::SetDistance(const double distance) + { + _distance = distance; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + _isSetDistance = true; + } + + std::shared_ptr TargetDistanceSteadyStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TargetDistanceSteadyStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITargetDistanceSteadyState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITargetDistanceSteadyStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TargetDistanceSteadyStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TargetDistanceSteadyStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TargetDistanceSteadyStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TargetDistanceSteadyStateImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + return GetDistance(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TargetDistanceSteadyStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TargetDistanceSteadyStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TargetDistanceSteadyStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TargetDistanceSteadyStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TargetDistanceSteadyStateImpl::GetModelType() const + { + return "TargetDistanceSteadyState"; + } + + void TargetDistanceSteadyStateImpl::WriteParameterToDistance(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, parameterName, nullTextMarker /*no textmarker*/); + _distance = {}; + } + + std::string TargetDistanceSteadyStateImpl::GetParameterFromDistance() const + { + auto distance = OSC_CONSTANTS::ATTRIBUTE__DISTANCE; + return GetParameterNameFromAttribute(distance); + } + + bool TargetDistanceSteadyStateImpl::IsDistanceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DISTANCE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TargetDistanceSteadyStateImpl::TargetDistanceSteadyStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, SimpleType::DOUBLE); + } + + void TargetDistanceSteadyStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + } + + SimpleType TargetDistanceSteadyStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TargetDistanceSteadyStateImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TargetDistanceSteadyStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_distance = GetDistance(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TargetDistanceSteadyStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TargetDistanceSteadyStateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TargetDistanceSteadyStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TargetDistanceSteadyStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TargetDistanceSteadyStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TargetDistanceSteadyStateImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DISTANCE) + { + // Simple type + _distance = value; + AddResolvedParameter(attributeKey); + _isSetDistance = true; + } + + } + + + bool TargetDistanceSteadyStateImpl::IsSetDistance() const + { + return _isSetDistance; + } + + IOpenScenarioFlexElement* TargetTimeSteadyStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TargetTimeSteadyStateImpl::GetTime() const + { + return _time; + } + + + void TargetTimeSteadyStateImpl::SetTime(const double time) + { + _time = time; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME); + _isSetTime = true; + } + + std::shared_ptr TargetTimeSteadyStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TargetTimeSteadyStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITargetTimeSteadyState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITargetTimeSteadyStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TargetTimeSteadyStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TargetTimeSteadyStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TargetTimeSteadyStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TargetTimeSteadyStateImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + return GetTime(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TargetTimeSteadyStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TargetTimeSteadyStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TargetTimeSteadyStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TargetTimeSteadyStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TargetTimeSteadyStateImpl::GetModelType() const + { + return "TargetTimeSteadyState"; + } + + void TargetTimeSteadyStateImpl::WriteParameterToTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, parameterName, nullTextMarker /*no textmarker*/); + _time = {}; + } + + std::string TargetTimeSteadyStateImpl::GetParameterFromTime() const + { + auto time = OSC_CONSTANTS::ATTRIBUTE__TIME; + return GetParameterNameFromAttribute(time); + } + + bool TargetTimeSteadyStateImpl::IsTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TargetTimeSteadyStateImpl::TargetTimeSteadyStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME, SimpleType::DOUBLE); + } + + void TargetTimeSteadyStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + } + + SimpleType TargetTimeSteadyStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TargetTimeSteadyStateImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TargetTimeSteadyStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_time = GetTime(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TargetTimeSteadyStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TargetTimeSteadyStateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TargetTimeSteadyStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TargetTimeSteadyStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TargetTimeSteadyStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TargetTimeSteadyStateImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = value; + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + + } + + + bool TargetTimeSteadyStateImpl::IsSetTime() const + { + return _isSetTime; + } + + IOpenScenarioFlexElement* TeleportActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TeleportActionImpl::GetPosition() const + { + return _position; + } + + + void TeleportActionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr TeleportActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TeleportActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITeleportAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITeleportActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TeleportActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TeleportActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TeleportActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TeleportActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TeleportActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TeleportActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TeleportActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TeleportActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TeleportActionImpl::GetModelType() const + { + return "TeleportAction"; + } + + // children + std::shared_ptr TeleportActionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + TeleportActionImpl::TeleportActionImpl() + { + /** + * Filling the property to type map + */ + } + + void TeleportActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TeleportActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TeleportActionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TeleportActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string TeleportActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TeleportActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> TeleportActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TeleportActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TeleportActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TeleportActionImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* TimeHeadwayConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool TimeHeadwayConditionImpl::GetAlongRoute() const + { + return _alongRoute; + } + CoordinateSystem TimeHeadwayConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + std::shared_ptr> TimeHeadwayConditionImpl::GetEntityRef() const + { + return _entityRef; + } + bool TimeHeadwayConditionImpl::GetFreespace() const + { + return _freespace; + } + RelativeDistanceType TimeHeadwayConditionImpl::GetRelativeDistanceType() const + { + return _relativeDistanceType; + } + RoutingAlgorithm TimeHeadwayConditionImpl::GetRoutingAlgorithm() const + { + return _routingAlgorithm; + } + Rule TimeHeadwayConditionImpl::GetRule() const + { + return _rule; + } + double TimeHeadwayConditionImpl::GetValue() const + { + return _value; + } + + + void TimeHeadwayConditionImpl::SetAlongRoute(const bool alongRoute) + { + _alongRoute = alongRoute; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + _isSetAlongRoute = true; + } + + void TimeHeadwayConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void TimeHeadwayConditionImpl::SetEntityRef(std::shared_ptr> entityRef) + { + _entityRef = entityRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + _isSetEntityRef = true; + } + + void TimeHeadwayConditionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void TimeHeadwayConditionImpl::SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) + { + _relativeDistanceType = relativeDistanceType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + _isSetRelativeDistanceType = true; + } + + void TimeHeadwayConditionImpl::SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) + { + _routingAlgorithm = routingAlgorithm; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + _isSetRoutingAlgorithm = true; + } + + void TimeHeadwayConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void TimeHeadwayConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr TimeHeadwayConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeHeadwayConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeHeadwayCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeHeadwayConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeHeadwayConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeHeadwayConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeHeadwayConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeHeadwayConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TimeHeadwayConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeHeadwayConditionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + return GetAlongRoute(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime TimeHeadwayConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeHeadwayConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeHeadwayConditionImpl::GetModelType() const + { + return "TimeHeadwayCondition"; + } + + void TimeHeadwayConditionImpl::WriteParameterToAlongRoute(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, parameterName, nullTextMarker /*no textmarker*/); + _alongRoute = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToEntityRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, parameterName, nullTextMarker /*no textmarker*/); + _entityRef = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToRelativeDistanceType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _relativeDistanceType = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToRoutingAlgorithm(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, parameterName, nullTextMarker /*no textmarker*/); + _routingAlgorithm = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void TimeHeadwayConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string TimeHeadwayConditionImpl::GetParameterFromAlongRoute() const + { + auto alongRoute = OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE; + return GetParameterNameFromAttribute(alongRoute); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromEntityRef() const + { + auto entityRef = OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF; + return GetParameterNameFromAttribute(entityRef); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromRelativeDistanceType() const + { + auto relativeDistanceType = OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE; + return GetParameterNameFromAttribute(relativeDistanceType); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromRoutingAlgorithm() const + { + auto routingAlgorithm = OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM; + return GetParameterNameFromAttribute(routingAlgorithm); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string TimeHeadwayConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool TimeHeadwayConditionImpl::IsAlongRouteParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsEntityRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsRelativeDistanceTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsRoutingAlgorithmParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeHeadwayConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TimeHeadwayConditionImpl::TimeHeadwayConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void TimeHeadwayConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _entityRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetEntityRef = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(parameterLiteralValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + _relativeDistanceType = kResult; + AddResolvedParameter(attributeKey); + _isSetRelativeDistanceType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(parameterLiteralValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + _routingAlgorithm = kResult; + AddResolvedParameter(attributeKey); + _isSetRoutingAlgorithm = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType TimeHeadwayConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeHeadwayConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeHeadwayConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_alongRoute = GetAlongRoute(); + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetEntityRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_entityRef = proxy; + + // Simple type + clonedObject->_freespace = GetFreespace(); + // Enumeration Type + const auto kRelativeDistanceType = GetRelativeDistanceType(); + if ( kRelativeDistanceType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_relativeDistanceType = RelativeDistanceType::GetFromLiteral(kRelativeDistanceType.GetLiteral()); + } + // Enumeration Type + const auto kRoutingAlgorithm = GetRoutingAlgorithm(); + if ( kRoutingAlgorithm.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_routingAlgorithm = RoutingAlgorithm::GetFromLiteral(kRoutingAlgorithm.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetAlongRoute = _isSetAlongRoute; + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetRelativeDistanceType = _isSetRelativeDistanceType; + clonedObject->_isSetRoutingAlgorithm = _isSetRoutingAlgorithm; + // clone children + return clonedObject; + } + + std::string TimeHeadwayConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef!= nullptr ? entityRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeHeadwayConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TimeHeadwayConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeHeadwayConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF) + { + // Get the Proxy + auto entityRef = GetEntityRef(); + return entityRef != nullptr ? std::dynamic_pointer_cast(entityRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string TimeHeadwayConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + auto relativeDistanceType = GetRelativeDistanceType(); + return relativeDistanceType.GetLiteral() != "UNKNOWN" ? relativeDistanceType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + auto routingAlgorithm = GetRoutingAlgorithm(); + return routingAlgorithm.GetLiteral() != "UNKNOWN" ? routingAlgorithm.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void TimeHeadwayConditionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = value; + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void TimeHeadwayConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void TimeHeadwayConditionImpl::ResetAlongRoute() + { + _isSetAlongRoute = false; + _alongRoute = {}; + + } + bool TimeHeadwayConditionImpl::IsSetAlongRoute() const + { + return _isSetAlongRoute; + } + void TimeHeadwayConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool TimeHeadwayConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + bool TimeHeadwayConditionImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + bool TimeHeadwayConditionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + void TimeHeadwayConditionImpl::ResetRelativeDistanceType() + { + _isSetRelativeDistanceType = false; + _relativeDistanceType = {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + + } + bool TimeHeadwayConditionImpl::IsSetRelativeDistanceType() const + { + return _isSetRelativeDistanceType; + } + void TimeHeadwayConditionImpl::ResetRoutingAlgorithm() + { + _isSetRoutingAlgorithm = false; + _routingAlgorithm = {}; + + } + bool TimeHeadwayConditionImpl::IsSetRoutingAlgorithm() const + { + return _isSetRoutingAlgorithm; + } + bool TimeHeadwayConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool TimeHeadwayConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* TimeOfDayImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool TimeOfDayImpl::GetAnimation() const + { + return _animation; + } + DateTime TimeOfDayImpl::GetDateTime() const + { + return _dateTime; + } + + + void TimeOfDayImpl::SetAnimation(const bool animation) + { + _animation = animation; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION); + _isSetAnimation = true; + } + + void TimeOfDayImpl::SetDateTime(const DateTime dateTime) + { + _dateTime = dateTime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME); + _isSetDateTime = true; + } + + std::shared_ptr TimeOfDayImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeOfDayImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeOfDay).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeOfDayWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeOfDayImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeOfDayImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeOfDayImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeOfDayImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TimeOfDayImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeOfDayImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + return GetAnimation(); + } + throw KeyNotSupportedException(); + + } + + DateTime TimeOfDayImpl::GetDateTimeProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + return GetDateTime(); + } + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeOfDayImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeOfDayImpl::GetModelType() const + { + return "TimeOfDay"; + } + + void TimeOfDayImpl::WriteParameterToAnimation(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, parameterName, nullTextMarker /*no textmarker*/); + _animation = {}; + } + + void TimeOfDayImpl::WriteParameterToDateTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, parameterName, nullTextMarker /*no textmarker*/); + _dateTime = {}; + } + + std::string TimeOfDayImpl::GetParameterFromAnimation() const + { + auto animation = OSC_CONSTANTS::ATTRIBUTE__ANIMATION; + return GetParameterNameFromAttribute(animation); + } + + std::string TimeOfDayImpl::GetParameterFromDateTime() const + { + auto dateTime = OSC_CONSTANTS::ATTRIBUTE__DATE_TIME; + return GetParameterNameFromAttribute(dateTime); + } + + bool TimeOfDayImpl::IsAnimationParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ANIMATION); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeOfDayImpl::IsDateTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DATE_TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TimeOfDayImpl::TimeOfDayImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, SimpleType::DATE_TIME); + } + + void TimeOfDayImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + // Simple type + _animation = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAnimation = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + // Simple type + _dateTime = ParserHelper::ParseDateTime(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDateTime = true; + } + } + + SimpleType TimeOfDayImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeOfDayImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeOfDayImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_animation = GetAnimation(); + // Simple type + clonedObject->_dateTime = GetDateTime(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TimeOfDayImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeOfDayImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TimeOfDayImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeOfDayImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimeOfDayImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TimeOfDayImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ANIMATION) + { + // Simple type + _animation = value; + AddResolvedParameter(attributeKey); + _isSetAnimation = true; + } + + } + void TimeOfDayImpl::ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + // Simple type + _dateTime = value; + AddResolvedParameter(attributeKey); + _isSetDateTime = true; + } + + } + + + bool TimeOfDayImpl::IsSetAnimation() const + { + return _isSetAnimation; + } + bool TimeOfDayImpl::IsSetDateTime() const + { + return _isSetDateTime; + } + + IOpenScenarioFlexElement* TimeOfDayConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + DateTime TimeOfDayConditionImpl::GetDateTime() const + { + return _dateTime; + } + Rule TimeOfDayConditionImpl::GetRule() const + { + return _rule; + } + + + void TimeOfDayConditionImpl::SetDateTime(const DateTime dateTime) + { + _dateTime = dateTime; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME); + _isSetDateTime = true; + } + + void TimeOfDayConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + std::shared_ptr TimeOfDayConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeOfDayConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeOfDayCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeOfDayConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeOfDayConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeOfDayConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeOfDayConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeOfDayConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TimeOfDayConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeOfDayConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TimeOfDayConditionImpl::GetDateTimeProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + return GetDateTime(); + } + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeOfDayConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeOfDayConditionImpl::GetModelType() const + { + return "TimeOfDayCondition"; + } + + void TimeOfDayConditionImpl::WriteParameterToDateTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, parameterName, nullTextMarker /*no textmarker*/); + _dateTime = {}; + } + + void TimeOfDayConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + std::string TimeOfDayConditionImpl::GetParameterFromDateTime() const + { + auto dateTime = OSC_CONSTANTS::ATTRIBUTE__DATE_TIME; + return GetParameterNameFromAttribute(dateTime); + } + + std::string TimeOfDayConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + bool TimeOfDayConditionImpl::IsDateTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DATE_TIME); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeOfDayConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TimeOfDayConditionImpl::TimeOfDayConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, SimpleType::DATE_TIME); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + } + + void TimeOfDayConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + // Simple type + _dateTime = ParserHelper::ParseDateTime(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDateTime = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType TimeOfDayConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeOfDayConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeOfDayConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dateTime = GetDateTime(); + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string TimeOfDayConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeOfDayConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TimeOfDayConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeOfDayConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimeOfDayConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void TimeOfDayConditionImpl::ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DATE_TIME) + { + // Simple type + _dateTime = value; + AddResolvedParameter(attributeKey); + _isSetDateTime = true; + } + + } + + + bool TimeOfDayConditionImpl::IsSetDateTime() const + { + return _isSetDateTime; + } + bool TimeOfDayConditionImpl::IsSetRule() const + { + return _isSetRule; + } + + IOpenScenarioFlexElement* TimeReferenceImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TimeReferenceImpl::GetNone() const + { + return _none; + } + std::shared_ptr TimeReferenceImpl::GetTiming() const + { + return _timing; + } + + + void TimeReferenceImpl::SetNone(std::shared_ptr none) + { + _none = none; + _timing = {}; + _isSetNone = true; + } + + void TimeReferenceImpl::SetTiming(std::shared_ptr timing) + { + _timing = timing; + _none = {}; + _isSetTiming = true; + } + + std::shared_ptr TimeReferenceImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeReferenceImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeReference).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeReferenceWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeReferenceImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeReferenceImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeReferenceImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeReferenceImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TimeReferenceImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeReferenceImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TimeReferenceImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeReferenceImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeReferenceImpl::GetModelType() const + { + return "TimeReference"; + } + + // children + std::shared_ptr TimeReferenceImpl::GetWriterNone() const + { + return std::dynamic_pointer_cast(_none); + } + std::shared_ptr TimeReferenceImpl::GetWriterTiming() const + { + return std::dynamic_pointer_cast(_timing); + } + + TimeReferenceImpl::TimeReferenceImpl() + { + /** + * Filling the property to type map + */ + } + + void TimeReferenceImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TimeReferenceImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeReferenceImpl::GetChildren() const + { + std::vector> result; + + const auto kNone = GetWriterNone(); + if (kNone) + { + result.push_back(std::dynamic_pointer_cast(kNone)); + } + const auto kTiming = GetWriterTiming(); + if (kTiming) + { + result.push_back(std::dynamic_pointer_cast(kTiming)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeReferenceImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kNone = GetWriterNone(); + if (kNone) + { + auto clonedChild = std::dynamic_pointer_cast(kNone)->Clone(); + auto clonedChildINone = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetNone(std::dynamic_pointer_cast(clonedChildINone)); + } + const auto kTiming = GetWriterTiming(); + if (kTiming) + { + auto clonedChild = std::dynamic_pointer_cast(kTiming)->Clone(); + auto clonedChildITiming = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTiming(std::dynamic_pointer_cast(clonedChildITiming)); + } + return clonedObject; + } + + std::string TimeReferenceImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeReferenceImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__NONE) + { + return std::dynamic_pointer_cast(GetNone()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIMING) + { + return std::dynamic_pointer_cast(GetTiming()); + } + throw KeyNotSupportedException(); + } + + std::vector> TimeReferenceImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeReferenceImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimeReferenceImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TimeReferenceImpl::IsSetNone() const + { + return _isSetNone; + } + bool TimeReferenceImpl::IsSetTiming() const + { + return _isSetTiming; + } + + IOpenScenarioFlexElement* TimeToCollisionConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool TimeToCollisionConditionImpl::GetAlongRoute() const + { + return _alongRoute; + } + CoordinateSystem TimeToCollisionConditionImpl::GetCoordinateSystem() const + { + return _coordinateSystem; + } + bool TimeToCollisionConditionImpl::GetFreespace() const + { + return _freespace; + } + RelativeDistanceType TimeToCollisionConditionImpl::GetRelativeDistanceType() const + { + return _relativeDistanceType; + } + RoutingAlgorithm TimeToCollisionConditionImpl::GetRoutingAlgorithm() const + { + return _routingAlgorithm; + } + Rule TimeToCollisionConditionImpl::GetRule() const + { + return _rule; + } + double TimeToCollisionConditionImpl::GetValue() const + { + return _value; + } + std::shared_ptr TimeToCollisionConditionImpl::GetTimeToCollisionConditionTarget() const + { + return _timeToCollisionConditionTarget; + } + + + void TimeToCollisionConditionImpl::SetAlongRoute(const bool alongRoute) + { + _alongRoute = alongRoute; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + _isSetAlongRoute = true; + } + + void TimeToCollisionConditionImpl::SetCoordinateSystem(const CoordinateSystem coordinateSystem) + { + _coordinateSystem = coordinateSystem; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + _isSetCoordinateSystem = true; + } + + void TimeToCollisionConditionImpl::SetFreespace(const bool freespace) + { + _freespace = freespace; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + _isSetFreespace = true; + } + + void TimeToCollisionConditionImpl::SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) + { + _relativeDistanceType = relativeDistanceType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + _isSetRelativeDistanceType = true; + } + + void TimeToCollisionConditionImpl::SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) + { + _routingAlgorithm = routingAlgorithm; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + _isSetRoutingAlgorithm = true; + } + + void TimeToCollisionConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void TimeToCollisionConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void TimeToCollisionConditionImpl::SetTimeToCollisionConditionTarget(std::shared_ptr timeToCollisionConditionTarget) + { + _timeToCollisionConditionTarget = timeToCollisionConditionTarget; + _isSetTimeToCollisionConditionTarget = true; + } + + std::shared_ptr TimeToCollisionConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeToCollisionConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeToCollisionCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeToCollisionConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeToCollisionConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeToCollisionConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeToCollisionConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeToCollisionConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TimeToCollisionConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeToCollisionConditionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + return GetAlongRoute(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + return GetFreespace(); + } + throw KeyNotSupportedException(); + + } + + DateTime TimeToCollisionConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeToCollisionConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeToCollisionConditionImpl::GetModelType() const + { + return "TimeToCollisionCondition"; + } + + void TimeToCollisionConditionImpl::WriteParameterToAlongRoute(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, parameterName, nullTextMarker /*no textmarker*/); + _alongRoute = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToCoordinateSystem(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, parameterName, nullTextMarker /*no textmarker*/); + _coordinateSystem = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToFreespace(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, parameterName, nullTextMarker /*no textmarker*/); + _freespace = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToRelativeDistanceType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _relativeDistanceType = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToRoutingAlgorithm(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, parameterName, nullTextMarker /*no textmarker*/); + _routingAlgorithm = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void TimeToCollisionConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string TimeToCollisionConditionImpl::GetParameterFromAlongRoute() const + { + auto alongRoute = OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE; + return GetParameterNameFromAttribute(alongRoute); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromCoordinateSystem() const + { + auto coordinateSystem = OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM; + return GetParameterNameFromAttribute(coordinateSystem); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromFreespace() const + { + auto freespace = OSC_CONSTANTS::ATTRIBUTE__FREESPACE; + return GetParameterNameFromAttribute(freespace); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromRelativeDistanceType() const + { + auto relativeDistanceType = OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE; + return GetParameterNameFromAttribute(relativeDistanceType); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromRoutingAlgorithm() const + { + auto routingAlgorithm = OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM; + return GetParameterNameFromAttribute(routingAlgorithm); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string TimeToCollisionConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool TimeToCollisionConditionImpl::IsAlongRouteParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsCoordinateSystemParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsFreespaceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FREESPACE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsRelativeDistanceTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsRoutingAlgorithmParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimeToCollisionConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TimeToCollisionConditionImpl::GetWriterTimeToCollisionConditionTarget() const + { + return std::dynamic_pointer_cast(_timeToCollisionConditionTarget); + } + + TimeToCollisionConditionImpl::TimeToCollisionConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void TimeToCollisionConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(parameterLiteralValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + _coordinateSystem = kResult; + AddResolvedParameter(attributeKey); + _isSetCoordinateSystem = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(parameterLiteralValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + _relativeDistanceType = kResult; + AddResolvedParameter(attributeKey); + _isSetRelativeDistanceType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(parameterLiteralValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + _routingAlgorithm = kResult; + AddResolvedParameter(attributeKey); + _isSetRoutingAlgorithm = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType TimeToCollisionConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeToCollisionConditionImpl::GetChildren() const + { + std::vector> result; + + const auto kTimeToCollisionConditionTarget = GetWriterTimeToCollisionConditionTarget(); + if (kTimeToCollisionConditionTarget) + { + result.push_back(std::dynamic_pointer_cast(kTimeToCollisionConditionTarget)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeToCollisionConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_alongRoute = GetAlongRoute(); + // Enumeration Type + const auto kCoordinateSystem = GetCoordinateSystem(); + if ( kCoordinateSystem.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_coordinateSystem = CoordinateSystem::GetFromLiteral(kCoordinateSystem.GetLiteral()); + } + // Simple type + clonedObject->_freespace = GetFreespace(); + // Enumeration Type + const auto kRelativeDistanceType = GetRelativeDistanceType(); + if ( kRelativeDistanceType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_relativeDistanceType = RelativeDistanceType::GetFromLiteral(kRelativeDistanceType.GetLiteral()); + } + // Enumeration Type + const auto kRoutingAlgorithm = GetRoutingAlgorithm(); + if ( kRoutingAlgorithm.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_routingAlgorithm = RoutingAlgorithm::GetFromLiteral(kRoutingAlgorithm.GetLiteral()); + } + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetAlongRoute = _isSetAlongRoute; + clonedObject->_isSetCoordinateSystem = _isSetCoordinateSystem; + clonedObject->_isSetRelativeDistanceType = _isSetRelativeDistanceType; + clonedObject->_isSetRoutingAlgorithm = _isSetRoutingAlgorithm; + // clone children + const auto kTimeToCollisionConditionTarget = GetWriterTimeToCollisionConditionTarget(); + if (kTimeToCollisionConditionTarget) + { + auto clonedChild = std::dynamic_pointer_cast(kTimeToCollisionConditionTarget)->Clone(); + auto clonedChildITimeToCollisionConditionTarget = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTimeToCollisionConditionTarget(std::dynamic_pointer_cast(clonedChildITimeToCollisionConditionTarget)); + } + return clonedObject; + } + + std::string TimeToCollisionConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeToCollisionConditionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET) + { + return std::dynamic_pointer_cast(GetTimeToCollisionConditionTarget()); + } + throw KeyNotSupportedException(); + } + + std::vector> TimeToCollisionConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeToCollisionConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimeToCollisionConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM) + { + auto coordinateSystem = GetCoordinateSystem(); + return coordinateSystem.GetLiteral() != "UNKNOWN" ? coordinateSystem.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE) + { + auto relativeDistanceType = GetRelativeDistanceType(); + return relativeDistanceType.GetLiteral() != "UNKNOWN" ? relativeDistanceType.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM) + { + auto routingAlgorithm = GetRoutingAlgorithm(); + return routingAlgorithm.GetLiteral() != "UNKNOWN" ? routingAlgorithm.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void TimeToCollisionConditionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE) + { + // Simple type + _alongRoute = value; + AddResolvedParameter(attributeKey); + _isSetAlongRoute = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FREESPACE) + { + // Simple type + _freespace = value; + AddResolvedParameter(attributeKey); + _isSetFreespace = true; + } + + } + void TimeToCollisionConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + void TimeToCollisionConditionImpl::ResetAlongRoute() + { + _isSetAlongRoute = false; + _alongRoute = {}; + + } + bool TimeToCollisionConditionImpl::IsSetAlongRoute() const + { + return _isSetAlongRoute; + } + void TimeToCollisionConditionImpl::ResetCoordinateSystem() + { + _isSetCoordinateSystem = false; + _coordinateSystem = {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + + } + bool TimeToCollisionConditionImpl::IsSetCoordinateSystem() const + { + return _isSetCoordinateSystem; + } + bool TimeToCollisionConditionImpl::IsSetFreespace() const + { + return _isSetFreespace; + } + void TimeToCollisionConditionImpl::ResetRelativeDistanceType() + { + _isSetRelativeDistanceType = false; + _relativeDistanceType = {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + + } + bool TimeToCollisionConditionImpl::IsSetRelativeDistanceType() const + { + return _isSetRelativeDistanceType; + } + void TimeToCollisionConditionImpl::ResetRoutingAlgorithm() + { + _isSetRoutingAlgorithm = false; + _routingAlgorithm = {}; + + } + bool TimeToCollisionConditionImpl::IsSetRoutingAlgorithm() const + { + return _isSetRoutingAlgorithm; + } + bool TimeToCollisionConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool TimeToCollisionConditionImpl::IsSetValue() const + { + return _isSetValue; + } + bool TimeToCollisionConditionImpl::IsSetTimeToCollisionConditionTarget() const + { + return _isSetTimeToCollisionConditionTarget; + } + + IOpenScenarioFlexElement* TimeToCollisionConditionTargetImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TimeToCollisionConditionTargetImpl::GetPosition() const + { + return _position; + } + std::shared_ptr TimeToCollisionConditionTargetImpl::GetEntityRef() const + { + return _entityRef; + } + + + void TimeToCollisionConditionTargetImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _entityRef = {}; + _isSetPosition = true; + } + + void TimeToCollisionConditionTargetImpl::SetEntityRef(std::shared_ptr entityRef) + { + _entityRef = entityRef; + _position = {}; + _isSetEntityRef = true; + } + + std::shared_ptr TimeToCollisionConditionTargetImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimeToCollisionConditionTargetImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITimeToCollisionConditionTarget).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimeToCollisionConditionTargetWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimeToCollisionConditionTargetImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimeToCollisionConditionTargetImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimeToCollisionConditionTargetImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimeToCollisionConditionTargetImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TimeToCollisionConditionTargetImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimeToCollisionConditionTargetImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TimeToCollisionConditionTargetImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimeToCollisionConditionTargetImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimeToCollisionConditionTargetImpl::GetModelType() const + { + return "TimeToCollisionConditionTarget"; + } + + // children + std::shared_ptr TimeToCollisionConditionTargetImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + std::shared_ptr TimeToCollisionConditionTargetImpl::GetWriterEntityRef() const + { + return std::dynamic_pointer_cast(_entityRef); + } + + TimeToCollisionConditionTargetImpl::TimeToCollisionConditionTargetImpl() + { + /** + * Filling the property to type map + */ + } + + void TimeToCollisionConditionTargetImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TimeToCollisionConditionTargetImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimeToCollisionConditionTargetImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + const auto kEntityRef = GetWriterEntityRef(); + if (kEntityRef) + { + result.push_back(std::dynamic_pointer_cast(kEntityRef)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimeToCollisionConditionTargetImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + const auto kEntityRef = GetWriterEntityRef(); + if (kEntityRef) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityRef)->Clone(); + auto clonedChildIEntityRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityRef(std::dynamic_pointer_cast(clonedChildIEntityRef)); + } + return clonedObject; + } + + std::string TimeToCollisionConditionTargetImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeToCollisionConditionTargetImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + return std::dynamic_pointer_cast(GetEntityRef()); + } + throw KeyNotSupportedException(); + } + + std::vector> TimeToCollisionConditionTargetImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimeToCollisionConditionTargetImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimeToCollisionConditionTargetImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TimeToCollisionConditionTargetImpl::IsSetPosition() const + { + return _isSetPosition; + } + bool TimeToCollisionConditionTargetImpl::IsSetEntityRef() const + { + return _isSetEntityRef; + } + + IOpenScenarioFlexElement* TimingImpl::GetOpenScenarioFlexElement() + { + return this; + } + ReferenceContext TimingImpl::GetDomainAbsoluteRelative() const + { + return _domainAbsoluteRelative; + } + double TimingImpl::GetOffset() const + { + return _offset; + } + double TimingImpl::GetScale() const + { + return _scale; + } + + + void TimingImpl::SetDomainAbsoluteRelative(const ReferenceContext domainAbsoluteRelative) + { + _domainAbsoluteRelative = domainAbsoluteRelative; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE); + _isSetDomainAbsoluteRelative = true; + } + + void TimingImpl::SetOffset(const double offset) + { + _offset = offset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET); + _isSetOffset = true; + } + + void TimingImpl::SetScale(const double scale) + { + _scale = scale; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SCALE); + _isSetScale = true; + } + + std::shared_ptr TimingImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TimingImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITiming).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITimingWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TimingImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TimingImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TimingImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TimingImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + return GetOffset(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SCALE) + { + return GetScale(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TimingImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TimingImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TimingImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TimingImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TimingImpl::GetModelType() const + { + return "Timing"; + } + + void TimingImpl::WriteParameterToDomainAbsoluteRelative(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, parameterName, nullTextMarker /*no textmarker*/); + _domainAbsoluteRelative = {}; + } + + void TimingImpl::WriteParameterToOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _offset = {}; + } + + void TimingImpl::WriteParameterToScale(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SCALE, parameterName, nullTextMarker /*no textmarker*/); + _scale = {}; + } + + std::string TimingImpl::GetParameterFromDomainAbsoluteRelative() const + { + auto domainAbsoluteRelative = OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE; + return GetParameterNameFromAttribute(domainAbsoluteRelative); + } + + std::string TimingImpl::GetParameterFromOffset() const + { + auto offset = OSC_CONSTANTS::ATTRIBUTE__OFFSET; + return GetParameterNameFromAttribute(offset); + } + + std::string TimingImpl::GetParameterFromScale() const + { + auto scale = OSC_CONSTANTS::ATTRIBUTE__SCALE; + return GetParameterNameFromAttribute(scale); + } + + bool TimingImpl::IsDomainAbsoluteRelativeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimingImpl::IsOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + bool TimingImpl::IsScaleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SCALE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TimingImpl::TimingImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OFFSET, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SCALE, SimpleType::DOUBLE); + } + + void TimingImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE) + { + // Enumeration Type + const auto kResult = ReferenceContext::GetFromLiteral(parameterLiteralValue); + if (kResult != ReferenceContext::UNKNOWN) + { + _domainAbsoluteRelative = kResult; + AddResolvedParameter(attributeKey); + _isSetDomainAbsoluteRelative = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SCALE) + { + // Simple type + _scale = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetScale = true; + } + } + + SimpleType TimingImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TimingImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TimingImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDomainAbsoluteRelative = GetDomainAbsoluteRelative(); + if ( kDomainAbsoluteRelative.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_domainAbsoluteRelative = ReferenceContext::GetFromLiteral(kDomainAbsoluteRelative.GetLiteral()); + } + // Simple type + clonedObject->_offset = GetOffset(); + // Simple type + clonedObject->_scale = GetScale(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TimingImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TimingImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TimingImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TimingImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TimingImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE) + { + auto domainAbsoluteRelative = GetDomainAbsoluteRelative(); + return domainAbsoluteRelative.GetLiteral() != "UNKNOWN" ? domainAbsoluteRelative.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void TimingImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = value; + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SCALE) + { + // Simple type + _scale = value; + AddResolvedParameter(attributeKey); + _isSetScale = true; + } + + } + + + bool TimingImpl::IsSetDomainAbsoluteRelative() const + { + return _isSetDomainAbsoluteRelative; + } + bool TimingImpl::IsSetOffset() const + { + return _isSetOffset; + } + bool TimingImpl::IsSetScale() const + { + return _isSetScale; + } + + IOpenScenarioFlexElement* TrafficActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficActionImpl::GetTrafficName() const + { + return _trafficName; + } + std::shared_ptr TrafficActionImpl::GetTrafficSourceAction() const + { + return _trafficSourceAction; + } + std::shared_ptr TrafficActionImpl::GetTrafficSinkAction() const + { + return _trafficSinkAction; + } + std::shared_ptr TrafficActionImpl::GetTrafficSwarmAction() const + { + return _trafficSwarmAction; + } + std::shared_ptr TrafficActionImpl::GetTrafficAreaAction() const + { + return _trafficAreaAction; + } + std::shared_ptr TrafficActionImpl::GetTrafficStopAction() const + { + return _trafficStopAction; + } + + + void TrafficActionImpl::SetTrafficName(const std::string trafficName) + { + _trafficName = trafficName; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME); + _isSetTrafficName = true; + } + + void TrafficActionImpl::SetTrafficSourceAction(std::shared_ptr trafficSourceAction) + { + _trafficSourceAction = trafficSourceAction; + _trafficSinkAction = {}; + _trafficSwarmAction = {}; + _trafficAreaAction = {}; + _trafficStopAction = {}; + _isSetTrafficSourceAction = true; + } + + void TrafficActionImpl::SetTrafficSinkAction(std::shared_ptr trafficSinkAction) + { + _trafficSinkAction = trafficSinkAction; + _trafficSourceAction = {}; + _trafficSwarmAction = {}; + _trafficAreaAction = {}; + _trafficStopAction = {}; + _isSetTrafficSinkAction = true; + } + + void TrafficActionImpl::SetTrafficSwarmAction(std::shared_ptr trafficSwarmAction) + { + _trafficSwarmAction = trafficSwarmAction; + _trafficSourceAction = {}; + _trafficSinkAction = {}; + _trafficAreaAction = {}; + _trafficStopAction = {}; + _isSetTrafficSwarmAction = true; + } + + void TrafficActionImpl::SetTrafficAreaAction(std::shared_ptr trafficAreaAction) + { + _trafficAreaAction = trafficAreaAction; + _trafficSourceAction = {}; + _trafficSinkAction = {}; + _trafficSwarmAction = {}; + _trafficStopAction = {}; + _isSetTrafficAreaAction = true; + } + + void TrafficActionImpl::SetTrafficStopAction(std::shared_ptr trafficStopAction) + { + _trafficStopAction = trafficStopAction; + _trafficSourceAction = {}; + _trafficSinkAction = {}; + _trafficSwarmAction = {}; + _trafficAreaAction = {}; + _isSetTrafficStopAction = true; + } + + std::shared_ptr TrafficActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficActionImpl::GetModelType() const + { + return "TrafficAction"; + } + + void TrafficActionImpl::WriteParameterToTrafficName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, parameterName, nullTextMarker /*no textmarker*/); + _trafficName = {}; + } + + std::string TrafficActionImpl::GetParameterFromTrafficName() const + { + auto trafficName = OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME; + return GetParameterNameFromAttribute(trafficName); + } + + bool TrafficActionImpl::IsTrafficNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficActionImpl::GetWriterTrafficSourceAction() const + { + return std::dynamic_pointer_cast(_trafficSourceAction); + } + std::shared_ptr TrafficActionImpl::GetWriterTrafficSinkAction() const + { + return std::dynamic_pointer_cast(_trafficSinkAction); + } + std::shared_ptr TrafficActionImpl::GetWriterTrafficSwarmAction() const + { + return std::dynamic_pointer_cast(_trafficSwarmAction); + } + std::shared_ptr TrafficActionImpl::GetWriterTrafficAreaAction() const + { + return std::dynamic_pointer_cast(_trafficAreaAction); + } + std::shared_ptr TrafficActionImpl::GetWriterTrafficStopAction() const + { + return std::dynamic_pointer_cast(_trafficStopAction); + } + + TrafficActionImpl::TrafficActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, SimpleType::STRING); + } + + void TrafficActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME) + { + // Simple type + _trafficName = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTrafficName = true; + } + } + + SimpleType TrafficActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTrafficSourceAction = GetWriterTrafficSourceAction(); + if (kTrafficSourceAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSourceAction)); + } + const auto kTrafficSinkAction = GetWriterTrafficSinkAction(); + if (kTrafficSinkAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSinkAction)); + } + const auto kTrafficSwarmAction = GetWriterTrafficSwarmAction(); + if (kTrafficSwarmAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSwarmAction)); + } + const auto kTrafficAreaAction = GetWriterTrafficAreaAction(); + if (kTrafficAreaAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficAreaAction)); + } + const auto kTrafficStopAction = GetWriterTrafficStopAction(); + if (kTrafficStopAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficStopAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_trafficName = GetTrafficName(); + // clone indicators + clonedObject->_isSetTrafficName = _isSetTrafficName; + // clone children + const auto kTrafficSourceAction = GetWriterTrafficSourceAction(); + if (kTrafficSourceAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSourceAction)->Clone(); + auto clonedChildITrafficSourceAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSourceAction(std::dynamic_pointer_cast(clonedChildITrafficSourceAction)); + } + const auto kTrafficSinkAction = GetWriterTrafficSinkAction(); + if (kTrafficSinkAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSinkAction)->Clone(); + auto clonedChildITrafficSinkAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSinkAction(std::dynamic_pointer_cast(clonedChildITrafficSinkAction)); + } + const auto kTrafficSwarmAction = GetWriterTrafficSwarmAction(); + if (kTrafficSwarmAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSwarmAction)->Clone(); + auto clonedChildITrafficSwarmAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSwarmAction(std::dynamic_pointer_cast(clonedChildITrafficSwarmAction)); + } + const auto kTrafficAreaAction = GetWriterTrafficAreaAction(); + if (kTrafficAreaAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficAreaAction)->Clone(); + auto clonedChildITrafficAreaAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficAreaAction(std::dynamic_pointer_cast(clonedChildITrafficAreaAction)); + } + const auto kTrafficStopAction = GetWriterTrafficStopAction(); + if (kTrafficStopAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficStopAction)->Clone(); + auto clonedChildITrafficStopAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficStopAction(std::dynamic_pointer_cast(clonedChildITrafficStopAction)); + } + return clonedObject; + } + + std::string TrafficActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME) + { + return GetTrafficName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSourceAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSinkAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSwarmAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficAreaAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficStopAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME) + { + // Simple type + _trafficName = value; + AddResolvedParameter(attributeKey); + _isSetTrafficName = true; + } + + } + + + void TrafficActionImpl::ResetTrafficName() + { + _isSetTrafficName = false; + _trafficName = {}; + + } + bool TrafficActionImpl::IsSetTrafficName() const + { + return _isSetTrafficName; + } + bool TrafficActionImpl::IsSetTrafficSourceAction() const + { + return _isSetTrafficSourceAction; + } + bool TrafficActionImpl::IsSetTrafficSinkAction() const + { + return _isSetTrafficSinkAction; + } + bool TrafficActionImpl::IsSetTrafficSwarmAction() const + { + return _isSetTrafficSwarmAction; + } + bool TrafficActionImpl::IsSetTrafficAreaAction() const + { + return _isSetTrafficAreaAction; + } + bool TrafficActionImpl::IsSetTrafficStopAction() const + { + return _isSetTrafficStopAction; + } + + IOpenScenarioFlexElement* TrafficAreaImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrafficAreaImpl::GetPolygon() const + { + return _polygon; + } + std::vector> TrafficAreaImpl::GetRoadRange() const + { + std::vector> temp; + for(auto&& elm: _roadRange) + temp.push_back(elm); + return temp; + } + std::vector> TrafficAreaImpl::GetWriterRoadRange() const + { + return _roadRange; + } + + int TrafficAreaImpl::GetRoadRangeSize() const + { + return static_cast(_roadRange.size()); + } + + std::shared_ptr TrafficAreaImpl::GetRoadRangeAtIndex(unsigned int index) const + { + if (index >= 0 && _roadRange.size() > index) + { + return _roadRange[index]; + } + return nullptr; + } + + + void TrafficAreaImpl::SetPolygon(std::shared_ptr polygon) + { + _polygon = polygon; + _roadRange = {}; + _isSetPolygon = true; + } + + void TrafficAreaImpl::SetRoadRange(std::vector>& roadRange) + { + _roadRange = roadRange; + _polygon = {}; + _isSetRoadRange = true; + } + + std::shared_ptr TrafficAreaImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficAreaImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficArea).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficAreaWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficAreaImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficAreaImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficAreaImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficAreaImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficAreaImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficAreaImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficAreaImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficAreaImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficAreaImpl::GetModelType() const + { + return "TrafficArea"; + } + + // children + std::shared_ptr TrafficAreaImpl::GetWriterPolygon() const + { + return std::dynamic_pointer_cast(_polygon); + } + + TrafficAreaImpl::TrafficAreaImpl() + { + /** + * Filling the property to type map + */ + } + + void TrafficAreaImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrafficAreaImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficAreaImpl::GetChildren() const + { + std::vector> result; + + const auto kPolygon = GetWriterPolygon(); + if (kPolygon) + { + result.push_back(std::dynamic_pointer_cast(kPolygon)); + } + auto roadRange = GetWriterRoadRange(); + if (!roadRange.empty()) + { + for(auto&& item : roadRange) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficAreaImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPolygon = GetWriterPolygon(); + if (kPolygon) + { + auto clonedChild = std::dynamic_pointer_cast(kPolygon)->Clone(); + auto clonedChildIPolygon = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPolygon(std::dynamic_pointer_cast(clonedChildIPolygon)); + } + const auto kRoadRange = GetWriterRoadRange(); + if (!kRoadRange.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kRoadRange) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetRoadRange(clonedList); + } + return clonedObject; + } + + std::string TrafficAreaImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficAreaImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POLYGON) + { + return std::dynamic_pointer_cast(GetPolygon()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficAreaImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ROAD_RANGE) + { + std::vector> vect; + for (auto&& elem : GetRoadRange()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficAreaImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficAreaImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrafficAreaImpl::IsSetPolygon() const + { + return _isSetPolygon; + } + bool TrafficAreaImpl::IsSetRoadRange() const + { + return _isSetRoadRange; + } + + IOpenScenarioFlexElement* TrafficAreaActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool TrafficAreaActionImpl::GetContinuous() const + { + return _continuous; + } + uint32_t TrafficAreaActionImpl::GetNumberOfEntities() const + { + return _numberOfEntities; + } + std::shared_ptr TrafficAreaActionImpl::GetTrafficDistribution() const + { + return _trafficDistribution; + } + std::shared_ptr TrafficAreaActionImpl::GetTrafficArea() const + { + return _trafficArea; + } + + + void TrafficAreaActionImpl::SetContinuous(const bool continuous) + { + _continuous = continuous; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + _isSetContinuous = true; + } + + void TrafficAreaActionImpl::SetNumberOfEntities(const uint32_t numberOfEntities) + { + _numberOfEntities = numberOfEntities; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES); + _isSetNumberOfEntities = true; + } + + void TrafficAreaActionImpl::SetTrafficDistribution(std::shared_ptr trafficDistribution) + { + _trafficDistribution = trafficDistribution; + _isSetTrafficDistribution = true; + } + + void TrafficAreaActionImpl::SetTrafficArea(std::shared_ptr trafficArea) + { + _trafficArea = trafficArea; + _isSetTrafficArea = true; + } + + std::shared_ptr TrafficAreaActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficAreaActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficAreaAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficAreaActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficAreaActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficAreaActionImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES) + { + return GetNumberOfEntities(); + } + throw KeyNotSupportedException(); + + } + + int TrafficAreaActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficAreaActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficAreaActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficAreaActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + return GetContinuous(); + } + throw KeyNotSupportedException(); + + } + + DateTime TrafficAreaActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficAreaActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficAreaActionImpl::GetModelType() const + { + return "TrafficAreaAction"; + } + + void TrafficAreaActionImpl::WriteParameterToContinuous(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, parameterName, nullTextMarker /*no textmarker*/); + _continuous = {}; + } + + void TrafficAreaActionImpl::WriteParameterToNumberOfEntities(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, parameterName, nullTextMarker /*no textmarker*/); + _numberOfEntities = {}; + } + + std::string TrafficAreaActionImpl::GetParameterFromContinuous() const + { + auto continuous = OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS; + return GetParameterNameFromAttribute(continuous); + } + + std::string TrafficAreaActionImpl::GetParameterFromNumberOfEntities() const + { + auto numberOfEntities = OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES; + return GetParameterNameFromAttribute(numberOfEntities); + } + + bool TrafficAreaActionImpl::IsContinuousParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficAreaActionImpl::IsNumberOfEntitiesParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficAreaActionImpl::GetWriterTrafficDistribution() const + { + return std::dynamic_pointer_cast(_trafficDistribution); + } + std::shared_ptr TrafficAreaActionImpl::GetWriterTrafficArea() const + { + return std::dynamic_pointer_cast(_trafficArea); + } + + TrafficAreaActionImpl::TrafficAreaActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, SimpleType::UNSIGNED_INT); + } + + void TrafficAreaActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES) + { + // Simple type + _numberOfEntities = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetNumberOfEntities = true; + } + } + + SimpleType TrafficAreaActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficAreaActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDistribution)); + } + const auto kTrafficArea = GetWriterTrafficArea(); + if (kTrafficArea) + { + result.push_back(std::dynamic_pointer_cast(kTrafficArea)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficAreaActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_continuous = GetContinuous(); + // Simple type + clonedObject->_numberOfEntities = GetNumberOfEntities(); + // clone indicators + // clone children + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDistribution)->Clone(); + auto clonedChildITrafficDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDistribution(std::dynamic_pointer_cast(clonedChildITrafficDistribution)); + } + const auto kTrafficArea = GetWriterTrafficArea(); + if (kTrafficArea) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficArea)->Clone(); + auto clonedChildITrafficArea = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficArea(std::dynamic_pointer_cast(clonedChildITrafficArea)); + } + return clonedObject; + } + + std::string TrafficAreaActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficAreaActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetTrafficDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA) + { + return std::dynamic_pointer_cast(GetTrafficArea()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficAreaActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficAreaActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficAreaActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficAreaActionImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES) + { + // Simple type + _numberOfEntities = value; + AddResolvedParameter(attributeKey); + _isSetNumberOfEntities = true; + } + + } + void TrafficAreaActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS) + { + // Simple type + _continuous = value; + AddResolvedParameter(attributeKey); + _isSetContinuous = true; + } + + } + + + bool TrafficAreaActionImpl::IsSetContinuous() const + { + return _isSetContinuous; + } + bool TrafficAreaActionImpl::IsSetNumberOfEntities() const + { + return _isSetNumberOfEntities; + } + bool TrafficAreaActionImpl::IsSetTrafficDistribution() const + { + return _isSetTrafficDistribution; + } + bool TrafficAreaActionImpl::IsSetTrafficArea() const + { + return _isSetTrafficArea; + } + + IOpenScenarioFlexElement* TrafficDefinitionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficDefinitionImpl::GetName() const + { + return _name; + } + std::shared_ptr TrafficDefinitionImpl::GetVehicleCategoryDistribution() const + { + return _vehicleCategoryDistribution; + } + std::shared_ptr TrafficDefinitionImpl::GetVehicleRoleDistribution() const + { + return _vehicleRoleDistribution; + } + std::shared_ptr TrafficDefinitionImpl::GetControllerDistribution() const + { + return _controllerDistribution; + } + + + void TrafficDefinitionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void TrafficDefinitionImpl::SetVehicleCategoryDistribution(std::shared_ptr vehicleCategoryDistribution) + { + _vehicleCategoryDistribution = vehicleCategoryDistribution; + _isSetVehicleCategoryDistribution = true; + } + + void TrafficDefinitionImpl::SetVehicleRoleDistribution(std::shared_ptr vehicleRoleDistribution) + { + _vehicleRoleDistribution = vehicleRoleDistribution; + _isSetVehicleRoleDistribution = true; + } + + void TrafficDefinitionImpl::SetControllerDistribution(std::shared_ptr controllerDistribution) + { + _controllerDistribution = controllerDistribution; + _isSetControllerDistribution = true; + } + + std::shared_ptr TrafficDefinitionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficDefinitionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficDefinition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficDefinitionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficDefinitionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficDefinitionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficDefinitionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficDefinitionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficDefinitionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficDefinitionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficDefinitionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficDefinitionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficDefinitionImpl::GetModelType() const + { + return "TrafficDefinition"; + } + + void TrafficDefinitionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string TrafficDefinitionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool TrafficDefinitionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficDefinitionImpl::GetWriterVehicleCategoryDistribution() const + { + return std::dynamic_pointer_cast(_vehicleCategoryDistribution); + } + std::shared_ptr TrafficDefinitionImpl::GetWriterVehicleRoleDistribution() const + { + return std::dynamic_pointer_cast(_vehicleRoleDistribution); + } + std::shared_ptr TrafficDefinitionImpl::GetWriterControllerDistribution() const + { + return std::dynamic_pointer_cast(_controllerDistribution); + } + + TrafficDefinitionImpl::TrafficDefinitionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void TrafficDefinitionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType TrafficDefinitionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficDefinitionImpl::GetChildren() const + { + std::vector> result; + + const auto kVehicleCategoryDistribution = GetWriterVehicleCategoryDistribution(); + if (kVehicleCategoryDistribution) + { + result.push_back(std::dynamic_pointer_cast(kVehicleCategoryDistribution)); + } + const auto kVehicleRoleDistribution = GetWriterVehicleRoleDistribution(); + if (kVehicleRoleDistribution) + { + result.push_back(std::dynamic_pointer_cast(kVehicleRoleDistribution)); + } + const auto kControllerDistribution = GetWriterControllerDistribution(); + if (kControllerDistribution) + { + result.push_back(std::dynamic_pointer_cast(kControllerDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficDefinitionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kVehicleCategoryDistribution = GetWriterVehicleCategoryDistribution(); + if (kVehicleCategoryDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicleCategoryDistribution)->Clone(); + auto clonedChildIVehicleCategoryDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicleCategoryDistribution(std::dynamic_pointer_cast(clonedChildIVehicleCategoryDistribution)); + } + const auto kVehicleRoleDistribution = GetWriterVehicleRoleDistribution(); + if (kVehicleRoleDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kVehicleRoleDistribution)->Clone(); + auto clonedChildIVehicleRoleDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetVehicleRoleDistribution(std::dynamic_pointer_cast(clonedChildIVehicleRoleDistribution)); + } + const auto kControllerDistribution = GetWriterControllerDistribution(); + if (kControllerDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kControllerDistribution)->Clone(); + auto clonedChildIControllerDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetControllerDistribution(std::dynamic_pointer_cast(clonedChildIControllerDistribution)); + } + return clonedObject; + } + + std::string TrafficDefinitionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDefinitionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetVehicleCategoryDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetVehicleRoleDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetControllerDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficDefinitionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDefinitionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficDefinitionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficDefinitionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool TrafficDefinitionImpl::IsSetName() const + { + return _isSetName; + } + bool TrafficDefinitionImpl::IsSetVehicleCategoryDistribution() const + { + return _isSetVehicleCategoryDistribution; + } + void TrafficDefinitionImpl::ResetVehicleRoleDistribution() + { + _isSetVehicleRoleDistribution = false; + _vehicleRoleDistribution = {}; + + } + bool TrafficDefinitionImpl::IsSetVehicleRoleDistribution() const + { + return _isSetVehicleRoleDistribution; + } + bool TrafficDefinitionImpl::IsSetControllerDistribution() const + { + return _isSetControllerDistribution; + } + + IOpenScenarioFlexElement* TrafficDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> TrafficDistributionImpl::GetTrafficDistributionEntry() const + { + std::vector> temp; + for(auto&& elm: _trafficDistributionEntry) + temp.push_back(elm); + return temp; + } + std::vector> TrafficDistributionImpl::GetWriterTrafficDistributionEntry() const + { + return _trafficDistributionEntry; + } + + int TrafficDistributionImpl::GetTrafficDistributionEntrySize() const + { + return static_cast(_trafficDistributionEntry.size()); + } + + std::shared_ptr TrafficDistributionImpl::GetTrafficDistributionEntryAtIndex(unsigned int index) const + { + if (index >= 0 && _trafficDistributionEntry.size() > index) + { + return _trafficDistributionEntry[index]; + } + return nullptr; + } + + + void TrafficDistributionImpl::SetTrafficDistributionEntry(std::vector>& trafficDistributionEntry) + { + _trafficDistributionEntry = trafficDistributionEntry; + _isSetTrafficDistributionEntry = true; + } + + std::shared_ptr TrafficDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficDistributionImpl::GetModelType() const + { + return "TrafficDistribution"; + } + + // children + + TrafficDistributionImpl::TrafficDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void TrafficDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrafficDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficDistributionImpl::GetChildren() const + { + std::vector> result; + + auto trafficDistributionEntry = GetWriterTrafficDistributionEntry(); + if (!trafficDistributionEntry.empty()) + { + for(auto&& item : trafficDistributionEntry) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTrafficDistributionEntry = GetWriterTrafficDistributionEntry(); + if (!kTrafficDistributionEntry.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kTrafficDistributionEntry) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetTrafficDistributionEntry(clonedList); + } + return clonedObject; + } + + std::string TrafficDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetTrafficDistributionEntry()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrafficDistributionImpl::IsSetTrafficDistributionEntry() const + { + return _isSetTrafficDistributionEntry; + } + + IOpenScenarioFlexElement* TrafficDistributionEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrafficDistributionEntryImpl::GetWeight() const + { + return _weight; + } + std::shared_ptr TrafficDistributionEntryImpl::GetEntityDistribution() const + { + return _entityDistribution; + } + std::shared_ptr TrafficDistributionEntryImpl::GetProperties() const + { + return _properties; + } + + + void TrafficDistributionEntryImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + void TrafficDistributionEntryImpl::SetEntityDistribution(std::shared_ptr entityDistribution) + { + _entityDistribution = entityDistribution; + _isSetEntityDistribution = true; + } + + void TrafficDistributionEntryImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + std::shared_ptr TrafficDistributionEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficDistributionEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficDistributionEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficDistributionEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficDistributionEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficDistributionEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficDistributionEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficDistributionEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrafficDistributionEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficDistributionEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficDistributionEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficDistributionEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficDistributionEntryImpl::GetModelType() const + { + return "TrafficDistributionEntry"; + } + + void TrafficDistributionEntryImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string TrafficDistributionEntryImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool TrafficDistributionEntryImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficDistributionEntryImpl::GetWriterEntityDistribution() const + { + return std::dynamic_pointer_cast(_entityDistribution); + } + std::shared_ptr TrafficDistributionEntryImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + + TrafficDistributionEntryImpl::TrafficDistributionEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void TrafficDistributionEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType TrafficDistributionEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficDistributionEntryImpl::GetChildren() const + { + std::vector> result; + + const auto kEntityDistribution = GetWriterEntityDistribution(); + if (kEntityDistribution) + { + result.push_back(std::dynamic_pointer_cast(kEntityDistribution)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficDistributionEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + const auto kEntityDistribution = GetWriterEntityDistribution(); + if (kEntityDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kEntityDistribution)->Clone(); + auto clonedChildIEntityDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetEntityDistribution(std::dynamic_pointer_cast(clonedChildIEntityDistribution)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + return clonedObject; + } + + std::string TrafficDistributionEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDistributionEntryImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetEntityDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficDistributionEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficDistributionEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficDistributionEntryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficDistributionEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool TrafficDistributionEntryImpl::IsSetWeight() const + { + return _isSetWeight; + } + bool TrafficDistributionEntryImpl::IsSetEntityDistribution() const + { + return _isSetEntityDistribution; + } + void TrafficDistributionEntryImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool TrafficDistributionEntryImpl::IsSetProperties() const + { + return _isSetProperties; + } + + IOpenScenarioFlexElement* TrafficSignalActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrafficSignalActionImpl::GetTrafficSignalControllerAction() const + { + return _trafficSignalControllerAction; + } + std::shared_ptr TrafficSignalActionImpl::GetTrafficSignalStateAction() const + { + return _trafficSignalStateAction; + } + + + void TrafficSignalActionImpl::SetTrafficSignalControllerAction(std::shared_ptr trafficSignalControllerAction) + { + _trafficSignalControllerAction = trafficSignalControllerAction; + _trafficSignalStateAction = {}; + _isSetTrafficSignalControllerAction = true; + } + + void TrafficSignalActionImpl::SetTrafficSignalStateAction(std::shared_ptr trafficSignalStateAction) + { + _trafficSignalStateAction = trafficSignalStateAction; + _trafficSignalControllerAction = {}; + _isSetTrafficSignalStateAction = true; + } + + std::shared_ptr TrafficSignalActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalActionImpl::GetModelType() const + { + return "TrafficSignalAction"; + } + + // children + std::shared_ptr TrafficSignalActionImpl::GetWriterTrafficSignalControllerAction() const + { + return std::dynamic_pointer_cast(_trafficSignalControllerAction); + } + std::shared_ptr TrafficSignalActionImpl::GetWriterTrafficSignalStateAction() const + { + return std::dynamic_pointer_cast(_trafficSignalStateAction); + } + + TrafficSignalActionImpl::TrafficSignalActionImpl() + { + /** + * Filling the property to type map + */ + } + + void TrafficSignalActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrafficSignalActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalActionImpl::GetChildren() const + { + std::vector> result; + + const auto kTrafficSignalControllerAction = GetWriterTrafficSignalControllerAction(); + if (kTrafficSignalControllerAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalControllerAction)); + } + const auto kTrafficSignalStateAction = GetWriterTrafficSignalStateAction(); + if (kTrafficSignalStateAction) + { + result.push_back(std::dynamic_pointer_cast(kTrafficSignalStateAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTrafficSignalControllerAction = GetWriterTrafficSignalControllerAction(); + if (kTrafficSignalControllerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalControllerAction)->Clone(); + auto clonedChildITrafficSignalControllerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalControllerAction(std::dynamic_pointer_cast(clonedChildITrafficSignalControllerAction)); + } + const auto kTrafficSignalStateAction = GetWriterTrafficSignalStateAction(); + if (kTrafficSignalStateAction) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficSignalStateAction)->Clone(); + auto clonedChildITrafficSignalStateAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficSignalStateAction(std::dynamic_pointer_cast(clonedChildITrafficSignalStateAction)); + } + return clonedObject; + } + + std::string TrafficSignalActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSignalControllerAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION) + { + return std::dynamic_pointer_cast(GetTrafficSignalStateAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrafficSignalActionImpl::IsSetTrafficSignalControllerAction() const + { + return _isSetTrafficSignalControllerAction; + } + bool TrafficSignalActionImpl::IsSetTrafficSignalStateAction() const + { + return _isSetTrafficSignalStateAction; + } + + IOpenScenarioFlexElement* TrafficSignalConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalConditionImpl::GetName() const + { + return _name; + } + std::string TrafficSignalConditionImpl::GetState() const + { + return _state; + } + + + void TrafficSignalConditionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void TrafficSignalConditionImpl::SetState(const std::string state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + std::shared_ptr TrafficSignalConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalConditionImpl::GetModelType() const + { + return "TrafficSignalCondition"; + } + + void TrafficSignalConditionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void TrafficSignalConditionImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + std::string TrafficSignalConditionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string TrafficSignalConditionImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + bool TrafficSignalConditionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalConditionImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalConditionImpl::TrafficSignalConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::STRING); + } + + void TrafficSignalConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetState = true; + } + } + + SimpleType TrafficSignalConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_state = GetState(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + return GetState(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = value; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + + } + + + bool TrafficSignalConditionImpl::IsSetName() const + { + return _isSetName; + } + bool TrafficSignalConditionImpl::IsSetState() const + { + return _isSetState; + } + + IOpenScenarioFlexElement* TrafficSignalControllerImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrafficSignalControllerImpl::GetDelay() const + { + return _delay; + } + std::string TrafficSignalControllerImpl::GetName() const + { + return _name; + } + std::string TrafficSignalControllerImpl::GetReference() const + { + return _reference; + } + std::vector> TrafficSignalControllerImpl::GetPhases() const + { + std::vector> temp; + for(auto&& elm: _phases) + temp.push_back(elm); + return temp; + } + std::vector> TrafficSignalControllerImpl::GetWriterPhases() const + { + return _phases; + } + + int TrafficSignalControllerImpl::GetPhasesSize() const + { + return static_cast(_phases.size()); + } + + std::shared_ptr TrafficSignalControllerImpl::GetPhasesAtIndex(unsigned int index) const + { + if (index >= 0 && _phases.size() > index) + { + return _phases[index]; + } + return nullptr; + } + + + void TrafficSignalControllerImpl::SetDelay(const double delay) + { + _delay = delay; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY); + _isSetDelay = true; + } + + void TrafficSignalControllerImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void TrafficSignalControllerImpl::SetReference(const std::string reference) + { + _reference = reference; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REFERENCE); + _isSetReference = true; + } + + void TrafficSignalControllerImpl::SetPhases(std::vector>& phases) + { + _phases = phases; + _isSetPhases = true; + } + + std::shared_ptr TrafficSignalControllerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalControllerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalController).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalControllerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalControllerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalControllerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalControllerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalControllerImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + return GetDelay(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalControllerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalControllerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalControllerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalControllerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalControllerImpl::GetModelType() const + { + return "TrafficSignalController"; + } + + void TrafficSignalControllerImpl::WriteParameterToDelay(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, parameterName, nullTextMarker /*no textmarker*/); + _delay = {}; + } + + void TrafficSignalControllerImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void TrafficSignalControllerImpl::WriteParameterToReference(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, parameterName, nullTextMarker /*no textmarker*/); + _reference = {}; + } + + std::string TrafficSignalControllerImpl::GetParameterFromDelay() const + { + auto delay = OSC_CONSTANTS::ATTRIBUTE__DELAY; + return GetParameterNameFromAttribute(delay); + } + + std::string TrafficSignalControllerImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string TrafficSignalControllerImpl::GetParameterFromReference() const + { + auto reference = OSC_CONSTANTS::ATTRIBUTE__REFERENCE; + return GetParameterNameFromAttribute(reference); + } + + bool TrafficSignalControllerImpl::IsDelayParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DELAY); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalControllerImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalControllerImpl::IsReferenceParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__REFERENCE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalControllerImpl::TrafficSignalControllerImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DELAY, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, SimpleType::STRING); + } + + void TrafficSignalControllerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + // Simple type + _delay = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDelay = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REFERENCE) + { + // Simple type + _reference = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetReference = true; + } + } + + SimpleType TrafficSignalControllerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalControllerImpl::GetChildren() const + { + std::vector> result; + + auto phases = GetWriterPhases(); + if (!phases.empty()) + { + for(auto&& item : phases) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalControllerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_delay = GetDelay(); + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_reference = GetReference(); + // clone indicators + clonedObject->_isSetDelay = _isSetDelay; + clonedObject->_isSetReference = _isSetReference; + // clone children + const auto kPhases = GetWriterPhases(); + if (!kPhases.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPhases) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPhases(clonedList); + } + return clonedObject; + } + + std::string TrafficSignalControllerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__REFERENCE) + { + return GetReference(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalControllerImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PHASE) + { + std::vector> vect; + for (auto&& elem : GetPhases()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalControllerImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalControllerImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__REFERENCE) + { + // Simple type + _reference = value; + AddResolvedParameter(attributeKey); + _isSetReference = true; + } + + } + void TrafficSignalControllerImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DELAY) + { + // Simple type + _delay = value; + AddResolvedParameter(attributeKey); + _isSetDelay = true; + } + + } + + + void TrafficSignalControllerImpl::ResetDelay() + { + _isSetDelay = false; + _delay = {}; + + } + bool TrafficSignalControllerImpl::IsSetDelay() const + { + return _isSetDelay; + } + bool TrafficSignalControllerImpl::IsSetName() const + { + return _isSetName; + } + void TrafficSignalControllerImpl::ResetReference() + { + _isSetReference = false; + _reference = {}; + + } + bool TrafficSignalControllerImpl::IsSetReference() const + { + return _isSetReference; + } + void TrafficSignalControllerImpl::ResetPhases() + { + _isSetPhases = false; + _phases = {}; + + } + bool TrafficSignalControllerImpl::IsSetPhases() const + { + return _isSetPhases; + } + + IOpenScenarioFlexElement* TrafficSignalControllerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalControllerActionImpl::GetPhase() const + { + return _phase; + } + std::shared_ptr> TrafficSignalControllerActionImpl::GetTrafficSignalControllerRef() const + { + return _trafficSignalControllerRef; + } + std::vector> TrafficSignalControllerActionImpl::GetPhaseRef() const + { + std::vector> temp; + for(auto&& elm: _phaseRef) + temp.push_back(elm); + return temp; + } + + int TrafficSignalControllerActionImpl::GetPhaseRefSize() const + { + return static_cast(_phaseRef.size()); + } + + std::shared_ptr TrafficSignalControllerActionImpl::GetPhaseRefAtIndex(unsigned int index) const + { + if (index >= 0 && _phaseRef.size() > index) + { + return _phaseRef[index]; + } + return nullptr; + } + + + void TrafficSignalControllerActionImpl::SetPhase(const std::string phase) + { + _phase = phase; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE); + _isSetPhase = true; + } + + void TrafficSignalControllerActionImpl::SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) + { + _trafficSignalControllerRef = trafficSignalControllerRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF); + _isSetTrafficSignalControllerRef = true; + } + + void TrafficSignalControllerActionImpl::SetPhaseRef(std::vector>& phaseRef) + { + _phaseRef = phaseRef; + _isSetPhaseRef = true; + } + + std::shared_ptr TrafficSignalControllerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalControllerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalControllerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalControllerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalControllerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalControllerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalControllerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalControllerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalControllerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalControllerActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalControllerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalControllerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalControllerActionImpl::GetModelType() const + { + return "TrafficSignalControllerAction"; + } + + void TrafficSignalControllerActionImpl::WriteParameterToPhase(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, parameterName, nullTextMarker /*no textmarker*/); + _phase = {}; + } + + void TrafficSignalControllerActionImpl::WriteParameterToTrafficSignalControllerRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, parameterName, nullTextMarker /*no textmarker*/); + _trafficSignalControllerRef = {}; + } + + std::string TrafficSignalControllerActionImpl::GetParameterFromPhase() const + { + auto phase = OSC_CONSTANTS::ATTRIBUTE__PHASE; + return GetParameterNameFromAttribute(phase); + } + + std::string TrafficSignalControllerActionImpl::GetParameterFromTrafficSignalControllerRef() const + { + auto trafficSignalControllerRef = OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF; + return GetParameterNameFromAttribute(trafficSignalControllerRef); + } + + bool TrafficSignalControllerActionImpl::IsPhaseParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PHASE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalControllerActionImpl::IsTrafficSignalControllerRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalControllerActionImpl::TrafficSignalControllerActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PHASE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, SimpleType::STRING); + } + + void TrafficSignalControllerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + // Simple type + _phase = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPhase = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _trafficSignalControllerRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetTrafficSignalControllerRef = true; + } + } + + SimpleType TrafficSignalControllerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalControllerActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalControllerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_phase = GetPhase(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetTrafficSignalControllerRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_trafficSignalControllerRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalControllerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + return GetPhase(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Get the Proxy + auto trafficSignalControllerRef = GetTrafficSignalControllerRef(); + return trafficSignalControllerRef!= nullptr ? trafficSignalControllerRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalControllerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Get the Proxy + auto trafficSignalControllerRef = GetTrafficSignalControllerRef(); + return trafficSignalControllerRef != nullptr ? std::dynamic_pointer_cast(trafficSignalControllerRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string TrafficSignalControllerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalControllerActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + // Simple type + _phase = value; + AddResolvedParameter(attributeKey); + _isSetPhase = true; + } + + } + + + bool TrafficSignalControllerActionImpl::IsSetPhase() const + { + return _isSetPhase; + } + bool TrafficSignalControllerActionImpl::IsSetTrafficSignalControllerRef() const + { + return _isSetTrafficSignalControllerRef; + } + void TrafficSignalControllerActionImpl::ResetPhaseRef() + { + _isSetPhaseRef = false; + _phaseRef = {}; + + } + bool TrafficSignalControllerActionImpl::IsSetPhaseRef() const + { + return _isSetPhaseRef; + } + + IOpenScenarioFlexElement* TrafficSignalControllerConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalControllerConditionImpl::GetPhase() const + { + return _phase; + } + std::shared_ptr> TrafficSignalControllerConditionImpl::GetTrafficSignalControllerRef() const + { + return _trafficSignalControllerRef; + } + std::vector> TrafficSignalControllerConditionImpl::GetPhaseRef() const + { + std::vector> temp; + for(auto&& elm: _phaseRef) + temp.push_back(elm); + return temp; + } + + int TrafficSignalControllerConditionImpl::GetPhaseRefSize() const + { + return static_cast(_phaseRef.size()); + } + + std::shared_ptr TrafficSignalControllerConditionImpl::GetPhaseRefAtIndex(unsigned int index) const + { + if (index >= 0 && _phaseRef.size() > index) + { + return _phaseRef[index]; + } + return nullptr; + } + + + void TrafficSignalControllerConditionImpl::SetPhase(const std::string phase) + { + _phase = phase; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE); + _isSetPhase = true; + } + + void TrafficSignalControllerConditionImpl::SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) + { + _trafficSignalControllerRef = trafficSignalControllerRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF); + _isSetTrafficSignalControllerRef = true; + } + + void TrafficSignalControllerConditionImpl::SetPhaseRef(std::vector>& phaseRef) + { + _phaseRef = phaseRef; + _isSetPhaseRef = true; + } + + std::shared_ptr TrafficSignalControllerConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalControllerConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalControllerCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalControllerConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalControllerConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalControllerConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalControllerConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalControllerConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalControllerConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalControllerConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalControllerConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalControllerConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalControllerConditionImpl::GetModelType() const + { + return "TrafficSignalControllerCondition"; + } + + void TrafficSignalControllerConditionImpl::WriteParameterToPhase(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, parameterName, nullTextMarker /*no textmarker*/); + _phase = {}; + } + + void TrafficSignalControllerConditionImpl::WriteParameterToTrafficSignalControllerRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, parameterName, nullTextMarker /*no textmarker*/); + _trafficSignalControllerRef = {}; + } + + std::string TrafficSignalControllerConditionImpl::GetParameterFromPhase() const + { + auto phase = OSC_CONSTANTS::ATTRIBUTE__PHASE; + return GetParameterNameFromAttribute(phase); + } + + std::string TrafficSignalControllerConditionImpl::GetParameterFromTrafficSignalControllerRef() const + { + auto trafficSignalControllerRef = OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF; + return GetParameterNameFromAttribute(trafficSignalControllerRef); + } + + bool TrafficSignalControllerConditionImpl::IsPhaseParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__PHASE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalControllerConditionImpl::IsTrafficSignalControllerRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalControllerConditionImpl::TrafficSignalControllerConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__PHASE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, SimpleType::STRING); + } + + void TrafficSignalControllerConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + // Simple type + _phase = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetPhase = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _trafficSignalControllerRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetTrafficSignalControllerRef = true; + } + } + + SimpleType TrafficSignalControllerConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalControllerConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalControllerConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_phase = GetPhase(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetTrafficSignalControllerRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_trafficSignalControllerRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalControllerConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + return GetPhase(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Get the Proxy + auto trafficSignalControllerRef = GetTrafficSignalControllerRef(); + return trafficSignalControllerRef!= nullptr ? trafficSignalControllerRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalControllerConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalControllerConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF) + { + // Get the Proxy + auto trafficSignalControllerRef = GetTrafficSignalControllerRef(); + return trafficSignalControllerRef != nullptr ? std::dynamic_pointer_cast(trafficSignalControllerRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string TrafficSignalControllerConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalControllerConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__PHASE) + { + // Simple type + _phase = value; + AddResolvedParameter(attributeKey); + _isSetPhase = true; + } + + } + + + bool TrafficSignalControllerConditionImpl::IsSetPhase() const + { + return _isSetPhase; + } + bool TrafficSignalControllerConditionImpl::IsSetTrafficSignalControllerRef() const + { + return _isSetTrafficSignalControllerRef; + } + void TrafficSignalControllerConditionImpl::ResetPhaseRef() + { + _isSetPhaseRef = false; + _phaseRef = {}; + + } + bool TrafficSignalControllerConditionImpl::IsSetPhaseRef() const + { + return _isSetPhaseRef; + } + + IOpenScenarioFlexElement* TrafficSignalGroupStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalGroupStateImpl::GetState() const + { + return _state; + } + + + void TrafficSignalGroupStateImpl::SetState(const std::string state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + std::shared_ptr TrafficSignalGroupStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalGroupStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalGroupState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalGroupStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalGroupStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalGroupStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalGroupStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalGroupStateImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalGroupStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalGroupStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalGroupStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalGroupStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalGroupStateImpl::GetModelType() const + { + return "TrafficSignalGroupState"; + } + + void TrafficSignalGroupStateImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + std::string TrafficSignalGroupStateImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + bool TrafficSignalGroupStateImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalGroupStateImpl::TrafficSignalGroupStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::STRING); + } + + void TrafficSignalGroupStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetState = true; + } + } + + SimpleType TrafficSignalGroupStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalGroupStateImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalGroupStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_state = GetState(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalGroupStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + return GetState(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalGroupStateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalGroupStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalGroupStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalGroupStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalGroupStateImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = value; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + + } + + + bool TrafficSignalGroupStateImpl::IsSetState() const + { + return _isSetState; + } + + IOpenScenarioFlexElement* TrafficSignalStateImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalStateImpl::GetState() const + { + return _state; + } + std::string TrafficSignalStateImpl::GetTrafficSignalId() const + { + return _trafficSignalId; + } + + + void TrafficSignalStateImpl::SetState(const std::string state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + void TrafficSignalStateImpl::SetTrafficSignalId(const std::string trafficSignalId) + { + _trafficSignalId = trafficSignalId; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID); + _isSetTrafficSignalId = true; + } + + std::shared_ptr TrafficSignalStateImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalStateImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalState).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalStateWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalStateImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalStateImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalStateImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalStateImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalStateImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalStateImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalStateImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalStateImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalStateImpl::GetModelType() const + { + return "TrafficSignalState"; + } + + void TrafficSignalStateImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + void TrafficSignalStateImpl::WriteParameterToTrafficSignalId(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, parameterName, nullTextMarker /*no textmarker*/); + _trafficSignalId = {}; + } + + std::string TrafficSignalStateImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + std::string TrafficSignalStateImpl::GetParameterFromTrafficSignalId() const + { + auto trafficSignalId = OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID; + return GetParameterNameFromAttribute(trafficSignalId); + } + + bool TrafficSignalStateImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalStateImpl::IsTrafficSignalIdParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalStateImpl::TrafficSignalStateImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, SimpleType::STRING); + } + + void TrafficSignalStateImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetState = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID) + { + // Simple type + _trafficSignalId = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTrafficSignalId = true; + } + } + + SimpleType TrafficSignalStateImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalStateImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalStateImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_state = GetState(); + // Simple type + clonedObject->_trafficSignalId = GetTrafficSignalId(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalStateImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + return GetState(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID) + { + return GetTrafficSignalId(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalStateImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalStateImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalStateImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalStateImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalStateImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = value; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID) + { + // Simple type + _trafficSignalId = value; + AddResolvedParameter(attributeKey); + _isSetTrafficSignalId = true; + } + + } + + + bool TrafficSignalStateImpl::IsSetState() const + { + return _isSetState; + } + bool TrafficSignalStateImpl::IsSetTrafficSignalId() const + { + return _isSetTrafficSignalId; + } + + IOpenScenarioFlexElement* TrafficSignalStateActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string TrafficSignalStateActionImpl::GetName() const + { + return _name; + } + std::string TrafficSignalStateActionImpl::GetState() const + { + return _state; + } + + + void TrafficSignalStateActionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void TrafficSignalStateActionImpl::SetState(const std::string state) + { + _state = state; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE); + _isSetState = true; + } + + std::shared_ptr TrafficSignalStateActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSignalStateActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSignalStateAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSignalStateActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSignalStateActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSignalStateActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSignalStateActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSignalStateActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSignalStateActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSignalStateActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSignalStateActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSignalStateActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSignalStateActionImpl::GetModelType() const + { + return "TrafficSignalStateAction"; + } + + void TrafficSignalStateActionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void TrafficSignalStateActionImpl::WriteParameterToState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, parameterName, nullTextMarker /*no textmarker*/); + _state = {}; + } + + std::string TrafficSignalStateActionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string TrafficSignalStateActionImpl::GetParameterFromState() const + { + auto state = OSC_CONSTANTS::ATTRIBUTE__STATE; + return GetParameterNameFromAttribute(state); + } + + bool TrafficSignalStateActionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSignalStateActionImpl::IsStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__STATE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrafficSignalStateActionImpl::TrafficSignalStateActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__STATE, SimpleType::STRING); + } + + void TrafficSignalStateActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetState = true; + } + } + + SimpleType TrafficSignalStateActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSignalStateActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSignalStateActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_state = GetState(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficSignalStateActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + return GetState(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalStateActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficSignalStateActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSignalStateActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSignalStateActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSignalStateActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__STATE) + { + // Simple type + _state = value; + AddResolvedParameter(attributeKey); + _isSetState = true; + } + + } + + + bool TrafficSignalStateActionImpl::IsSetName() const + { + return _isSetName; + } + bool TrafficSignalStateActionImpl::IsSetState() const + { + return _isSetState; + } + + IOpenScenarioFlexElement* TrafficSinkActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrafficSinkActionImpl::GetRadius() const + { + return _radius; + } + double TrafficSinkActionImpl::GetRate() const + { + return _rate; + } + std::shared_ptr TrafficSinkActionImpl::GetPosition() const + { + return _position; + } + std::shared_ptr TrafficSinkActionImpl::GetTrafficDefinition() const + { + return _trafficDefinition; + } + + + void TrafficSinkActionImpl::SetRadius(const double radius) + { + _radius = radius; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS); + _isSetRadius = true; + } + + void TrafficSinkActionImpl::SetRate(const double rate) + { + _rate = rate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE); + _isSetRate = true; + } + + void TrafficSinkActionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + void TrafficSinkActionImpl::SetTrafficDefinition(std::shared_ptr trafficDefinition) + { + _trafficDefinition = trafficDefinition; + _isSetTrafficDefinition = true; + } + + std::shared_ptr TrafficSinkActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSinkActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSinkAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSinkActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSinkActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSinkActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSinkActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSinkActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + return GetRadius(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + return GetRate(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSinkActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSinkActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSinkActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSinkActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSinkActionImpl::GetModelType() const + { + return "TrafficSinkAction"; + } + + void TrafficSinkActionImpl::WriteParameterToRadius(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, parameterName, nullTextMarker /*no textmarker*/); + _radius = {}; + } + + void TrafficSinkActionImpl::WriteParameterToRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, parameterName, nullTextMarker /*no textmarker*/); + _rate = {}; + } + + std::string TrafficSinkActionImpl::GetParameterFromRadius() const + { + auto radius = OSC_CONSTANTS::ATTRIBUTE__RADIUS; + return GetParameterNameFromAttribute(radius); + } + + std::string TrafficSinkActionImpl::GetParameterFromRate() const + { + auto rate = OSC_CONSTANTS::ATTRIBUTE__RATE; + return GetParameterNameFromAttribute(rate); + } + + bool TrafficSinkActionImpl::IsRadiusParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RADIUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSinkActionImpl::IsRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RATE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficSinkActionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + std::shared_ptr TrafficSinkActionImpl::GetWriterTrafficDefinition() const + { + return std::dynamic_pointer_cast(_trafficDefinition); + } + + TrafficSinkActionImpl::TrafficSinkActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RADIUS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RATE, SimpleType::DOUBLE); + } + + void TrafficSinkActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + // Simple type + _radius = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + // Simple type + _rate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRate = true; + } + } + + SimpleType TrafficSinkActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSinkActionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDefinition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSinkActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_radius = GetRadius(); + // Simple type + clonedObject->_rate = GetRate(); + // clone indicators + clonedObject->_isSetRate = _isSetRate; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDefinition)->Clone(); + auto clonedChildITrafficDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDefinition(std::dynamic_pointer_cast(clonedChildITrafficDefinition)); + } + return clonedObject; + } + + std::string TrafficSinkActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSinkActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION) + { + return std::dynamic_pointer_cast(GetTrafficDefinition()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficSinkActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSinkActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSinkActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSinkActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + // Simple type + _radius = value; + AddResolvedParameter(attributeKey); + _isSetRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + // Simple type + _rate = value; + AddResolvedParameter(attributeKey); + _isSetRate = true; + } + + } + + + bool TrafficSinkActionImpl::IsSetRadius() const + { + return _isSetRadius; + } + void TrafficSinkActionImpl::ResetRate() + { + _isSetRate = false; + _rate = {}; + + } + bool TrafficSinkActionImpl::IsSetRate() const + { + return _isSetRate; + } + bool TrafficSinkActionImpl::IsSetPosition() const + { + return _isSetPosition; + } + void TrafficSinkActionImpl::ResetTrafficDefinition() + { + _isSetTrafficDefinition = false; + _trafficDefinition = {}; + + } + bool TrafficSinkActionImpl::IsSetTrafficDefinition() const + { + return _isSetTrafficDefinition; + } + + IOpenScenarioFlexElement* TrafficSourceActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrafficSourceActionImpl::GetRadius() const + { + return _radius; + } + double TrafficSourceActionImpl::GetRate() const + { + return _rate; + } + double TrafficSourceActionImpl::GetSpeed() const + { + return _speed; + } + double TrafficSourceActionImpl::GetVelocity() const + { + return _velocity; + } + std::shared_ptr TrafficSourceActionImpl::GetPosition() const + { + return _position; + } + std::shared_ptr TrafficSourceActionImpl::GetTrafficDefinition() const + { + return _trafficDefinition; + } + std::shared_ptr TrafficSourceActionImpl::GetTrafficDistribution() const + { + return _trafficDistribution; + } + + + void TrafficSourceActionImpl::SetRadius(const double radius) + { + _radius = radius; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS); + _isSetRadius = true; + } + + void TrafficSourceActionImpl::SetRate(const double rate) + { + _rate = rate; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE); + _isSetRate = true; + } + + void TrafficSourceActionImpl::SetSpeed(const double speed) + { + _speed = speed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED); + _isSetSpeed = true; + } + + void TrafficSourceActionImpl::SetVelocity(const double velocity) + { + _velocity = velocity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + _isSetVelocity = true; + } + + void TrafficSourceActionImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + void TrafficSourceActionImpl::SetTrafficDefinition(std::shared_ptr trafficDefinition) + { + _trafficDefinition = trafficDefinition; + _isSetTrafficDefinition = true; + } + + void TrafficSourceActionImpl::SetTrafficDistribution(std::shared_ptr trafficDistribution) + { + _trafficDistribution = trafficDistribution; + _isSetTrafficDistribution = true; + } + + std::shared_ptr TrafficSourceActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSourceActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSourceAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSourceActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSourceActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSourceActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficSourceActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSourceActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + return GetRadius(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + return GetRate(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + return GetSpeed(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + return GetVelocity(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSourceActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSourceActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSourceActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSourceActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSourceActionImpl::GetModelType() const + { + return "TrafficSourceAction"; + } + + void TrafficSourceActionImpl::WriteParameterToRadius(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, parameterName, nullTextMarker /*no textmarker*/); + _radius = {}; + } + + void TrafficSourceActionImpl::WriteParameterToRate(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, parameterName, nullTextMarker /*no textmarker*/); + _rate = {}; + } + + void TrafficSourceActionImpl::WriteParameterToSpeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, parameterName, nullTextMarker /*no textmarker*/); + _speed = {}; + } + + void TrafficSourceActionImpl::WriteParameterToVelocity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, parameterName, nullTextMarker /*no textmarker*/); + _velocity = {}; + } + + std::string TrafficSourceActionImpl::GetParameterFromRadius() const + { + auto radius = OSC_CONSTANTS::ATTRIBUTE__RADIUS; + return GetParameterNameFromAttribute(radius); + } + + std::string TrafficSourceActionImpl::GetParameterFromRate() const + { + auto rate = OSC_CONSTANTS::ATTRIBUTE__RATE; + return GetParameterNameFromAttribute(rate); + } + + std::string TrafficSourceActionImpl::GetParameterFromSpeed() const + { + auto speed = OSC_CONSTANTS::ATTRIBUTE__SPEED; + return GetParameterNameFromAttribute(speed); + } + + std::string TrafficSourceActionImpl::GetParameterFromVelocity() const + { + auto velocity = OSC_CONSTANTS::ATTRIBUTE__VELOCITY; + return GetParameterNameFromAttribute(velocity); + } + + bool TrafficSourceActionImpl::IsRadiusParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RADIUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSourceActionImpl::IsRateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSourceActionImpl::IsSpeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPEED); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSourceActionImpl::IsVelocityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficSourceActionImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + std::shared_ptr TrafficSourceActionImpl::GetWriterTrafficDefinition() const + { + return std::dynamic_pointer_cast(_trafficDefinition); + } + std::shared_ptr TrafficSourceActionImpl::GetWriterTrafficDistribution() const + { + return std::dynamic_pointer_cast(_trafficDistribution); + } + + TrafficSourceActionImpl::TrafficSourceActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RADIUS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RATE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPEED, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, SimpleType::DOUBLE); + } + + void TrafficSourceActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + // Simple type + _radius = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + // Simple type + _rate = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + // Simple type + _velocity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVelocity = true; + } + } + + SimpleType TrafficSourceActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSourceActionImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDefinition)); + } + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSourceActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_radius = GetRadius(); + // Simple type + clonedObject->_rate = GetRate(); + // Simple type + clonedObject->_speed = GetSpeed(); + // Simple type + clonedObject->_velocity = GetVelocity(); + // clone indicators + clonedObject->_isSetSpeed = _isSetSpeed; + clonedObject->_isSetVelocity = _isSetVelocity; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDefinition)->Clone(); + auto clonedChildITrafficDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDefinition(std::dynamic_pointer_cast(clonedChildITrafficDefinition)); + } + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDistribution)->Clone(); + auto clonedChildITrafficDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDistribution(std::dynamic_pointer_cast(clonedChildITrafficDistribution)); + } + return clonedObject; + } + + std::string TrafficSourceActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSourceActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION) + { + return std::dynamic_pointer_cast(GetTrafficDefinition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetTrafficDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficSourceActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSourceActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSourceActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSourceActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RADIUS) + { + // Simple type + _radius = value; + AddResolvedParameter(attributeKey); + _isSetRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RATE) + { + // Simple type + _rate = value; + AddResolvedParameter(attributeKey); + _isSetRate = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = value; + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + // Simple type + _velocity = value; + AddResolvedParameter(attributeKey); + _isSetVelocity = true; + } + + } + + + bool TrafficSourceActionImpl::IsSetRadius() const + { + return _isSetRadius; + } + bool TrafficSourceActionImpl::IsSetRate() const + { + return _isSetRate; + } + void TrafficSourceActionImpl::ResetSpeed() + { + _isSetSpeed = false; + _speed = {}; + + } + bool TrafficSourceActionImpl::IsSetSpeed() const + { + return _isSetSpeed; + } + void TrafficSourceActionImpl::ResetVelocity() + { + _isSetVelocity = false; + _velocity = {}; + + } + bool TrafficSourceActionImpl::IsSetVelocity() const + { + return _isSetVelocity; + } + bool TrafficSourceActionImpl::IsSetPosition() const + { + return _isSetPosition; + } + void TrafficSourceActionImpl::ResetTrafficDefinition() + { + _isSetTrafficDefinition = false; + _trafficDefinition = {}; + + } + bool TrafficSourceActionImpl::IsSetTrafficDefinition() const + { + return _isSetTrafficDefinition; + } + void TrafficSourceActionImpl::ResetTrafficDistribution() + { + _isSetTrafficDistribution = false; + _trafficDistribution = {}; + + } + bool TrafficSourceActionImpl::IsSetTrafficDistribution() const + { + return _isSetTrafficDistribution; + } + + IOpenScenarioFlexElement* TrafficStopActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + + + std::shared_ptr TrafficStopActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficStopActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficStopAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficStopActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficStopActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficStopActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrafficStopActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficStopActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrafficStopActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficStopActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficStopActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficStopActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficStopActionImpl::GetModelType() const + { + return "TrafficStopAction"; + } + + // children + + TrafficStopActionImpl::TrafficStopActionImpl() + { + /** + * Filling the property to type map + */ + } + + void TrafficStopActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrafficStopActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficStopActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficStopActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + return clonedObject; + } + + std::string TrafficStopActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficStopActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrafficStopActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficStopActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficStopActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + + IOpenScenarioFlexElement* TrafficSwarmActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrafficSwarmActionImpl::GetInnerRadius() const + { + return _innerRadius; + } + uint32_t TrafficSwarmActionImpl::GetNumberOfVehicles() const + { + return _numberOfVehicles; + } + double TrafficSwarmActionImpl::GetOffset() const + { + return _offset; + } + double TrafficSwarmActionImpl::GetSemiMajorAxis() const + { + return _semiMajorAxis; + } + double TrafficSwarmActionImpl::GetSemiMinorAxis() const + { + return _semiMinorAxis; + } + double TrafficSwarmActionImpl::GetVelocity() const + { + return _velocity; + } + std::shared_ptr TrafficSwarmActionImpl::GetCentralObject() const + { + return _centralObject; + } + std::shared_ptr TrafficSwarmActionImpl::GetTrafficDefinition() const + { + return _trafficDefinition; + } + std::shared_ptr TrafficSwarmActionImpl::GetTrafficDistribution() const + { + return _trafficDistribution; + } + std::shared_ptr TrafficSwarmActionImpl::GetInitialSpeedRange() const + { + return _initialSpeedRange; + } + std::shared_ptr TrafficSwarmActionImpl::GetDirectionOfTravelDistribution() const + { + return _directionOfTravelDistribution; + } + + + void TrafficSwarmActionImpl::SetInnerRadius(const double innerRadius) + { + _innerRadius = innerRadius; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS); + _isSetInnerRadius = true; + } + + void TrafficSwarmActionImpl::SetNumberOfVehicles(const uint32_t numberOfVehicles) + { + _numberOfVehicles = numberOfVehicles; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES); + _isSetNumberOfVehicles = true; + } + + void TrafficSwarmActionImpl::SetOffset(const double offset) + { + _offset = offset; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET); + _isSetOffset = true; + } + + void TrafficSwarmActionImpl::SetSemiMajorAxis(const double semiMajorAxis) + { + _semiMajorAxis = semiMajorAxis; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS); + _isSetSemiMajorAxis = true; + } + + void TrafficSwarmActionImpl::SetSemiMinorAxis(const double semiMinorAxis) + { + _semiMinorAxis = semiMinorAxis; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS); + _isSetSemiMinorAxis = true; + } + + void TrafficSwarmActionImpl::SetVelocity(const double velocity) + { + _velocity = velocity; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + _isSetVelocity = true; + } + + void TrafficSwarmActionImpl::SetCentralObject(std::shared_ptr centralObject) + { + _centralObject = centralObject; + _isSetCentralObject = true; + } + + void TrafficSwarmActionImpl::SetTrafficDefinition(std::shared_ptr trafficDefinition) + { + _trafficDefinition = trafficDefinition; + _isSetTrafficDefinition = true; + } + + void TrafficSwarmActionImpl::SetTrafficDistribution(std::shared_ptr trafficDistribution) + { + _trafficDistribution = trafficDistribution; + _isSetTrafficDistribution = true; + } + + void TrafficSwarmActionImpl::SetInitialSpeedRange(std::shared_ptr initialSpeedRange) + { + _initialSpeedRange = initialSpeedRange; + _isSetInitialSpeedRange = true; + } + + void TrafficSwarmActionImpl::SetDirectionOfTravelDistribution(std::shared_ptr directionOfTravelDistribution) + { + _directionOfTravelDistribution = directionOfTravelDistribution; + _isSetDirectionOfTravelDistribution = true; + } + + std::shared_ptr TrafficSwarmActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrafficSwarmActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrafficSwarmAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrafficSwarmActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrafficSwarmActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrafficSwarmActionImpl::GetUnsignedIntProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES) + { + return GetNumberOfVehicles(); + } + throw KeyNotSupportedException(); + + } + + int TrafficSwarmActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrafficSwarmActionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS) + { + return GetInnerRadius(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + return GetOffset(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS) + { + return GetSemiMajorAxis(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS) + { + return GetSemiMinorAxis(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + return GetVelocity(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrafficSwarmActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrafficSwarmActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrafficSwarmActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrafficSwarmActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrafficSwarmActionImpl::GetModelType() const + { + return "TrafficSwarmAction"; + } + + void TrafficSwarmActionImpl::WriteParameterToInnerRadius(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, parameterName, nullTextMarker /*no textmarker*/); + _innerRadius = {}; + } + + void TrafficSwarmActionImpl::WriteParameterToNumberOfVehicles(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, parameterName, nullTextMarker /*no textmarker*/); + _numberOfVehicles = {}; + } + + void TrafficSwarmActionImpl::WriteParameterToOffset(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, parameterName, nullTextMarker /*no textmarker*/); + _offset = {}; + } + + void TrafficSwarmActionImpl::WriteParameterToSemiMajorAxis(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, parameterName, nullTextMarker /*no textmarker*/); + _semiMajorAxis = {}; + } + + void TrafficSwarmActionImpl::WriteParameterToSemiMinorAxis(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, parameterName, nullTextMarker /*no textmarker*/); + _semiMinorAxis = {}; + } + + void TrafficSwarmActionImpl::WriteParameterToVelocity(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, parameterName, nullTextMarker /*no textmarker*/); + _velocity = {}; + } + + std::string TrafficSwarmActionImpl::GetParameterFromInnerRadius() const + { + auto innerRadius = OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS; + return GetParameterNameFromAttribute(innerRadius); + } + + std::string TrafficSwarmActionImpl::GetParameterFromNumberOfVehicles() const + { + auto numberOfVehicles = OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES; + return GetParameterNameFromAttribute(numberOfVehicles); + } + + std::string TrafficSwarmActionImpl::GetParameterFromOffset() const + { + auto offset = OSC_CONSTANTS::ATTRIBUTE__OFFSET; + return GetParameterNameFromAttribute(offset); + } + + std::string TrafficSwarmActionImpl::GetParameterFromSemiMajorAxis() const + { + auto semiMajorAxis = OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS; + return GetParameterNameFromAttribute(semiMajorAxis); + } + + std::string TrafficSwarmActionImpl::GetParameterFromSemiMinorAxis() const + { + auto semiMinorAxis = OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS; + return GetParameterNameFromAttribute(semiMinorAxis); + } + + std::string TrafficSwarmActionImpl::GetParameterFromVelocity() const + { + auto velocity = OSC_CONSTANTS::ATTRIBUTE__VELOCITY; + return GetParameterNameFromAttribute(velocity); + } + + bool TrafficSwarmActionImpl::IsInnerRadiusParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSwarmActionImpl::IsNumberOfVehiclesParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSwarmActionImpl::IsOffsetParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__OFFSET); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSwarmActionImpl::IsSemiMajorAxisParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSwarmActionImpl::IsSemiMinorAxisParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrafficSwarmActionImpl::IsVelocityParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VELOCITY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrafficSwarmActionImpl::GetWriterCentralObject() const + { + return std::dynamic_pointer_cast(_centralObject); + } + std::shared_ptr TrafficSwarmActionImpl::GetWriterTrafficDefinition() const + { + return std::dynamic_pointer_cast(_trafficDefinition); + } + std::shared_ptr TrafficSwarmActionImpl::GetWriterTrafficDistribution() const + { + return std::dynamic_pointer_cast(_trafficDistribution); + } + std::shared_ptr TrafficSwarmActionImpl::GetWriterInitialSpeedRange() const + { + return std::dynamic_pointer_cast(_initialSpeedRange); + } + std::shared_ptr TrafficSwarmActionImpl::GetWriterDirectionOfTravelDistribution() const + { + return std::dynamic_pointer_cast(_directionOfTravelDistribution); + } + + TrafficSwarmActionImpl::TrafficSwarmActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, SimpleType::UNSIGNED_INT); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__OFFSET, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, SimpleType::DOUBLE); + } + + void TrafficSwarmActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS) + { + // Simple type + _innerRadius = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetInnerRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES) + { + // Simple type + _numberOfVehicles = ParserHelper::ParseUnsignedInt(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetNumberOfVehicles = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS) + { + // Simple type + _semiMajorAxis = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSemiMajorAxis = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS) + { + // Simple type + _semiMinorAxis = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSemiMinorAxis = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + // Simple type + _velocity = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetVelocity = true; + } + } + + SimpleType TrafficSwarmActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrafficSwarmActionImpl::GetChildren() const + { + std::vector> result; + + const auto kCentralObject = GetWriterCentralObject(); + if (kCentralObject) + { + result.push_back(std::dynamic_pointer_cast(kCentralObject)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDefinition)); + } + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + result.push_back(std::dynamic_pointer_cast(kTrafficDistribution)); + } + const auto kInitialSpeedRange = GetWriterInitialSpeedRange(); + if (kInitialSpeedRange) + { + result.push_back(std::dynamic_pointer_cast(kInitialSpeedRange)); + } + const auto kDirectionOfTravelDistribution = GetWriterDirectionOfTravelDistribution(); + if (kDirectionOfTravelDistribution) + { + result.push_back(std::dynamic_pointer_cast(kDirectionOfTravelDistribution)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrafficSwarmActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_innerRadius = GetInnerRadius(); + // Simple type + clonedObject->_numberOfVehicles = GetNumberOfVehicles(); + // Simple type + clonedObject->_offset = GetOffset(); + // Simple type + clonedObject->_semiMajorAxis = GetSemiMajorAxis(); + // Simple type + clonedObject->_semiMinorAxis = GetSemiMinorAxis(); + // Simple type + clonedObject->_velocity = GetVelocity(); + // clone indicators + clonedObject->_isSetVelocity = _isSetVelocity; + // clone children + const auto kCentralObject = GetWriterCentralObject(); + if (kCentralObject) + { + auto clonedChild = std::dynamic_pointer_cast(kCentralObject)->Clone(); + auto clonedChildICentralSwarmObject = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCentralObject(std::dynamic_pointer_cast(clonedChildICentralSwarmObject)); + } + const auto kTrafficDefinition = GetWriterTrafficDefinition(); + if (kTrafficDefinition) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDefinition)->Clone(); + auto clonedChildITrafficDefinition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDefinition(std::dynamic_pointer_cast(clonedChildITrafficDefinition)); + } + const auto kTrafficDistribution = GetWriterTrafficDistribution(); + if (kTrafficDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kTrafficDistribution)->Clone(); + auto clonedChildITrafficDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrafficDistribution(std::dynamic_pointer_cast(clonedChildITrafficDistribution)); + } + const auto kInitialSpeedRange = GetWriterInitialSpeedRange(); + if (kInitialSpeedRange) + { + auto clonedChild = std::dynamic_pointer_cast(kInitialSpeedRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetInitialSpeedRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + const auto kDirectionOfTravelDistribution = GetWriterDirectionOfTravelDistribution(); + if (kDirectionOfTravelDistribution) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectionOfTravelDistribution)->Clone(); + auto clonedChildIDirectionOfTravelDistribution = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectionOfTravelDistribution(std::dynamic_pointer_cast(clonedChildIDirectionOfTravelDistribution)); + } + return clonedObject; + } + + std::string TrafficSwarmActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSwarmActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CENTRAL_OBJECT) + { + return std::dynamic_pointer_cast(GetCentralObject()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION) + { + return std::dynamic_pointer_cast(GetTrafficDefinition()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetTrafficDistribution()); + } + + if (key == OSC_CONSTANTS::ELEMENT__INITIAL_SPEED_RANGE) + { + return std::dynamic_pointer_cast(GetInitialSpeedRange()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTION_OF_TRAVEL_DISTRIBUTION) + { + return std::dynamic_pointer_cast(GetDirectionOfTravelDistribution()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrafficSwarmActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrafficSwarmActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrafficSwarmActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrafficSwarmActionImpl::ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES) + { + // Simple type + _numberOfVehicles = value; + AddResolvedParameter(attributeKey); + _isSetNumberOfVehicles = true; + } + + } + void TrafficSwarmActionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS) + { + // Simple type + _innerRadius = value; + AddResolvedParameter(attributeKey); + _isSetInnerRadius = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__OFFSET) + { + // Simple type + _offset = value; + AddResolvedParameter(attributeKey); + _isSetOffset = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS) + { + // Simple type + _semiMajorAxis = value; + AddResolvedParameter(attributeKey); + _isSetSemiMajorAxis = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS) + { + // Simple type + _semiMinorAxis = value; + AddResolvedParameter(attributeKey); + _isSetSemiMinorAxis = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VELOCITY) + { + // Simple type + _velocity = value; + AddResolvedParameter(attributeKey); + _isSetVelocity = true; + } + + } + + + bool TrafficSwarmActionImpl::IsSetInnerRadius() const + { + return _isSetInnerRadius; + } + bool TrafficSwarmActionImpl::IsSetNumberOfVehicles() const + { + return _isSetNumberOfVehicles; + } + bool TrafficSwarmActionImpl::IsSetOffset() const + { + return _isSetOffset; + } + bool TrafficSwarmActionImpl::IsSetSemiMajorAxis() const + { + return _isSetSemiMajorAxis; + } + bool TrafficSwarmActionImpl::IsSetSemiMinorAxis() const + { + return _isSetSemiMinorAxis; + } + void TrafficSwarmActionImpl::ResetVelocity() + { + _isSetVelocity = false; + _velocity = {}; + + } + bool TrafficSwarmActionImpl::IsSetVelocity() const + { + return _isSetVelocity; + } + bool TrafficSwarmActionImpl::IsSetCentralObject() const + { + return _isSetCentralObject; + } + void TrafficSwarmActionImpl::ResetTrafficDefinition() + { + _isSetTrafficDefinition = false; + _trafficDefinition = {}; + + } + bool TrafficSwarmActionImpl::IsSetTrafficDefinition() const + { + return _isSetTrafficDefinition; + } + void TrafficSwarmActionImpl::ResetTrafficDistribution() + { + _isSetTrafficDistribution = false; + _trafficDistribution = {}; + + } + bool TrafficSwarmActionImpl::IsSetTrafficDistribution() const + { + return _isSetTrafficDistribution; + } + void TrafficSwarmActionImpl::ResetInitialSpeedRange() + { + _isSetInitialSpeedRange = false; + _initialSpeedRange = {}; + + } + bool TrafficSwarmActionImpl::IsSetInitialSpeedRange() const + { + return _isSetInitialSpeedRange; + } + void TrafficSwarmActionImpl::ResetDirectionOfTravelDistribution() + { + _isSetDirectionOfTravelDistribution = false; + _directionOfTravelDistribution = {}; + + } + bool TrafficSwarmActionImpl::IsSetDirectionOfTravelDistribution() const + { + return _isSetDirectionOfTravelDistribution; + } + + IOpenScenarioFlexElement* TrailerImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrailerImpl::GetTrailer() const + { + return _trailer; + } + std::shared_ptr TrailerImpl::GetTrailerRef() const + { + return _trailerRef; + } + + + void TrailerImpl::SetTrailer(std::shared_ptr trailer) + { + _trailer = trailer; + _trailerRef = {}; + _isSetTrailer = true; + } + + void TrailerImpl::SetTrailerRef(std::shared_ptr trailerRef) + { + _trailerRef = trailerRef; + _trailer = {}; + _isSetTrailerRef = true; + } + + std::shared_ptr TrailerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrailerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrailer).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrailerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrailerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrailerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrailerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrailerImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrailerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrailerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrailerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrailerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrailerImpl::GetModelType() const + { + return "Trailer"; + } + + // children + std::shared_ptr TrailerImpl::GetWriterTrailer() const + { + return std::dynamic_pointer_cast(_trailer); + } + std::shared_ptr TrailerImpl::GetWriterTrailerRef() const + { + return std::dynamic_pointer_cast(_trailerRef); + } + + TrailerImpl::TrailerImpl() + { + /** + * Filling the property to type map + */ + } + + void TrailerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrailerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrailerImpl::GetChildren() const + { + std::vector> result; + + const auto kTrailer = GetWriterTrailer(); + if (kTrailer) + { + result.push_back(std::dynamic_pointer_cast(kTrailer)); + } + const auto kTrailerRef = GetWriterTrailerRef(); + if (kTrailerRef) + { + result.push_back(std::dynamic_pointer_cast(kTrailerRef)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrailerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTrailer = GetWriterTrailer(); + if (kTrailer) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailer)->Clone(); + auto clonedChildIScenarioObject = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailer(std::dynamic_pointer_cast(clonedChildIScenarioObject)); + } + const auto kTrailerRef = GetWriterTrailerRef(); + if (kTrailerRef) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailerRef)->Clone(); + auto clonedChildIEntityRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailerRef(std::dynamic_pointer_cast(clonedChildIEntityRef)); + } + return clonedObject; + } + + std::string TrailerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER) + { + return std::dynamic_pointer_cast(GetTrailer()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER_REF) + { + return std::dynamic_pointer_cast(GetTrailerRef()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrailerImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrailerImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrailerImpl::IsSetTrailer() const + { + return _isSetTrailer; + } + bool TrailerImpl::IsSetTrailerRef() const + { + return _isSetTrailerRef; + } + + IOpenScenarioFlexElement* TrailerActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrailerActionImpl::GetConnectTrailerAction() const + { + return _connectTrailerAction; + } + std::shared_ptr TrailerActionImpl::GetDisconnectTrailerAction() const + { + return _disconnectTrailerAction; + } + + + void TrailerActionImpl::SetConnectTrailerAction(std::shared_ptr connectTrailerAction) + { + _connectTrailerAction = connectTrailerAction; + _disconnectTrailerAction = {}; + _isSetConnectTrailerAction = true; + } + + void TrailerActionImpl::SetDisconnectTrailerAction(std::shared_ptr disconnectTrailerAction) + { + _disconnectTrailerAction = disconnectTrailerAction; + _connectTrailerAction = {}; + _isSetDisconnectTrailerAction = true; + } + + std::shared_ptr TrailerActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrailerActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrailerAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrailerActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrailerActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrailerActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrailerActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrailerActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrailerActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrailerActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrailerActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrailerActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrailerActionImpl::GetModelType() const + { + return "TrailerAction"; + } + + // children + std::shared_ptr TrailerActionImpl::GetWriterConnectTrailerAction() const + { + return std::dynamic_pointer_cast(_connectTrailerAction); + } + std::shared_ptr TrailerActionImpl::GetWriterDisconnectTrailerAction() const + { + return std::dynamic_pointer_cast(_disconnectTrailerAction); + } + + TrailerActionImpl::TrailerActionImpl() + { + /** + * Filling the property to type map + */ + } + + void TrailerActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrailerActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrailerActionImpl::GetChildren() const + { + std::vector> result; + + const auto kConnectTrailerAction = GetWriterConnectTrailerAction(); + if (kConnectTrailerAction) + { + result.push_back(std::dynamic_pointer_cast(kConnectTrailerAction)); + } + const auto kDisconnectTrailerAction = GetWriterDisconnectTrailerAction(); + if (kDisconnectTrailerAction) + { + result.push_back(std::dynamic_pointer_cast(kDisconnectTrailerAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrailerActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kConnectTrailerAction = GetWriterConnectTrailerAction(); + if (kConnectTrailerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kConnectTrailerAction)->Clone(); + auto clonedChildIConnectTrailerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetConnectTrailerAction(std::dynamic_pointer_cast(clonedChildIConnectTrailerAction)); + } + const auto kDisconnectTrailerAction = GetWriterDisconnectTrailerAction(); + if (kDisconnectTrailerAction) + { + auto clonedChild = std::dynamic_pointer_cast(kDisconnectTrailerAction)->Clone(); + auto clonedChildIDisconnectTrailerAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDisconnectTrailerAction(std::dynamic_pointer_cast(clonedChildIDisconnectTrailerAction)); + } + return clonedObject; + } + + std::string TrailerActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONNECT_TRAILER_ACTION) + { + return std::dynamic_pointer_cast(GetConnectTrailerAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DISCONNECT_TRAILER_ACTION) + { + return std::dynamic_pointer_cast(GetDisconnectTrailerAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrailerActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrailerActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrailerActionImpl::IsSetConnectTrailerAction() const + { + return _isSetConnectTrailerAction; + } + bool TrailerActionImpl::IsSetDisconnectTrailerAction() const + { + return _isSetDisconnectTrailerAction; + } + + IOpenScenarioFlexElement* TrailerCouplerImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrailerCouplerImpl::GetDx() const + { + return _dx; + } + double TrailerCouplerImpl::GetDz() const + { + return _dz; + } + + + void TrailerCouplerImpl::SetDx(const double dx) + { + _dx = dx; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX); + _isSetDx = true; + } + + void TrailerCouplerImpl::SetDz(const double dz) + { + _dz = dz; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ); + _isSetDz = true; + } + + std::shared_ptr TrailerCouplerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrailerCouplerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrailerCoupler).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrailerCouplerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrailerCouplerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrailerCouplerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrailerCouplerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrailerCouplerImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DX) + { + return GetDx(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + return GetDz(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrailerCouplerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrailerCouplerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrailerCouplerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrailerCouplerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrailerCouplerImpl::GetModelType() const + { + return "TrailerCoupler"; + } + + void TrailerCouplerImpl::WriteParameterToDx(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, parameterName, nullTextMarker /*no textmarker*/); + _dx = {}; + } + + void TrailerCouplerImpl::WriteParameterToDz(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, parameterName, nullTextMarker /*no textmarker*/); + _dz = {}; + } + + std::string TrailerCouplerImpl::GetParameterFromDx() const + { + auto dx = OSC_CONSTANTS::ATTRIBUTE__DX; + return GetParameterNameFromAttribute(dx); + } + + std::string TrailerCouplerImpl::GetParameterFromDz() const + { + auto dz = OSC_CONSTANTS::ATTRIBUTE__DZ; + return GetParameterNameFromAttribute(dz); + } + + bool TrailerCouplerImpl::IsDxParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DX); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrailerCouplerImpl::IsDzParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DZ); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrailerCouplerImpl::TrailerCouplerImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DX, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DZ, SimpleType::DOUBLE); + } + + void TrailerCouplerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + } + + SimpleType TrailerCouplerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrailerCouplerImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrailerCouplerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dx = GetDx(); + // Simple type + clonedObject->_dz = GetDz(); + // clone indicators + clonedObject->_isSetDz = _isSetDz; + // clone children + return clonedObject; + } + + std::string TrailerCouplerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerCouplerImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrailerCouplerImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerCouplerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrailerCouplerImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrailerCouplerImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = value; + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = value; + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + + } + + + bool TrailerCouplerImpl::IsSetDx() const + { + return _isSetDx; + } + void TrailerCouplerImpl::ResetDz() + { + _isSetDz = false; + _dz = {}; + + } + bool TrailerCouplerImpl::IsSetDz() const + { + return _isSetDz; + } + + IOpenScenarioFlexElement* TrailerHitchImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrailerHitchImpl::GetDx() const + { + return _dx; + } + double TrailerHitchImpl::GetDz() const + { + return _dz; + } + + + void TrailerHitchImpl::SetDx(const double dx) + { + _dx = dx; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX); + _isSetDx = true; + } + + void TrailerHitchImpl::SetDz(const double dz) + { + _dz = dz; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ); + _isSetDz = true; + } + + std::shared_ptr TrailerHitchImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrailerHitchImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrailerHitch).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrailerHitchWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrailerHitchImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrailerHitchImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrailerHitchImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrailerHitchImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DX) + { + return GetDx(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + return GetDz(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrailerHitchImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrailerHitchImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrailerHitchImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrailerHitchImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrailerHitchImpl::GetModelType() const + { + return "TrailerHitch"; + } + + void TrailerHitchImpl::WriteParameterToDx(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, parameterName, nullTextMarker /*no textmarker*/); + _dx = {}; + } + + void TrailerHitchImpl::WriteParameterToDz(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, parameterName, nullTextMarker /*no textmarker*/); + _dz = {}; + } + + std::string TrailerHitchImpl::GetParameterFromDx() const + { + auto dx = OSC_CONSTANTS::ATTRIBUTE__DX; + return GetParameterNameFromAttribute(dx); + } + + std::string TrailerHitchImpl::GetParameterFromDz() const + { + auto dz = OSC_CONSTANTS::ATTRIBUTE__DZ; + return GetParameterNameFromAttribute(dz); + } + + bool TrailerHitchImpl::IsDxParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DX); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrailerHitchImpl::IsDzParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DZ); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrailerHitchImpl::TrailerHitchImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DX, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DZ, SimpleType::DOUBLE); + } + + void TrailerHitchImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + } + + SimpleType TrailerHitchImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrailerHitchImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrailerHitchImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_dx = GetDx(); + // Simple type + clonedObject->_dz = GetDz(); + // clone indicators + clonedObject->_isSetDz = _isSetDz; + // clone children + return clonedObject; + } + + std::string TrailerHitchImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerHitchImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrailerHitchImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrailerHitchImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrailerHitchImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrailerHitchImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DX) + { + // Simple type + _dx = value; + AddResolvedParameter(attributeKey); + _isSetDx = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DZ) + { + // Simple type + _dz = value; + AddResolvedParameter(attributeKey); + _isSetDz = true; + } + + } + + + bool TrailerHitchImpl::IsSetDx() const + { + return _isSetDx; + } + void TrailerHitchImpl::ResetDz() + { + _isSetDz = false; + _dz = {}; + + } + bool TrailerHitchImpl::IsSetDz() const + { + return _isSetDz; + } + + IOpenScenarioFlexElement* TrajectoryImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool TrajectoryImpl::GetClosed() const + { + return _closed; + } + std::string TrajectoryImpl::GetName() const + { + return _name; + } + std::vector> TrajectoryImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> TrajectoryImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int TrajectoryImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr TrajectoryImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr TrajectoryImpl::GetShape() const + { + return _shape; + } + + + void TrajectoryImpl::SetClosed(const bool closed) + { + _closed = closed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED); + _isSetClosed = true; + } + + void TrajectoryImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void TrajectoryImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void TrajectoryImpl::SetShape(std::shared_ptr shape) + { + _shape = shape; + _isSetShape = true; + } + + std::shared_ptr TrajectoryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrajectoryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrajectory).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrajectoryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrajectoryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrajectoryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrajectoryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrajectoryImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrajectoryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrajectoryImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + return GetClosed(); + } + throw KeyNotSupportedException(); + + } + + DateTime TrajectoryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrajectoryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrajectoryImpl::GetModelType() const + { + return "Trajectory"; + } + + void TrajectoryImpl::WriteParameterToClosed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED, parameterName, nullTextMarker /*no textmarker*/); + _closed = {}; + } + + void TrajectoryImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + std::string TrajectoryImpl::GetParameterFromClosed() const + { + auto closed = OSC_CONSTANTS::ATTRIBUTE__CLOSED; + return GetParameterNameFromAttribute(closed); + } + + std::string TrajectoryImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + bool TrajectoryImpl::IsClosedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CLOSED); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrajectoryImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrajectoryImpl::GetWriterShape() const + { + return std::dynamic_pointer_cast(_shape); + } + + TrajectoryImpl::TrajectoryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CLOSED, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + } + + void TrajectoryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + // Simple type + _closed = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetClosed = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + } + + SimpleType TrajectoryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool TrajectoryImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> TrajectoryImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrajectoryImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kShape = GetWriterShape(); + if (kShape) + { + result.push_back(std::dynamic_pointer_cast(kShape)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrajectoryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_closed = GetClosed(); + // Simple type + clonedObject->_name = GetName(); + // clone indicators + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kShape = GetWriterShape(); + if (kShape) + { + auto clonedChild = std::dynamic_pointer_cast(kShape)->Clone(); + auto clonedChildIShape = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetShape(std::dynamic_pointer_cast(clonedChildIShape)); + } + return clonedObject; + } + + std::string TrajectoryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SHAPE) + { + return std::dynamic_pointer_cast(GetShape()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrajectoryImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrajectoryImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrajectoryImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CLOSED) + { + // Simple type + _closed = value; + AddResolvedParameter(attributeKey); + _isSetClosed = true; + } + + } + void TrajectoryImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + + + bool TrajectoryImpl::IsSetClosed() const + { + return _isSetClosed; + } + bool TrajectoryImpl::IsSetName() const + { + return _isSetName; + } + void TrajectoryImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool TrajectoryImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool TrajectoryImpl::IsSetShape() const + { + return _isSetShape; + } + + IOpenScenarioFlexElement* TrajectoryCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrajectoryCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void TrajectoryCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr TrajectoryCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrajectoryCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrajectoryCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrajectoryCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrajectoryCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrajectoryCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrajectoryCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrajectoryCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrajectoryCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrajectoryCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrajectoryCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrajectoryCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrajectoryCatalogLocationImpl::GetModelType() const + { + return "TrajectoryCatalogLocation"; + } + + // children + std::shared_ptr TrajectoryCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + TrajectoryCatalogLocationImpl::TrajectoryCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void TrajectoryCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrajectoryCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrajectoryCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrajectoryCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string TrajectoryCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrajectoryCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrajectoryCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrajectoryCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* TrajectoryFollowingModeImpl::GetOpenScenarioFlexElement() + { + return this; + } + FollowingMode TrajectoryFollowingModeImpl::GetFollowingMode() const + { + return _followingMode; + } + + + void TrajectoryFollowingModeImpl::SetFollowingMode(const FollowingMode followingMode) + { + _followingMode = followingMode; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + _isSetFollowingMode = true; + } + + std::shared_ptr TrajectoryFollowingModeImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrajectoryFollowingModeImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrajectoryFollowingMode).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrajectoryFollowingModeWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrajectoryFollowingModeImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrajectoryFollowingModeImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrajectoryFollowingModeImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrajectoryFollowingModeImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrajectoryFollowingModeImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrajectoryFollowingModeImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrajectoryFollowingModeImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrajectoryFollowingModeImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrajectoryFollowingModeImpl::GetModelType() const + { + return "TrajectoryFollowingMode"; + } + + void TrajectoryFollowingModeImpl::WriteParameterToFollowingMode(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, parameterName, nullTextMarker /*no textmarker*/); + _followingMode = {}; + } + + std::string TrajectoryFollowingModeImpl::GetParameterFromFollowingMode() const + { + auto followingMode = OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE; + return GetParameterNameFromAttribute(followingMode); + } + + bool TrajectoryFollowingModeImpl::IsFollowingModeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TrajectoryFollowingModeImpl::TrajectoryFollowingModeImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, SimpleType::ENUM_TYPE); + } + + void TrajectoryFollowingModeImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(parameterLiteralValue); + if (kResult != FollowingMode::UNKNOWN) + { + _followingMode = kResult; + AddResolvedParameter(attributeKey); + _isSetFollowingMode = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType TrajectoryFollowingModeImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrajectoryFollowingModeImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrajectoryFollowingModeImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kFollowingMode = GetFollowingMode(); + if ( kFollowingMode.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_followingMode = FollowingMode::GetFromLiteral(kFollowingMode.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string TrajectoryFollowingModeImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryFollowingModeImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TrajectoryFollowingModeImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryFollowingModeImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrajectoryFollowingModeImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + auto followingMode = GetFollowingMode(); + return followingMode.GetLiteral() != "UNKNOWN" ? followingMode.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool TrajectoryFollowingModeImpl::IsSetFollowingMode() const + { + return _isSetFollowingMode; + } + + IOpenScenarioFlexElement* TrajectoryPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TrajectoryPositionImpl::GetS() const + { + return _s; + } + double TrajectoryPositionImpl::GetT() const + { + return _t; + } + std::shared_ptr TrajectoryPositionImpl::GetOrientation() const + { + return _orientation; + } + std::shared_ptr TrajectoryPositionImpl::GetTrajectoryRef() const + { + return _trajectoryRef; + } + + + void TrajectoryPositionImpl::SetS(const double s) + { + _s = s; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S); + _isSetS = true; + } + + void TrajectoryPositionImpl::SetT(const double t) + { + _t = t; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T); + _isSetT = true; + } + + void TrajectoryPositionImpl::SetOrientation(std::shared_ptr orientation) + { + _orientation = orientation; + _isSetOrientation = true; + } + + void TrajectoryPositionImpl::SetTrajectoryRef(std::shared_ptr trajectoryRef) + { + _trajectoryRef = trajectoryRef; + _isSetTrajectoryRef = true; + } + + std::shared_ptr TrajectoryPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrajectoryPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrajectoryPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrajectoryPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrajectoryPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrajectoryPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrajectoryPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrajectoryPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__S) + { + return GetS(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__T) + { + return GetT(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TrajectoryPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrajectoryPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrajectoryPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrajectoryPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrajectoryPositionImpl::GetModelType() const + { + return "TrajectoryPosition"; + } + + void TrajectoryPositionImpl::WriteParameterToS(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, parameterName, nullTextMarker /*no textmarker*/); + _s = {}; + } + + void TrajectoryPositionImpl::WriteParameterToT(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, parameterName, nullTextMarker /*no textmarker*/); + _t = {}; + } + + std::string TrajectoryPositionImpl::GetParameterFromS() const + { + auto s = OSC_CONSTANTS::ATTRIBUTE__S; + return GetParameterNameFromAttribute(s); + } + + std::string TrajectoryPositionImpl::GetParameterFromT() const + { + auto t = OSC_CONSTANTS::ATTRIBUTE__T; + return GetParameterNameFromAttribute(t); + } + + bool TrajectoryPositionImpl::IsSParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__S); + if (kIt != keys.end()) + return true; + return false; + } + + bool TrajectoryPositionImpl::IsTParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__T); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr TrajectoryPositionImpl::GetWriterOrientation() const + { + return std::dynamic_pointer_cast(_orientation); + } + std::shared_ptr TrajectoryPositionImpl::GetWriterTrajectoryRef() const + { + return std::dynamic_pointer_cast(_trajectoryRef); + } + + TrajectoryPositionImpl::TrajectoryPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__S, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__T, SimpleType::DOUBLE); + } + + void TrajectoryPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetT = true; + } + } + + SimpleType TrajectoryPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrajectoryPositionImpl::GetChildren() const + { + std::vector> result; + + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + result.push_back(std::dynamic_pointer_cast(kOrientation)); + } + const auto kTrajectoryRef = GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + result.push_back(std::dynamic_pointer_cast(kTrajectoryRef)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrajectoryPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_s = GetS(); + // Simple type + clonedObject->_t = GetT(); + // clone indicators + clonedObject->_isSetT = _isSetT; + // clone children + const auto kOrientation = GetWriterOrientation(); + if (kOrientation) + { + auto clonedChild = std::dynamic_pointer_cast(kOrientation)->Clone(); + auto clonedChildIOrientation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetOrientation(std::dynamic_pointer_cast(clonedChildIOrientation)); + } + const auto kTrajectoryRef = GetWriterTrajectoryRef(); + if (kTrajectoryRef) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectoryRef)->Clone(); + auto clonedChildITrajectoryRef = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectoryRef(std::dynamic_pointer_cast(clonedChildITrajectoryRef)); + } + return clonedObject; + } + + std::string TrajectoryPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryPositionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ORIENTATION) + { + return std::dynamic_pointer_cast(GetOrientation()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF) + { + return std::dynamic_pointer_cast(GetTrajectoryRef()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrajectoryPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrajectoryPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TrajectoryPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__S) + { + // Simple type + _s = value; + AddResolvedParameter(attributeKey); + _isSetS = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__T) + { + // Simple type + _t = value; + AddResolvedParameter(attributeKey); + _isSetT = true; + } + + } + + + bool TrajectoryPositionImpl::IsSetS() const + { + return _isSetS; + } + void TrajectoryPositionImpl::ResetT() + { + _isSetT = false; + _t = {0}; + + } + bool TrajectoryPositionImpl::IsSetT() const + { + return _isSetT; + } + void TrajectoryPositionImpl::ResetOrientation() + { + _isSetOrientation = false; + _orientation = {}; + + } + bool TrajectoryPositionImpl::IsSetOrientation() const + { + return _isSetOrientation; + } + bool TrajectoryPositionImpl::IsSetTrajectoryRef() const + { + return _isSetTrajectoryRef; + } + + IOpenScenarioFlexElement* TrajectoryRefImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr TrajectoryRefImpl::GetTrajectory() const + { + return _trajectory; + } + std::shared_ptr TrajectoryRefImpl::GetCatalogReference() const + { + return _catalogReference; + } + + + void TrajectoryRefImpl::SetTrajectory(std::shared_ptr trajectory) + { + _trajectory = trajectory; + _catalogReference = {}; + _isSetTrajectory = true; + } + + void TrajectoryRefImpl::SetCatalogReference(std::shared_ptr catalogReference) + { + _catalogReference = catalogReference; + _trajectory = {}; + _isSetCatalogReference = true; + } + + std::shared_ptr TrajectoryRefImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TrajectoryRefImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrajectoryRef).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITrajectoryRefWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TrajectoryRefImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TrajectoryRefImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TrajectoryRefImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TrajectoryRefImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TrajectoryRefImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TrajectoryRefImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TrajectoryRefImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TrajectoryRefImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TrajectoryRefImpl::GetModelType() const + { + return "TrajectoryRef"; + } + + // children + std::shared_ptr TrajectoryRefImpl::GetWriterTrajectory() const + { + return std::dynamic_pointer_cast(_trajectory); + } + std::shared_ptr TrajectoryRefImpl::GetWriterCatalogReference() const + { + return std::dynamic_pointer_cast(_catalogReference); + } + + TrajectoryRefImpl::TrajectoryRefImpl() + { + /** + * Filling the property to type map + */ + } + + void TrajectoryRefImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TrajectoryRefImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TrajectoryRefImpl::GetChildren() const + { + std::vector> result; + + const auto kTrajectory = GetWriterTrajectory(); + if (kTrajectory) + { + result.push_back(std::dynamic_pointer_cast(kTrajectory)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + result.push_back(std::dynamic_pointer_cast(kCatalogReference)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TrajectoryRefImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kTrajectory = GetWriterTrajectory(); + if (kTrajectory) + { + auto clonedChild = std::dynamic_pointer_cast(kTrajectory)->Clone(); + auto clonedChildITrajectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrajectory(std::dynamic_pointer_cast(clonedChildITrajectory)); + } + const auto kCatalogReference = GetWriterCatalogReference(); + if (kCatalogReference) + { + auto clonedChild = std::dynamic_pointer_cast(kCatalogReference)->Clone(); + auto clonedChildICatalogReference = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCatalogReference(std::dynamic_pointer_cast(clonedChildICatalogReference)); + } + return clonedObject; + } + + std::string TrajectoryRefImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryRefImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAJECTORY) + { + return std::dynamic_pointer_cast(GetTrajectory()); + } + + if (key == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE) + { + return std::dynamic_pointer_cast(GetCatalogReference()); + } + throw KeyNotSupportedException(); + } + + std::vector> TrajectoryRefImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TrajectoryRefImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TrajectoryRefImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool TrajectoryRefImpl::IsSetTrajectory() const + { + return _isSetTrajectory; + } + bool TrajectoryRefImpl::IsSetCatalogReference() const + { + return _isSetCatalogReference; + } + + IOpenScenarioFlexElement* TransitionDynamicsImpl::GetOpenScenarioFlexElement() + { + return this; + } + DynamicsDimension TransitionDynamicsImpl::GetDynamicsDimension() const + { + return _dynamicsDimension; + } + DynamicsShape TransitionDynamicsImpl::GetDynamicsShape() const + { + return _dynamicsShape; + } + FollowingMode TransitionDynamicsImpl::GetFollowingMode() const + { + return _followingMode; + } + double TransitionDynamicsImpl::GetValue() const + { + return _value; + } + + + void TransitionDynamicsImpl::SetDynamicsDimension(const DynamicsDimension dynamicsDimension) + { + _dynamicsDimension = dynamicsDimension; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION); + _isSetDynamicsDimension = true; + } + + void TransitionDynamicsImpl::SetDynamicsShape(const DynamicsShape dynamicsShape) + { + _dynamicsShape = dynamicsShape; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE); + _isSetDynamicsShape = true; + } + + void TransitionDynamicsImpl::SetFollowingMode(const FollowingMode followingMode) + { + _followingMode = followingMode; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + _isSetFollowingMode = true; + } + + void TransitionDynamicsImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr TransitionDynamicsImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TransitionDynamicsImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITransitionDynamics).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITransitionDynamicsWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TransitionDynamicsImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TransitionDynamicsImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TransitionDynamicsImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TransitionDynamicsImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TransitionDynamicsImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TransitionDynamicsImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TransitionDynamicsImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TransitionDynamicsImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TransitionDynamicsImpl::GetModelType() const + { + return "TransitionDynamics"; + } + + void TransitionDynamicsImpl::WriteParameterToDynamicsDimension(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, parameterName, nullTextMarker /*no textmarker*/); + _dynamicsDimension = {}; + } + + void TransitionDynamicsImpl::WriteParameterToDynamicsShape(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, parameterName, nullTextMarker /*no textmarker*/); + _dynamicsShape = {}; + } + + void TransitionDynamicsImpl::WriteParameterToFollowingMode(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, parameterName, nullTextMarker /*no textmarker*/); + _followingMode = {}; + } + + void TransitionDynamicsImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string TransitionDynamicsImpl::GetParameterFromDynamicsDimension() const + { + auto dynamicsDimension = OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION; + return GetParameterNameFromAttribute(dynamicsDimension); + } + + std::string TransitionDynamicsImpl::GetParameterFromDynamicsShape() const + { + auto dynamicsShape = OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE; + return GetParameterNameFromAttribute(dynamicsShape); + } + + std::string TransitionDynamicsImpl::GetParameterFromFollowingMode() const + { + auto followingMode = OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE; + return GetParameterNameFromAttribute(followingMode); + } + + std::string TransitionDynamicsImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool TransitionDynamicsImpl::IsDynamicsDimensionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION); + if (kIt != keys.end()) + return true; + return false; + } + + bool TransitionDynamicsImpl::IsDynamicsShapeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TransitionDynamicsImpl::IsFollowingModeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE); + if (kIt != keys.end()) + return true; + return false; + } + + bool TransitionDynamicsImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TransitionDynamicsImpl::TransitionDynamicsImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void TransitionDynamicsImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION) + { + // Enumeration Type + const auto kResult = DynamicsDimension::GetFromLiteral(parameterLiteralValue); + if (kResult != DynamicsDimension::UNKNOWN) + { + _dynamicsDimension = kResult; + AddResolvedParameter(attributeKey); + _isSetDynamicsDimension = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE) + { + // Enumeration Type + const auto kResult = DynamicsShape::GetFromLiteral(parameterLiteralValue); + if (kResult != DynamicsShape::UNKNOWN) + { + _dynamicsShape = kResult; + AddResolvedParameter(attributeKey); + _isSetDynamicsShape = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(parameterLiteralValue); + if (kResult != FollowingMode::UNKNOWN) + { + _followingMode = kResult; + AddResolvedParameter(attributeKey); + _isSetFollowingMode = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType TransitionDynamicsImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TransitionDynamicsImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TransitionDynamicsImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kDynamicsDimension = GetDynamicsDimension(); + if ( kDynamicsDimension.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_dynamicsDimension = DynamicsDimension::GetFromLiteral(kDynamicsDimension.GetLiteral()); + } + // Enumeration Type + const auto kDynamicsShape = GetDynamicsShape(); + if ( kDynamicsShape.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_dynamicsShape = DynamicsShape::GetFromLiteral(kDynamicsShape.GetLiteral()); + } + // Enumeration Type + const auto kFollowingMode = GetFollowingMode(); + if ( kFollowingMode.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_followingMode = FollowingMode::GetFromLiteral(kFollowingMode.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + clonedObject->_isSetFollowingMode = _isSetFollowingMode; + // clone children + return clonedObject; + } + + std::string TransitionDynamicsImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TransitionDynamicsImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TransitionDynamicsImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TransitionDynamicsImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TransitionDynamicsImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION) + { + auto dynamicsDimension = GetDynamicsDimension(); + return dynamicsDimension.GetLiteral() != "UNKNOWN" ? dynamicsDimension.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE) + { + auto dynamicsShape = GetDynamicsShape(); + return dynamicsShape.GetLiteral() != "UNKNOWN" ? dynamicsShape.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE) + { + auto followingMode = GetFollowingMode(); + return followingMode.GetLiteral() != "UNKNOWN" ? followingMode.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void TransitionDynamicsImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool TransitionDynamicsImpl::IsSetDynamicsDimension() const + { + return _isSetDynamicsDimension; + } + bool TransitionDynamicsImpl::IsSetDynamicsShape() const + { + return _isSetDynamicsShape; + } + void TransitionDynamicsImpl::ResetFollowingMode() + { + _isSetFollowingMode = false; + _followingMode = {FollowingMode::FollowingModeEnum::POSITION}; + + } + bool TransitionDynamicsImpl::IsSetFollowingMode() const + { + return _isSetFollowingMode; + } + bool TransitionDynamicsImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* TraveledDistanceConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double TraveledDistanceConditionImpl::GetValue() const + { + return _value; + } + + + void TraveledDistanceConditionImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr TraveledDistanceConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TraveledDistanceConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITraveledDistanceCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITraveledDistanceConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TraveledDistanceConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TraveledDistanceConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TraveledDistanceConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TraveledDistanceConditionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t TraveledDistanceConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TraveledDistanceConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TraveledDistanceConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TraveledDistanceConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TraveledDistanceConditionImpl::GetModelType() const + { + return "TraveledDistanceCondition"; + } + + void TraveledDistanceConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string TraveledDistanceConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool TraveledDistanceConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TraveledDistanceConditionImpl::TraveledDistanceConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void TraveledDistanceConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType TraveledDistanceConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TraveledDistanceConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TraveledDistanceConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string TraveledDistanceConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TraveledDistanceConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TraveledDistanceConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr TraveledDistanceConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TraveledDistanceConditionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void TraveledDistanceConditionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool TraveledDistanceConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* TriggerImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> TriggerImpl::GetConditionGroups() const + { + std::vector> temp; + for(auto&& elm: _conditionGroups) + temp.push_back(elm); + return temp; + } + std::vector> TriggerImpl::GetWriterConditionGroups() const + { + return _conditionGroups; + } + + int TriggerImpl::GetConditionGroupsSize() const + { + return static_cast(_conditionGroups.size()); + } + + std::shared_ptr TriggerImpl::GetConditionGroupsAtIndex(unsigned int index) const + { + if (index >= 0 && _conditionGroups.size() > index) + { + return _conditionGroups[index]; + } + return nullptr; + } + + + void TriggerImpl::SetConditionGroups(std::vector>& conditionGroups) + { + _conditionGroups = conditionGroups; + _isSetConditionGroups = true; + } + + std::shared_ptr TriggerImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TriggerImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITrigger).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITriggerWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TriggerImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TriggerImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TriggerImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TriggerImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TriggerImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TriggerImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TriggerImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TriggerImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TriggerImpl::GetModelType() const + { + return "Trigger"; + } + + // children + + TriggerImpl::TriggerImpl() + { + /** + * Filling the property to type map + */ + } + + void TriggerImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType TriggerImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TriggerImpl::GetChildren() const + { + std::vector> result; + + auto conditionGroups = GetWriterConditionGroups(); + if (!conditionGroups.empty()) + { + for(auto&& item : conditionGroups) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TriggerImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kConditionGroups = GetWriterConditionGroups(); + if (!kConditionGroups.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kConditionGroups) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetConditionGroups(clonedList); + } + return clonedObject; + } + + std::string TriggerImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TriggerImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TriggerImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CONDITION_GROUP) + { + std::vector> vect; + for (auto&& elem : GetConditionGroups()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TriggerImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TriggerImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + void TriggerImpl::ResetConditionGroups() + { + _isSetConditionGroups = false; + _conditionGroups = {}; + + } + bool TriggerImpl::IsSetConditionGroups() const + { + return _isSetConditionGroups; + } + + IOpenScenarioFlexElement* TriggeringEntitiesImpl::GetOpenScenarioFlexElement() + { + return this; + } + TriggeringEntitiesRule TriggeringEntitiesImpl::GetTriggeringEntitiesRule() const + { + return _triggeringEntitiesRule; + } + std::vector> TriggeringEntitiesImpl::GetEntityRefs() const + { + std::vector> temp; + for(auto&& elm: _entityRefs) + temp.push_back(elm); + return temp; + } + std::vector> TriggeringEntitiesImpl::GetWriterEntityRefs() const + { + return _entityRefs; + } + + int TriggeringEntitiesImpl::GetEntityRefsSize() const + { + return static_cast(_entityRefs.size()); + } + + std::shared_ptr TriggeringEntitiesImpl::GetEntityRefsAtIndex(unsigned int index) const + { + if (index >= 0 && _entityRefs.size() > index) + { + return _entityRefs[index]; + } + return nullptr; + } + + + void TriggeringEntitiesImpl::SetTriggeringEntitiesRule(const TriggeringEntitiesRule triggeringEntitiesRule) + { + _triggeringEntitiesRule = triggeringEntitiesRule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE); + _isSetTriggeringEntitiesRule = true; + } + + void TriggeringEntitiesImpl::SetEntityRefs(std::vector>& entityRefs) + { + _entityRefs = entityRefs; + _isSetEntityRefs = true; + } + + std::shared_ptr TriggeringEntitiesImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(TriggeringEntitiesImpl).name()) + return shared_from_this(); + else if (classifier == typeid(ITriggeringEntities).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(ITriggeringEntitiesWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr TriggeringEntitiesImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t TriggeringEntitiesImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int TriggeringEntitiesImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double TriggeringEntitiesImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t TriggeringEntitiesImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool TriggeringEntitiesImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime TriggeringEntitiesImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr TriggeringEntitiesImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string TriggeringEntitiesImpl::GetModelType() const + { + return "TriggeringEntities"; + } + + void TriggeringEntitiesImpl::WriteParameterToTriggeringEntitiesRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, parameterName, nullTextMarker /*no textmarker*/); + _triggeringEntitiesRule = {}; + } + + std::string TriggeringEntitiesImpl::GetParameterFromTriggeringEntitiesRule() const + { + auto triggeringEntitiesRule = OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE; + return GetParameterNameFromAttribute(triggeringEntitiesRule); + } + + bool TriggeringEntitiesImpl::IsTriggeringEntitiesRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + TriggeringEntitiesImpl::TriggeringEntitiesImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, SimpleType::ENUM_TYPE); + } + + void TriggeringEntitiesImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE) + { + // Enumeration Type + const auto kResult = TriggeringEntitiesRule::GetFromLiteral(parameterLiteralValue); + if (kResult != TriggeringEntitiesRule::UNKNOWN) + { + _triggeringEntitiesRule = kResult; + AddResolvedParameter(attributeKey); + _isSetTriggeringEntitiesRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType TriggeringEntitiesImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> TriggeringEntitiesImpl::GetChildren() const + { + std::vector> result; + + auto entityRefs = GetWriterEntityRefs(); + if (!entityRefs.empty()) + { + for(auto&& item : entityRefs) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr TriggeringEntitiesImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kTriggeringEntitiesRule = GetTriggeringEntitiesRule(); + if ( kTriggeringEntitiesRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_triggeringEntitiesRule = TriggeringEntitiesRule::GetFromLiteral(kTriggeringEntitiesRule.GetLiteral()); + } + // clone indicators + // clone children + const auto kEntityRefs = GetWriterEntityRefs(); + if (!kEntityRefs.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kEntityRefs) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetEntityRefs(clonedList); + } + return clonedObject; + } + + std::string TriggeringEntitiesImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr TriggeringEntitiesImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> TriggeringEntitiesImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ENTITY_REF) + { + std::vector> vect; + for (auto&& elem : GetEntityRefs()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr TriggeringEntitiesImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string TriggeringEntitiesImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE) + { + auto triggeringEntitiesRule = GetTriggeringEntitiesRule(); + return triggeringEntitiesRule.GetLiteral() != "UNKNOWN" ? triggeringEntitiesRule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool TriggeringEntitiesImpl::IsSetTriggeringEntitiesRule() const + { + return _isSetTriggeringEntitiesRule; + } + bool TriggeringEntitiesImpl::IsSetEntityRefs() const + { + return _isSetEntityRefs; + } + + IOpenScenarioFlexElement* UniformDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr UniformDistributionImpl::GetRange() const + { + return _range; + } + + + void UniformDistributionImpl::SetRange(std::shared_ptr range) + { + _range = range; + _isSetRange = true; + } + + std::shared_ptr UniformDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UniformDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUniformDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUniformDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UniformDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UniformDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UniformDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UniformDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UniformDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UniformDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UniformDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UniformDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UniformDistributionImpl::GetModelType() const + { + return "UniformDistribution"; + } + + // children + std::shared_ptr UniformDistributionImpl::GetWriterRange() const + { + return std::dynamic_pointer_cast(_range); + } + + UniformDistributionImpl::UniformDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void UniformDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType UniformDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UniformDistributionImpl::GetChildren() const + { + std::vector> result; + + const auto kRange = GetWriterRange(); + if (kRange) + { + result.push_back(std::dynamic_pointer_cast(kRange)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UniformDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRange = GetWriterRange(); + if (kRange) + { + auto clonedChild = std::dynamic_pointer_cast(kRange)->Clone(); + auto clonedChildIRange = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRange(std::dynamic_pointer_cast(clonedChildIRange)); + } + return clonedObject; + } + + std::string UniformDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr UniformDistributionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RANGE) + { + return std::dynamic_pointer_cast(GetRange()); + } + throw KeyNotSupportedException(); + } + + std::vector> UniformDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UniformDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UniformDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool UniformDistributionImpl::IsSetRange() const + { + return _isSetRange; + } + + IOpenScenarioFlexElement* UsedAreaImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> UsedAreaImpl::GetPositions() const + { + std::vector> temp; + for(auto&& elm: _positions) + temp.push_back(elm); + return temp; + } + std::vector> UsedAreaImpl::GetWriterPositions() const + { + return _positions; + } + + int UsedAreaImpl::GetPositionsSize() const + { + return static_cast(_positions.size()); + } + + std::shared_ptr UsedAreaImpl::GetPositionsAtIndex(unsigned int index) const + { + if (index >= 0 && _positions.size() > index) + { + return _positions[index]; + } + return nullptr; + } + + + void UsedAreaImpl::SetPositions(std::vector>& positions) + { + _positions = positions; + _isSetPositions = true; + } + + std::shared_ptr UsedAreaImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UsedAreaImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUsedArea).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUsedAreaWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UsedAreaImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UsedAreaImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UsedAreaImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UsedAreaImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UsedAreaImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UsedAreaImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UsedAreaImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UsedAreaImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UsedAreaImpl::GetModelType() const + { + return "UsedArea"; + } + + // children + + UsedAreaImpl::UsedAreaImpl() + { + /** + * Filling the property to type map + */ + } + + void UsedAreaImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType UsedAreaImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UsedAreaImpl::GetChildren() const + { + std::vector> result; + + auto positions = GetWriterPositions(); + if (!positions.empty()) + { + for(auto&& item : positions) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UsedAreaImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kPositions = GetWriterPositions(); + if (!kPositions.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kPositions) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetPositions(clonedList); + } + return clonedObject; + } + + std::string UsedAreaImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr UsedAreaImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UsedAreaImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + std::vector> vect; + for (auto&& elem : GetPositions()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UsedAreaImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UsedAreaImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool UsedAreaImpl::IsSetPositions() const + { + return _isSetPositions; + } + + IOpenScenarioFlexElement* UserDefinedActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr UserDefinedActionImpl::GetCustomCommandAction() const + { + return _customCommandAction; + } + + + void UserDefinedActionImpl::SetCustomCommandAction(std::shared_ptr customCommandAction) + { + _customCommandAction = customCommandAction; + _isSetCustomCommandAction = true; + } + + std::shared_ptr UserDefinedActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedActionImpl::GetModelType() const + { + return "UserDefinedAction"; + } + + // children + std::shared_ptr UserDefinedActionImpl::GetWriterCustomCommandAction() const + { + return std::dynamic_pointer_cast(_customCommandAction); + } + + UserDefinedActionImpl::UserDefinedActionImpl() + { + /** + * Filling the property to type map + */ + } + + void UserDefinedActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType UserDefinedActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedActionImpl::GetChildren() const + { + std::vector> result; + + const auto kCustomCommandAction = GetWriterCustomCommandAction(); + if (kCustomCommandAction) + { + result.push_back(std::dynamic_pointer_cast(kCustomCommandAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kCustomCommandAction = GetWriterCustomCommandAction(); + if (kCustomCommandAction) + { + auto clonedChild = std::dynamic_pointer_cast(kCustomCommandAction)->Clone(); + auto clonedChildICustomCommandAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetCustomCommandAction(std::dynamic_pointer_cast(clonedChildICustomCommandAction)); + } + return clonedObject; + } + + std::string UserDefinedActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__CUSTOM_COMMAND_ACTION) + { + return std::dynamic_pointer_cast(GetCustomCommandAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool UserDefinedActionImpl::IsSetCustomCommandAction() const + { + return _isSetCustomCommandAction; + } + + IOpenScenarioFlexElement* UserDefinedAnimationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string UserDefinedAnimationImpl::GetUserDefinedAnimationType() const + { + return _userDefinedAnimationType; + } + + + void UserDefinedAnimationImpl::SetUserDefinedAnimationType(const std::string userDefinedAnimationType) + { + _userDefinedAnimationType = userDefinedAnimationType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE); + _isSetUserDefinedAnimationType = true; + } + + std::shared_ptr UserDefinedAnimationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedAnimationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedAnimation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedAnimationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedAnimationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedAnimationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedAnimationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedAnimationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedAnimationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedAnimationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedAnimationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedAnimationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedAnimationImpl::GetModelType() const + { + return "UserDefinedAnimation"; + } + + void UserDefinedAnimationImpl::WriteParameterToUserDefinedAnimationType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _userDefinedAnimationType = {}; + } + + std::string UserDefinedAnimationImpl::GetParameterFromUserDefinedAnimationType() const + { + auto userDefinedAnimationType = OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE; + return GetParameterNameFromAttribute(userDefinedAnimationType); + } + + bool UserDefinedAnimationImpl::IsUserDefinedAnimationTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + UserDefinedAnimationImpl::UserDefinedAnimationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, SimpleType::STRING); + } + + void UserDefinedAnimationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE) + { + // Simple type + _userDefinedAnimationType = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetUserDefinedAnimationType = true; + } + } + + SimpleType UserDefinedAnimationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedAnimationImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedAnimationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_userDefinedAnimationType = GetUserDefinedAnimationType(); + // clone indicators + // clone children + return clonedObject; + } + + std::string UserDefinedAnimationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE) + { + return GetUserDefinedAnimationType(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedAnimationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedAnimationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedAnimationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedAnimationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void UserDefinedAnimationImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE) + { + // Simple type + _userDefinedAnimationType = value; + AddResolvedParameter(attributeKey); + _isSetUserDefinedAnimationType = true; + } + + } + + + bool UserDefinedAnimationImpl::IsSetUserDefinedAnimationType() const + { + return _isSetUserDefinedAnimationType; + } + + IOpenScenarioFlexElement* UserDefinedComponentImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string UserDefinedComponentImpl::GetUserDefinedComponentType() const + { + return _userDefinedComponentType; + } + + + void UserDefinedComponentImpl::SetUserDefinedComponentType(const std::string userDefinedComponentType) + { + _userDefinedComponentType = userDefinedComponentType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE); + _isSetUserDefinedComponentType = true; + } + + std::shared_ptr UserDefinedComponentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedComponentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedComponent).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedComponentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedComponentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedComponentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedComponentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedComponentImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedComponentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedComponentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedComponentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedComponentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedComponentImpl::GetModelType() const + { + return "UserDefinedComponent"; + } + + void UserDefinedComponentImpl::WriteParameterToUserDefinedComponentType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _userDefinedComponentType = {}; + } + + std::string UserDefinedComponentImpl::GetParameterFromUserDefinedComponentType() const + { + auto userDefinedComponentType = OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE; + return GetParameterNameFromAttribute(userDefinedComponentType); + } + + bool UserDefinedComponentImpl::IsUserDefinedComponentTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + UserDefinedComponentImpl::UserDefinedComponentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, SimpleType::STRING); + } + + void UserDefinedComponentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE) + { + // Simple type + _userDefinedComponentType = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetUserDefinedComponentType = true; + } + } + + SimpleType UserDefinedComponentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedComponentImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedComponentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_userDefinedComponentType = GetUserDefinedComponentType(); + // clone indicators + // clone children + return clonedObject; + } + + std::string UserDefinedComponentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE) + { + return GetUserDefinedComponentType(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedComponentImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedComponentImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedComponentImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedComponentImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void UserDefinedComponentImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE) + { + // Simple type + _userDefinedComponentType = value; + AddResolvedParameter(attributeKey); + _isSetUserDefinedComponentType = true; + } + + } + + + bool UserDefinedComponentImpl::IsSetUserDefinedComponentType() const + { + return _isSetUserDefinedComponentType; + } + + IOpenScenarioFlexElement* UserDefinedDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string UserDefinedDistributionImpl::GetContent() const + { + return _content; + } + std::string UserDefinedDistributionImpl::GetType() const + { + return _type; + } + + + void UserDefinedDistributionImpl::SetContent(const std::string content) + { + _content = content; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT); + _isSetContent = true; + } + + void UserDefinedDistributionImpl::SetType(const std::string type) + { + _type = type; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE); + _isSetType = true; + } + + std::shared_ptr UserDefinedDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedDistributionImpl::GetModelType() const + { + return "UserDefinedDistribution"; + } + + void UserDefinedDistributionImpl::WriteParameterToContent(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTENT, parameterName, nullTextMarker /*no textmarker*/); + _content = {}; + } + + void UserDefinedDistributionImpl::WriteParameterToType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, parameterName, nullTextMarker /*no textmarker*/); + _type = {}; + } + + std::string UserDefinedDistributionImpl::GetParameterFromContent() const + { + auto content = OSC_CONSTANTS::ATTRIBUTE__CONTENT; + return GetParameterNameFromAttribute(content); + } + + std::string UserDefinedDistributionImpl::GetParameterFromType() const + { + auto type = OSC_CONSTANTS::ATTRIBUTE__TYPE; + return GetParameterNameFromAttribute(type); + } + + bool UserDefinedDistributionImpl::IsContentParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CONTENT); + if (kIt != keys.end()) + return true; + return false; + } + + bool UserDefinedDistributionImpl::IsTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + UserDefinedDistributionImpl::UserDefinedDistributionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CONTENT, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TYPE, SimpleType::STRING); + } + + void UserDefinedDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Simple type + _type = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetType = true; + } + } + + SimpleType UserDefinedDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedDistributionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_type = GetType(); + // clone indicators + // clone children + return clonedObject; + } + + std::string UserDefinedDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + return GetContent(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + return GetType(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedDistributionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void UserDefinedDistributionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CONTENT) + { + // Simple type + _content = value; + AddResolvedParameter(attributeKey); + _isSetContent = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TYPE) + { + // Simple type + _type = value; + AddResolvedParameter(attributeKey); + _isSetType = true; + } + + } + + + bool UserDefinedDistributionImpl::IsSetContent() const + { + return _isSetContent; + } + bool UserDefinedDistributionImpl::IsSetType() const + { + return _isSetType; + } + + IOpenScenarioFlexElement* UserDefinedLightImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string UserDefinedLightImpl::GetUserDefinedLightType() const + { + return _userDefinedLightType; + } + + + void UserDefinedLightImpl::SetUserDefinedLightType(const std::string userDefinedLightType) + { + _userDefinedLightType = userDefinedLightType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE); + _isSetUserDefinedLightType = true; + } + + std::shared_ptr UserDefinedLightImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedLightImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedLight).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedLightWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedLightImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedLightImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedLightImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedLightImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedLightImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedLightImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedLightImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedLightImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedLightImpl::GetModelType() const + { + return "UserDefinedLight"; + } + + void UserDefinedLightImpl::WriteParameterToUserDefinedLightType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _userDefinedLightType = {}; + } + + std::string UserDefinedLightImpl::GetParameterFromUserDefinedLightType() const + { + auto userDefinedLightType = OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE; + return GetParameterNameFromAttribute(userDefinedLightType); + } + + bool UserDefinedLightImpl::IsUserDefinedLightTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + UserDefinedLightImpl::UserDefinedLightImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, SimpleType::STRING); + } + + void UserDefinedLightImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE) + { + // Simple type + _userDefinedLightType = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetUserDefinedLightType = true; + } + } + + SimpleType UserDefinedLightImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedLightImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedLightImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_userDefinedLightType = GetUserDefinedLightType(); + // clone indicators + // clone children + return clonedObject; + } + + std::string UserDefinedLightImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE) + { + return GetUserDefinedLightType(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedLightImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedLightImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedLightImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedLightImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void UserDefinedLightImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE) + { + // Simple type + _userDefinedLightType = value; + AddResolvedParameter(attributeKey); + _isSetUserDefinedLightType = true; + } + + } + + + bool UserDefinedLightImpl::IsSetUserDefinedLightType() const + { + return _isSetUserDefinedLightType; + } + + IOpenScenarioFlexElement* UserDefinedValueConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string UserDefinedValueConditionImpl::GetName() const + { + return _name; + } + Rule UserDefinedValueConditionImpl::GetRule() const + { + return _rule; + } + std::string UserDefinedValueConditionImpl::GetValue() const + { + return _value; + } + + + void UserDefinedValueConditionImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void UserDefinedValueConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void UserDefinedValueConditionImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr UserDefinedValueConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(UserDefinedValueConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IUserDefinedValueCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IUserDefinedValueConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr UserDefinedValueConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t UserDefinedValueConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int UserDefinedValueConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double UserDefinedValueConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t UserDefinedValueConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool UserDefinedValueConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime UserDefinedValueConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr UserDefinedValueConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string UserDefinedValueConditionImpl::GetModelType() const + { + return "UserDefinedValueCondition"; + } + + void UserDefinedValueConditionImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void UserDefinedValueConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void UserDefinedValueConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string UserDefinedValueConditionImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string UserDefinedValueConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string UserDefinedValueConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool UserDefinedValueConditionImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool UserDefinedValueConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool UserDefinedValueConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + UserDefinedValueConditionImpl::UserDefinedValueConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void UserDefinedValueConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType UserDefinedValueConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> UserDefinedValueConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr UserDefinedValueConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string UserDefinedValueConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedValueConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> UserDefinedValueConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr UserDefinedValueConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string UserDefinedValueConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void UserDefinedValueConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool UserDefinedValueConditionImpl::IsSetName() const + { + return _isSetName; + } + bool UserDefinedValueConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool UserDefinedValueConditionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ValueConstraintImpl::GetOpenScenarioFlexElement() + { + return this; + } + Rule ValueConstraintImpl::GetRule() const + { + return _rule; + } + std::string ValueConstraintImpl::GetValue() const + { + return _value; + } + + + void ValueConstraintImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void ValueConstraintImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr ValueConstraintImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ValueConstraintImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IValueConstraint).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IValueConstraintWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ValueConstraintImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ValueConstraintImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ValueConstraintImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ValueConstraintImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ValueConstraintImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ValueConstraintImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ValueConstraintImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ValueConstraintImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ValueConstraintImpl::GetModelType() const + { + return "ValueConstraint"; + } + + void ValueConstraintImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void ValueConstraintImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string ValueConstraintImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string ValueConstraintImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool ValueConstraintImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool ValueConstraintImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + ValueConstraintImpl::ValueConstraintImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void ValueConstraintImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType ValueConstraintImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ValueConstraintImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ValueConstraintImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string ValueConstraintImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueConstraintImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ValueConstraintImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueConstraintImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ValueConstraintImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void ValueConstraintImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + bool ValueConstraintImpl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + + bool ValueConstraintImpl::IsSetRule() const + { + return _isSetRule; + } + bool ValueConstraintImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* ValueConstraintGroupImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ValueConstraintGroupImpl::GetConstraints() const + { + std::vector> temp; + for(auto&& elm: _constraints) + temp.push_back(elm); + return temp; + } + std::vector> ValueConstraintGroupImpl::GetWriterConstraints() const + { + return _constraints; + } + + int ValueConstraintGroupImpl::GetConstraintsSize() const + { + return static_cast(_constraints.size()); + } + + std::shared_ptr ValueConstraintGroupImpl::GetConstraintsAtIndex(unsigned int index) const + { + if (index >= 0 && _constraints.size() > index) + { + return _constraints[index]; + } + return nullptr; + } + + + void ValueConstraintGroupImpl::SetConstraints(std::vector>& constraints) + { + _constraints = constraints; + _isSetConstraints = true; + } + + std::shared_ptr ValueConstraintGroupImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ValueConstraintGroupImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IValueConstraintGroup).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IValueConstraintGroupWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ValueConstraintGroupImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ValueConstraintGroupImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ValueConstraintGroupImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ValueConstraintGroupImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ValueConstraintGroupImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ValueConstraintGroupImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ValueConstraintGroupImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ValueConstraintGroupImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ValueConstraintGroupImpl::GetModelType() const + { + return "ValueConstraintGroup"; + } + + // children + + ValueConstraintGroupImpl::ValueConstraintGroupImpl() + { + /** + * Filling the property to type map + */ + } + + void ValueConstraintGroupImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ValueConstraintGroupImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ValueConstraintGroupImpl::GetChildren() const + { + std::vector> result; + + auto constraints = GetWriterConstraints(); + if (!constraints.empty()) + { + for(auto&& item : constraints) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ValueConstraintGroupImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kConstraints = GetWriterConstraints(); + if (!kConstraints.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kConstraints) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetConstraints(clonedList); + } + return clonedObject; + } + + std::string ValueConstraintGroupImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueConstraintGroupImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ValueConstraintGroupImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VALUE_CONSTRAINT) + { + std::vector> vect; + for (auto&& elem : GetConstraints()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueConstraintGroupImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ValueConstraintGroupImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ValueConstraintGroupImpl::IsSetConstraints() const + { + return _isSetConstraints; + } + + IOpenScenarioFlexElement* ValueSetDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> ValueSetDistributionImpl::GetParameterValueSets() const + { + std::vector> temp; + for(auto&& elm: _parameterValueSets) + temp.push_back(elm); + return temp; + } + std::vector> ValueSetDistributionImpl::GetWriterParameterValueSets() const + { + return _parameterValueSets; + } + + int ValueSetDistributionImpl::GetParameterValueSetsSize() const + { + return static_cast(_parameterValueSets.size()); + } + + std::shared_ptr ValueSetDistributionImpl::GetParameterValueSetsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterValueSets.size() > index) + { + return _parameterValueSets[index]; + } + return nullptr; + } + + + void ValueSetDistributionImpl::SetParameterValueSets(std::vector>& parameterValueSets) + { + _parameterValueSets = parameterValueSets; + _isSetParameterValueSets = true; + } + + std::shared_ptr ValueSetDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(ValueSetDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IValueSetDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IValueSetDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr ValueSetDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t ValueSetDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int ValueSetDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double ValueSetDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t ValueSetDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool ValueSetDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime ValueSetDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr ValueSetDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string ValueSetDistributionImpl::GetModelType() const + { + return "ValueSetDistribution"; + } + + // children + + ValueSetDistributionImpl::ValueSetDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void ValueSetDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType ValueSetDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> ValueSetDistributionImpl::GetChildren() const + { + std::vector> result; + + auto parameterValueSets = GetWriterParameterValueSets(); + if (!parameterValueSets.empty()) + { + for(auto&& item : parameterValueSets) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr ValueSetDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kParameterValueSets = GetWriterParameterValueSets(); + if (!kParameterValueSets.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterValueSets) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterValueSets(clonedList); + } + return clonedObject; + } + + std::string ValueSetDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueSetDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> ValueSetDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_SET) + { + std::vector> vect; + for (auto&& elem : GetParameterValueSets()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr ValueSetDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string ValueSetDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool ValueSetDistributionImpl::IsSetParameterValueSets() const + { + return _isSetParameterValueSets; + } + + IOpenScenarioFlexElement* VariableActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr> VariableActionImpl::GetVariableRef() const + { + return _variableRef; + } + std::shared_ptr VariableActionImpl::GetSetAction() const + { + return _setAction; + } + std::shared_ptr VariableActionImpl::GetModifyAction() const + { + return _modifyAction; + } + + + void VariableActionImpl::SetVariableRef(std::shared_ptr> variableRef) + { + _variableRef = variableRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF); + _isSetVariableRef = true; + } + + void VariableActionImpl::SetSetAction(std::shared_ptr setAction) + { + _setAction = setAction; + _modifyAction = {}; + _isSetSetAction = true; + } + + void VariableActionImpl::SetModifyAction(std::shared_ptr modifyAction) + { + _modifyAction = modifyAction; + _setAction = {}; + _isSetModifyAction = true; + } + + std::shared_ptr VariableActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableActionImpl::GetModelType() const + { + return "VariableAction"; + } + + void VariableActionImpl::WriteParameterToVariableRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, parameterName, nullTextMarker /*no textmarker*/); + _variableRef = {}; + } + + std::string VariableActionImpl::GetParameterFromVariableRef() const + { + auto variableRef = OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF; + return GetParameterNameFromAttribute(variableRef); + } + + bool VariableActionImpl::IsVariableRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr VariableActionImpl::GetWriterSetAction() const + { + return std::dynamic_pointer_cast(_setAction); + } + std::shared_ptr VariableActionImpl::GetWriterModifyAction() const + { + return std::dynamic_pointer_cast(_modifyAction); + } + + VariableActionImpl::VariableActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, SimpleType::STRING); + } + + void VariableActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _variableRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetVariableRef = true; + } + } + + SimpleType VariableActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableActionImpl::GetChildren() const + { + std::vector> result; + + const auto kSetAction = GetWriterSetAction(); + if (kSetAction) + { + result.push_back(std::dynamic_pointer_cast(kSetAction)); + } + const auto kModifyAction = GetWriterModifyAction(); + if (kModifyAction) + { + result.push_back(std::dynamic_pointer_cast(kModifyAction)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetVariableRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_variableRef = proxy; + + // clone indicators + // clone children + const auto kSetAction = GetWriterSetAction(); + if (kSetAction) + { + auto clonedChild = std::dynamic_pointer_cast(kSetAction)->Clone(); + auto clonedChildIVariableSetAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSetAction(std::dynamic_pointer_cast(clonedChildIVariableSetAction)); + } + const auto kModifyAction = GetWriterModifyAction(); + if (kModifyAction) + { + auto clonedChild = std::dynamic_pointer_cast(kModifyAction)->Clone(); + auto clonedChildIVariableModifyAction = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetModifyAction(std::dynamic_pointer_cast(clonedChildIVariableModifyAction)); + } + return clonedObject; + } + + std::string VariableActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Get the Proxy + auto variableRef = GetVariableRef(); + return variableRef!= nullptr ? variableRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SET_ACTION) + { + return std::dynamic_pointer_cast(GetSetAction()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MODIFY_ACTION) + { + return std::dynamic_pointer_cast(GetModifyAction()); + } + throw KeyNotSupportedException(); + } + + std::vector> VariableActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableActionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Get the Proxy + auto variableRef = GetVariableRef(); + return variableRef != nullptr ? std::dynamic_pointer_cast(variableRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string VariableActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VariableActionImpl::IsSetVariableRef() const + { + return _isSetVariableRef; + } + bool VariableActionImpl::IsSetSetAction() const + { + return _isSetSetAction; + } + bool VariableActionImpl::IsSetModifyAction() const + { + return _isSetModifyAction; + } + + IOpenScenarioFlexElement* VariableAddValueRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double VariableAddValueRuleImpl::GetValue() const + { + return _value; + } + + + void VariableAddValueRuleImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr VariableAddValueRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableAddValueRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableAddValueRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableAddValueRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableAddValueRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableAddValueRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableAddValueRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableAddValueRuleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VariableAddValueRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableAddValueRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableAddValueRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableAddValueRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableAddValueRuleImpl::GetModelType() const + { + return "VariableAddValueRule"; + } + + void VariableAddValueRuleImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string VariableAddValueRuleImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool VariableAddValueRuleImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VariableAddValueRuleImpl::VariableAddValueRuleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void VariableAddValueRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType VariableAddValueRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableAddValueRuleImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableAddValueRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string VariableAddValueRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableAddValueRuleImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VariableAddValueRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableAddValueRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableAddValueRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void VariableAddValueRuleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool VariableAddValueRuleImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* VariableConditionImpl::GetOpenScenarioFlexElement() + { + return this; + } + Rule VariableConditionImpl::GetRule() const + { + return _rule; + } + std::string VariableConditionImpl::GetValue() const + { + return _value; + } + std::shared_ptr> VariableConditionImpl::GetVariableRef() const + { + return _variableRef; + } + + + void VariableConditionImpl::SetRule(const Rule rule) + { + _rule = rule; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE); + _isSetRule = true; + } + + void VariableConditionImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void VariableConditionImpl::SetVariableRef(std::shared_ptr> variableRef) + { + _variableRef = variableRef; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF); + _isSetVariableRef = true; + } + + std::shared_ptr VariableConditionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableConditionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableCondition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableConditionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableConditionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableConditionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableConditionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableConditionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableConditionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableConditionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableConditionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableConditionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableConditionImpl::GetModelType() const + { + return "VariableCondition"; + } + + void VariableConditionImpl::WriteParameterToRule(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, parameterName, nullTextMarker /*no textmarker*/); + _rule = {}; + } + + void VariableConditionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + void VariableConditionImpl::WriteParameterToVariableRef(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, parameterName, nullTextMarker /*no textmarker*/); + _variableRef = {}; + } + + std::string VariableConditionImpl::GetParameterFromRule() const + { + auto rule = OSC_CONSTANTS::ATTRIBUTE__RULE; + return GetParameterNameFromAttribute(rule); + } + + std::string VariableConditionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + std::string VariableConditionImpl::GetParameterFromVariableRef() const + { + auto variableRef = OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF; + return GetParameterNameFromAttribute(variableRef); + } + + bool VariableConditionImpl::IsRuleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__RULE); + if (kIt != keys.end()) + return true; + return false; + } + + bool VariableConditionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool VariableConditionImpl::IsVariableRefParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VariableConditionImpl::VariableConditionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__RULE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, SimpleType::STRING); + } + + void VariableConditionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(parameterLiteralValue); + if (kResult != Rule::UNKNOWN) + { + _rule = kResult; + AddResolvedParameter(attributeKey); + _isSetRule = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Proxy + const auto kProxy = std::make_shared>(parameterLiteralValue); + _variableRef = std::dynamic_pointer_cast>(kProxy); + AddResolvedParameter(attributeKey); + _isSetVariableRef = true; + } + } + + SimpleType VariableConditionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableConditionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableConditionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kRule = GetRule(); + if ( kRule.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_rule = Rule::GetFromLiteral(kRule.GetLiteral()); + } + // Simple type + clonedObject->_value = GetValue(); + // Proxy + auto proxy = std::make_shared>(*std::dynamic_pointer_cast>(GetVariableRef())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_variableRef = proxy; + + // clone indicators + // clone children + return clonedObject; + } + + std::string VariableConditionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Get the Proxy + auto variableRef = GetVariableRef(); + return variableRef!= nullptr ? variableRef->GetNameRef() : ""; + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableConditionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VariableConditionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableConditionImpl::GetReferencedElement(std::string key, std::string name) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF) + { + // Get the Proxy + auto variableRef = GetVariableRef(); + return variableRef != nullptr ? std::dynamic_pointer_cast(variableRef->GetTargetObject()) : nullptr; + } + throw KeyNotSupportedException(); + } + + std::string VariableConditionImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__RULE) + { + auto rule = GetRule(); + return rule.GetLiteral() != "UNKNOWN" ? rule.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void VariableConditionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool VariableConditionImpl::IsSetRule() const + { + return _isSetRule; + } + bool VariableConditionImpl::IsSetValue() const + { + return _isSetValue; + } + bool VariableConditionImpl::IsSetVariableRef() const + { + return _isSetVariableRef; + } + + IOpenScenarioFlexElement* VariableDeclarationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string VariableDeclarationImpl::GetName() const + { + return _name; + } + std::string VariableDeclarationImpl::GetValue() const + { + return _value; + } + ParameterType VariableDeclarationImpl::GetVariableType() const + { + return _variableType; + } + + + void VariableDeclarationImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void VariableDeclarationImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + void VariableDeclarationImpl::SetVariableType(const ParameterType variableType) + { + _variableType = variableType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE); + _isSetVariableType = true; + } + + std::shared_ptr VariableDeclarationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableDeclarationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableDeclaration).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableDeclarationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableDeclarationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableDeclarationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableDeclarationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableDeclarationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableDeclarationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableDeclarationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableDeclarationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableDeclarationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableDeclarationImpl::GetModelType() const + { + return "VariableDeclaration"; + } + + void VariableDeclarationImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void VariableDeclarationImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + void VariableDeclarationImpl::WriteParameterToVariableType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _variableType = {}; + } + + std::string VariableDeclarationImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string VariableDeclarationImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + std::string VariableDeclarationImpl::GetParameterFromVariableType() const + { + auto variableType = OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE; + return GetParameterNameFromAttribute(variableType); + } + + bool VariableDeclarationImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool VariableDeclarationImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + bool VariableDeclarationImpl::IsVariableTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VariableDeclarationImpl::VariableDeclarationImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, SimpleType::ENUM_TYPE); + } + + void VariableDeclarationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE) + { + // Enumeration Type + const auto kResult = ParameterType::GetFromLiteral(parameterLiteralValue); + if (kResult != ParameterType::UNKNOWN) + { + _variableType = kResult; + AddResolvedParameter(attributeKey); + _isSetVariableType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType VariableDeclarationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableDeclarationImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableDeclarationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_name = GetName(); + // Simple type + clonedObject->_value = GetValue(); + // Enumeration Type + const auto kVariableType = GetVariableType(); + if ( kVariableType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_variableType = ParameterType::GetFromLiteral(kVariableType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string VariableDeclarationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableDeclarationImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VariableDeclarationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableDeclarationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableDeclarationImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE) + { + auto variableType = GetVariableType(); + return variableType.GetLiteral() != "UNKNOWN" ? variableType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void VariableDeclarationImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + bool VariableDeclarationImpl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + + bool VariableDeclarationImpl::IsSetName() const + { + return _isSetName; + } + bool VariableDeclarationImpl::IsSetValue() const + { + return _isSetValue; + } + bool VariableDeclarationImpl::IsSetVariableType() const + { + return _isSetVariableType; + } + + IOpenScenarioFlexElement* VariableModifyActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr VariableModifyActionImpl::GetRule() const + { + return _rule; + } + + + void VariableModifyActionImpl::SetRule(std::shared_ptr rule) + { + _rule = rule; + _isSetRule = true; + } + + std::shared_ptr VariableModifyActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableModifyActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableModifyAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableModifyActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableModifyActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableModifyActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableModifyActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableModifyActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableModifyActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableModifyActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableModifyActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableModifyActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableModifyActionImpl::GetModelType() const + { + return "VariableModifyAction"; + } + + // children + std::shared_ptr VariableModifyActionImpl::GetWriterRule() const + { + return std::dynamic_pointer_cast(_rule); + } + + VariableModifyActionImpl::VariableModifyActionImpl() + { + /** + * Filling the property to type map + */ + } + + void VariableModifyActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType VariableModifyActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableModifyActionImpl::GetChildren() const + { + std::vector> result; + + const auto kRule = GetWriterRule(); + if (kRule) + { + result.push_back(std::dynamic_pointer_cast(kRule)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableModifyActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kRule = GetWriterRule(); + if (kRule) + { + auto clonedChild = std::dynamic_pointer_cast(kRule)->Clone(); + auto clonedChildIVariableModifyRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetRule(std::dynamic_pointer_cast(clonedChildIVariableModifyRule)); + } + return clonedObject; + } + + std::string VariableModifyActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableModifyActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__RULE) + { + return std::dynamic_pointer_cast(GetRule()); + } + throw KeyNotSupportedException(); + } + + std::vector> VariableModifyActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableModifyActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableModifyActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VariableModifyActionImpl::IsSetRule() const + { + return _isSetRule; + } + + IOpenScenarioFlexElement* VariableModifyRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr VariableModifyRuleImpl::GetAddValue() const + { + return _addValue; + } + std::shared_ptr VariableModifyRuleImpl::GetMultiplyByValue() const + { + return _multiplyByValue; + } + + + void VariableModifyRuleImpl::SetAddValue(std::shared_ptr addValue) + { + _addValue = addValue; + _multiplyByValue = {}; + _isSetAddValue = true; + } + + void VariableModifyRuleImpl::SetMultiplyByValue(std::shared_ptr multiplyByValue) + { + _multiplyByValue = multiplyByValue; + _addValue = {}; + _isSetMultiplyByValue = true; + } + + std::shared_ptr VariableModifyRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableModifyRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableModifyRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableModifyRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableModifyRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableModifyRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableModifyRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableModifyRuleImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableModifyRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableModifyRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableModifyRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableModifyRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableModifyRuleImpl::GetModelType() const + { + return "VariableModifyRule"; + } + + // children + std::shared_ptr VariableModifyRuleImpl::GetWriterAddValue() const + { + return std::dynamic_pointer_cast(_addValue); + } + std::shared_ptr VariableModifyRuleImpl::GetWriterMultiplyByValue() const + { + return std::dynamic_pointer_cast(_multiplyByValue); + } + + VariableModifyRuleImpl::VariableModifyRuleImpl() + { + /** + * Filling the property to type map + */ + } + + void VariableModifyRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType VariableModifyRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableModifyRuleImpl::GetChildren() const + { + std::vector> result; + + const auto kAddValue = GetWriterAddValue(); + if (kAddValue) + { + result.push_back(std::dynamic_pointer_cast(kAddValue)); + } + const auto kMultiplyByValue = GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + result.push_back(std::dynamic_pointer_cast(kMultiplyByValue)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableModifyRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kAddValue = GetWriterAddValue(); + if (kAddValue) + { + auto clonedChild = std::dynamic_pointer_cast(kAddValue)->Clone(); + auto clonedChildIVariableAddValueRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAddValue(std::dynamic_pointer_cast(clonedChildIVariableAddValueRule)); + } + const auto kMultiplyByValue = GetWriterMultiplyByValue(); + if (kMultiplyByValue) + { + auto clonedChild = std::dynamic_pointer_cast(kMultiplyByValue)->Clone(); + auto clonedChildIVariableMultiplyByValueRule = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetMultiplyByValue(std::dynamic_pointer_cast(clonedChildIVariableMultiplyByValueRule)); + } + return clonedObject; + } + + std::string VariableModifyRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableModifyRuleImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__ADD_VALUE) + { + return std::dynamic_pointer_cast(GetAddValue()); + } + + if (key == OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE) + { + return std::dynamic_pointer_cast(GetMultiplyByValue()); + } + throw KeyNotSupportedException(); + } + + std::vector> VariableModifyRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableModifyRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableModifyRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VariableModifyRuleImpl::IsSetAddValue() const + { + return _isSetAddValue; + } + bool VariableModifyRuleImpl::IsSetMultiplyByValue() const + { + return _isSetMultiplyByValue; + } + + IOpenScenarioFlexElement* VariableMultiplyByValueRuleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double VariableMultiplyByValueRuleImpl::GetValue() const + { + return _value; + } + + + void VariableMultiplyByValueRuleImpl::SetValue(const double value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr VariableMultiplyByValueRuleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableMultiplyByValueRuleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableMultiplyByValueRule).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableMultiplyByValueRuleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableMultiplyByValueRuleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableMultiplyByValueRuleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableMultiplyByValueRuleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableMultiplyByValueRuleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VariableMultiplyByValueRuleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableMultiplyByValueRuleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableMultiplyByValueRuleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableMultiplyByValueRuleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableMultiplyByValueRuleImpl::GetModelType() const + { + return "VariableMultiplyByValueRule"; + } + + void VariableMultiplyByValueRuleImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string VariableMultiplyByValueRuleImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool VariableMultiplyByValueRuleImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VariableMultiplyByValueRuleImpl::VariableMultiplyByValueRuleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::DOUBLE); + } + + void VariableMultiplyByValueRuleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType VariableMultiplyByValueRuleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableMultiplyByValueRuleImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableMultiplyByValueRuleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string VariableMultiplyByValueRuleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableMultiplyByValueRuleImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VariableMultiplyByValueRuleImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableMultiplyByValueRuleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableMultiplyByValueRuleImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void VariableMultiplyByValueRuleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + + bool VariableMultiplyByValueRuleImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* VariableSetActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::string VariableSetActionImpl::GetValue() const + { + return _value; + } + + + void VariableSetActionImpl::SetValue(const std::string value) + { + _value = value; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE); + _isSetValue = true; + } + + std::shared_ptr VariableSetActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VariableSetActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVariableSetAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVariableSetActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VariableSetActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VariableSetActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VariableSetActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VariableSetActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VariableSetActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VariableSetActionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VariableSetActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VariableSetActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VariableSetActionImpl::GetModelType() const + { + return "VariableSetAction"; + } + + void VariableSetActionImpl::WriteParameterToValue(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, parameterName, nullTextMarker /*no textmarker*/); + _value = {}; + } + + std::string VariableSetActionImpl::GetParameterFromValue() const + { + auto value = OSC_CONSTANTS::ATTRIBUTE__VALUE; + return GetParameterNameFromAttribute(value); + } + + bool VariableSetActionImpl::IsValueParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VALUE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VariableSetActionImpl::VariableSetActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VALUE, SimpleType::STRING); + } + + void VariableSetActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + } + + SimpleType VariableSetActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VariableSetActionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VariableSetActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_value = GetValue(); + // clone indicators + // clone children + return clonedObject; + } + + std::string VariableSetActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + return GetValue(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableSetActionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VariableSetActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VariableSetActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VariableSetActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void VariableSetActionImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE) + { + // Simple type + _value = value; + AddResolvedParameter(attributeKey); + _isSetValue = true; + } + + } + + bool VariableSetActionImpl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } + + bool VariableSetActionImpl::IsSetValue() const + { + return _isSetValue; + } + + IOpenScenarioFlexElement* VehicleImpl::GetOpenScenarioFlexElement() + { + return this; + } + double VehicleImpl::GetMass() const + { + return _mass; + } + std::string VehicleImpl::GetModel3d() const + { + return _model3d; + } + std::string VehicleImpl::GetName() const + { + return _name; + } + Role VehicleImpl::GetRole() const + { + return _role; + } + VehicleCategory VehicleImpl::GetVehicleCategory() const + { + return _vehicleCategory; + } + std::vector> VehicleImpl::GetParameterDeclarations() const + { + std::vector> temp; + for(auto&& elm: _parameterDeclarations) + temp.push_back(elm); + return temp; + } + std::vector> VehicleImpl::GetWriterParameterDeclarations() const + { + return _parameterDeclarations; + } + + int VehicleImpl::GetParameterDeclarationsSize() const + { + return static_cast(_parameterDeclarations.size()); + } + + std::shared_ptr VehicleImpl::GetParameterDeclarationsAtIndex(unsigned int index) const + { + if (index >= 0 && _parameterDeclarations.size() > index) + { + return _parameterDeclarations[index]; + } + return nullptr; + } + std::shared_ptr VehicleImpl::GetBoundingBox() const + { + return _boundingBox; + } + std::shared_ptr VehicleImpl::GetPerformance() const + { + return _performance; + } + std::shared_ptr VehicleImpl::GetAxles() const + { + return _axles; + } + std::shared_ptr VehicleImpl::GetProperties() const + { + return _properties; + } + std::shared_ptr VehicleImpl::GetTrailerHitch() const + { + return _trailerHitch; + } + std::shared_ptr VehicleImpl::GetTrailerCoupler() const + { + return _trailerCoupler; + } + std::shared_ptr VehicleImpl::GetTrailer() const + { + return _trailer; + } + + + void VehicleImpl::SetMass(const double mass) + { + _mass = mass; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS); + _isSetMass = true; + } + + void VehicleImpl::SetModel3d(const std::string model3d) + { + _model3d = model3d; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + _isSetModel3d = true; + } + + void VehicleImpl::SetName(const std::string name) + { + _name = name; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME); + _isSetName = true; + } + + void VehicleImpl::SetRole(const Role role) + { + _role = role; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE); + _isSetRole = true; + } + + void VehicleImpl::SetVehicleCategory(const VehicleCategory vehicleCategory) + { + _vehicleCategory = vehicleCategory; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY); + _isSetVehicleCategory = true; + } + + void VehicleImpl::SetParameterDeclarations(std::vector>& parameterDeclarations) + { + _parameterDeclarations = parameterDeclarations; + _isSetParameterDeclarations = true; + } + + void VehicleImpl::SetBoundingBox(std::shared_ptr boundingBox) + { + _boundingBox = boundingBox; + _isSetBoundingBox = true; + } + + void VehicleImpl::SetPerformance(std::shared_ptr performance) + { + _performance = performance; + _isSetPerformance = true; + } + + void VehicleImpl::SetAxles(std::shared_ptr axles) + { + _axles = axles; + _isSetAxles = true; + } + + void VehicleImpl::SetProperties(std::shared_ptr properties) + { + _properties = properties; + _isSetProperties = true; + } + + void VehicleImpl::SetTrailerHitch(std::shared_ptr trailerHitch) + { + _trailerHitch = trailerHitch; + _isSetTrailerHitch = true; + } + + void VehicleImpl::SetTrailerCoupler(std::shared_ptr trailerCoupler) + { + _trailerCoupler = trailerCoupler; + _isSetTrailerCoupler = true; + } + + void VehicleImpl::SetTrailer(std::shared_ptr trailer) + { + _trailer = trailer; + _isSetTrailer = true; + } + + std::shared_ptr VehicleImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicle).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + return GetMass(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VehicleImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleImpl::GetModelType() const + { + return "Vehicle"; + } + + void VehicleImpl::WriteParameterToMass(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, parameterName, nullTextMarker /*no textmarker*/); + _mass = {}; + } + + void VehicleImpl::WriteParameterToModel3d(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, parameterName, nullTextMarker /*no textmarker*/); + _model3d = {}; + } + + void VehicleImpl::WriteParameterToName(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, parameterName, nullTextMarker /*no textmarker*/); + _name = {}; + } + + void VehicleImpl::WriteParameterToRole(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, parameterName, nullTextMarker /*no textmarker*/); + _role = {}; + } + + void VehicleImpl::WriteParameterToVehicleCategory(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, parameterName, nullTextMarker /*no textmarker*/); + _vehicleCategory = {}; + } + + std::string VehicleImpl::GetParameterFromMass() const + { + auto mass = OSC_CONSTANTS::ATTRIBUTE__MASS; + return GetParameterNameFromAttribute(mass); + } + + std::string VehicleImpl::GetParameterFromModel3d() const + { + auto model3d = OSC_CONSTANTS::ATTRIBUTE__MODEL3D; + return GetParameterNameFromAttribute(model3d); + } + + std::string VehicleImpl::GetParameterFromName() const + { + auto name = OSC_CONSTANTS::ATTRIBUTE__NAME; + return GetParameterNameFromAttribute(name); + } + + std::string VehicleImpl::GetParameterFromRole() const + { + auto role = OSC_CONSTANTS::ATTRIBUTE__ROLE; + return GetParameterNameFromAttribute(role); + } + + std::string VehicleImpl::GetParameterFromVehicleCategory() const + { + auto vehicleCategory = OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY; + return GetParameterNameFromAttribute(vehicleCategory); + } + + bool VehicleImpl::IsMassParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MASS); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleImpl::IsModel3dParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__MODEL3D); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleImpl::IsNameParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__NAME); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleImpl::IsRoleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROLE); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleImpl::IsVehicleCategoryParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr VehicleImpl::GetWriterBoundingBox() const + { + return std::dynamic_pointer_cast(_boundingBox); + } + std::shared_ptr VehicleImpl::GetWriterPerformance() const + { + return std::dynamic_pointer_cast(_performance); + } + std::shared_ptr VehicleImpl::GetWriterAxles() const + { + return std::dynamic_pointer_cast(_axles); + } + std::shared_ptr VehicleImpl::GetWriterProperties() const + { + return std::dynamic_pointer_cast(_properties); + } + std::shared_ptr VehicleImpl::GetWriterTrailerHitch() const + { + return std::dynamic_pointer_cast(_trailerHitch); + } + std::shared_ptr VehicleImpl::GetWriterTrailerCoupler() const + { + return std::dynamic_pointer_cast(_trailerCoupler); + } + std::shared_ptr VehicleImpl::GetWriterTrailer() const + { + return std::dynamic_pointer_cast(_trailer); + } + + VehicleImpl::VehicleImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MASS, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__NAME, SimpleType::STRING); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROLE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, SimpleType::ENUM_TYPE); + } + + void VehicleImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = ParserHelper::ParseString(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetName = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + // Enumeration Type + const auto kResult = Role::GetFromLiteral(parameterLiteralValue); + if (kResult != Role::UNKNOWN) + { + _role = kResult; + AddResolvedParameter(attributeKey); + _isSetRole = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY) + { + // Enumeration Type + const auto kResult = VehicleCategory::GetFromLiteral(parameterLiteralValue); + if (kResult != VehicleCategory::UNKNOWN) + { + _vehicleCategory = kResult; + AddResolvedParameter(attributeKey); + _isSetVehicleCategory = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType VehicleImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + bool VehicleImpl::HasParameterDefinitions() + { + return true; + } + + std::vector> VehicleImpl::GetParameterDefinitions() const + { + std::vector> result; + if (!_parameterDeclarations.empty()) + { + for (auto&& parameterDeclaration :_parameterDeclarations) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleImpl::GetChildren() const + { + std::vector> result; + + auto parameterDeclarations = GetWriterParameterDeclarations(); + if (!parameterDeclarations.empty()) + { + for(auto&& item : parameterDeclarations) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + result.push_back(std::dynamic_pointer_cast(kBoundingBox)); + } + const auto kPerformance = GetWriterPerformance(); + if (kPerformance) + { + result.push_back(std::dynamic_pointer_cast(kPerformance)); + } + const auto kAxles = GetWriterAxles(); + if (kAxles) + { + result.push_back(std::dynamic_pointer_cast(kAxles)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + result.push_back(std::dynamic_pointer_cast(kProperties)); + } + const auto kTrailerHitch = GetWriterTrailerHitch(); + if (kTrailerHitch) + { + result.push_back(std::dynamic_pointer_cast(kTrailerHitch)); + } + const auto kTrailerCoupler = GetWriterTrailerCoupler(); + if (kTrailerCoupler) + { + result.push_back(std::dynamic_pointer_cast(kTrailerCoupler)); + } + const auto kTrailer = GetWriterTrailer(); + if (kTrailer) + { + result.push_back(std::dynamic_pointer_cast(kTrailer)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_mass = GetMass(); + // Simple type + clonedObject->_model3d = GetModel3d(); + // Simple type + clonedObject->_name = GetName(); + // Enumeration Type + const auto kRole = GetRole(); + if ( kRole.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_role = Role::GetFromLiteral(kRole.GetLiteral()); + } + // Enumeration Type + const auto kVehicleCategory = GetVehicleCategory(); + if ( kVehicleCategory.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_vehicleCategory = VehicleCategory::GetFromLiteral(kVehicleCategory.GetLiteral()); + } + // clone indicators + clonedObject->_isSetMass = _isSetMass; + clonedObject->_isSetModel3d = _isSetModel3d; + clonedObject->_isSetRole = _isSetRole; + // clone children + const auto kParameterDeclarations = GetWriterParameterDeclarations(); + if (!kParameterDeclarations.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kParameterDeclarations) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetParameterDeclarations(clonedList); + } + const auto kBoundingBox = GetWriterBoundingBox(); + if (kBoundingBox) + { + auto clonedChild = std::dynamic_pointer_cast(kBoundingBox)->Clone(); + auto clonedChildIBoundingBox = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetBoundingBox(std::dynamic_pointer_cast(clonedChildIBoundingBox)); + } + const auto kPerformance = GetWriterPerformance(); + if (kPerformance) + { + auto clonedChild = std::dynamic_pointer_cast(kPerformance)->Clone(); + auto clonedChildIPerformance = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPerformance(std::dynamic_pointer_cast(clonedChildIPerformance)); + } + const auto kAxles = GetWriterAxles(); + if (kAxles) + { + auto clonedChild = std::dynamic_pointer_cast(kAxles)->Clone(); + auto clonedChildIAxles = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetAxles(std::dynamic_pointer_cast(clonedChildIAxles)); + } + const auto kProperties = GetWriterProperties(); + if (kProperties) + { + auto clonedChild = std::dynamic_pointer_cast(kProperties)->Clone(); + auto clonedChildIProperties = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetProperties(std::dynamic_pointer_cast(clonedChildIProperties)); + } + const auto kTrailerHitch = GetWriterTrailerHitch(); + if (kTrailerHitch) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailerHitch)->Clone(); + auto clonedChildITrailerHitch = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailerHitch(std::dynamic_pointer_cast(clonedChildITrailerHitch)); + } + const auto kTrailerCoupler = GetWriterTrailerCoupler(); + if (kTrailerCoupler) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailerCoupler)->Clone(); + auto clonedChildITrailerCoupler = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailerCoupler(std::dynamic_pointer_cast(clonedChildITrailerCoupler)); + } + const auto kTrailer = GetWriterTrailer(); + if (kTrailer) + { + auto clonedChild = std::dynamic_pointer_cast(kTrailer)->Clone(); + auto clonedChildITrailer = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetTrailer(std::dynamic_pointer_cast(clonedChildITrailer)); + } + return clonedObject; + } + + std::string VehicleImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + return GetModel3d(); + } + else + if (key == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + return GetName(); + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX) + { + return std::dynamic_pointer_cast(GetBoundingBox()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PERFORMANCE) + { + return std::dynamic_pointer_cast(GetPerformance()); + } + + if (key == OSC_CONSTANTS::ELEMENT__AXLES) + { + return std::dynamic_pointer_cast(GetAxles()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PROPERTIES) + { + return std::dynamic_pointer_cast(GetProperties()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER_HITCH) + { + return std::dynamic_pointer_cast(GetTrailerHitch()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER_COUPLER) + { + return std::dynamic_pointer_cast(GetTrailerCoupler()); + } + + if (key == OSC_CONSTANTS::ELEMENT__TRAILER) + { + return std::dynamic_pointer_cast(GetTrailer()); + } + throw KeyNotSupportedException(); + } + + std::vector> VehicleImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + if (key == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + std::vector> vect; + for (auto&& elem : GetParameterDeclarations()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + auto role = GetRole(); + return role.GetLiteral() != "UNKNOWN" ? role.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY) + { + auto vehicleCategory = GetVehicleCategory(); + return vehicleCategory.GetLiteral() != "UNKNOWN" ? vehicleCategory.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void VehicleImpl::ResolveStringExpression(std::string& attributeKey, std::string& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MODEL3D) + { + // Simple type + _model3d = value; + AddResolvedParameter(attributeKey); + _isSetModel3d = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__NAME) + { + // Simple type + _name = value; + AddResolvedParameter(attributeKey); + _isSetName = true; + } + + } + void VehicleImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__MASS) + { + // Simple type + _mass = value; + AddResolvedParameter(attributeKey); + _isSetMass = true; + } + + } + + + void VehicleImpl::ResetMass() + { + _isSetMass = false; + _mass = {}; + + } + bool VehicleImpl::IsSetMass() const + { + return _isSetMass; + } + void VehicleImpl::ResetModel3d() + { + _isSetModel3d = false; + _model3d = {}; + + } + bool VehicleImpl::IsSetModel3d() const + { + return _isSetModel3d; + } + bool VehicleImpl::IsSetName() const + { + return _isSetName; + } + void VehicleImpl::ResetRole() + { + _isSetRole = false; + _role = {Role::RoleEnum::NONE}; + + } + bool VehicleImpl::IsSetRole() const + { + return _isSetRole; + } + bool VehicleImpl::IsSetVehicleCategory() const + { + return _isSetVehicleCategory; + } + void VehicleImpl::ResetParameterDeclarations() + { + _isSetParameterDeclarations = false; + _parameterDeclarations = {}; + + } + bool VehicleImpl::IsSetParameterDeclarations() const + { + return _isSetParameterDeclarations; + } + bool VehicleImpl::IsSetBoundingBox() const + { + return _isSetBoundingBox; + } + bool VehicleImpl::IsSetPerformance() const + { + return _isSetPerformance; + } + bool VehicleImpl::IsSetAxles() const + { + return _isSetAxles; + } + void VehicleImpl::ResetProperties() + { + _isSetProperties = false; + _properties = {}; + + } + bool VehicleImpl::IsSetProperties() const + { + return _isSetProperties; + } + void VehicleImpl::ResetTrailerHitch() + { + _isSetTrailerHitch = false; + _trailerHitch = {}; + + } + bool VehicleImpl::IsSetTrailerHitch() const + { + return _isSetTrailerHitch; + } + void VehicleImpl::ResetTrailerCoupler() + { + _isSetTrailerCoupler = false; + _trailerCoupler = {}; + + } + bool VehicleImpl::IsSetTrailerCoupler() const + { + return _isSetTrailerCoupler; + } + void VehicleImpl::ResetTrailer() + { + _isSetTrailer = false; + _trailer = {}; + + } + bool VehicleImpl::IsSetTrailer() const + { + return _isSetTrailer; + } + + IOpenScenarioFlexElement* VehicleCatalogLocationImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::shared_ptr VehicleCatalogLocationImpl::GetDirectory() const + { + return _directory; + } + + + void VehicleCatalogLocationImpl::SetDirectory(std::shared_ptr directory) + { + _directory = directory; + _isSetDirectory = true; + } + + std::shared_ptr VehicleCatalogLocationImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleCatalogLocationImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleCatalogLocation).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleCatalogLocationWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleCatalogLocationImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleCatalogLocationImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleCatalogLocationImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleCatalogLocationImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VehicleCatalogLocationImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleCatalogLocationImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleCatalogLocationImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleCatalogLocationImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleCatalogLocationImpl::GetModelType() const + { + return "VehicleCatalogLocation"; + } + + // children + std::shared_ptr VehicleCatalogLocationImpl::GetWriterDirectory() const + { + return std::dynamic_pointer_cast(_directory); + } + + VehicleCatalogLocationImpl::VehicleCatalogLocationImpl() + { + /** + * Filling the property to type map + */ + } + + void VehicleCatalogLocationImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType VehicleCatalogLocationImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleCatalogLocationImpl::GetChildren() const + { + std::vector> result; + + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + result.push_back(std::dynamic_pointer_cast(kDirectory)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleCatalogLocationImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kDirectory = GetWriterDirectory(); + if (kDirectory) + { + auto clonedChild = std::dynamic_pointer_cast(kDirectory)->Clone(); + auto clonedChildIDirectory = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDirectory(std::dynamic_pointer_cast(clonedChildIDirectory)); + } + return clonedObject; + } + + std::string VehicleCatalogLocationImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCatalogLocationImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__DIRECTORY) + { + return std::dynamic_pointer_cast(GetDirectory()); + } + throw KeyNotSupportedException(); + } + + std::vector> VehicleCatalogLocationImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCatalogLocationImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleCatalogLocationImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VehicleCatalogLocationImpl::IsSetDirectory() const + { + return _isSetDirectory; + } + + IOpenScenarioFlexElement* VehicleCategoryDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> VehicleCategoryDistributionImpl::GetVehicleCategoryDistributionEntries() const + { + std::vector> temp; + for(auto&& elm: _vehicleCategoryDistributionEntries) + temp.push_back(elm); + return temp; + } + std::vector> VehicleCategoryDistributionImpl::GetWriterVehicleCategoryDistributionEntries() const + { + return _vehicleCategoryDistributionEntries; + } + + int VehicleCategoryDistributionImpl::GetVehicleCategoryDistributionEntriesSize() const + { + return static_cast(_vehicleCategoryDistributionEntries.size()); + } + + std::shared_ptr VehicleCategoryDistributionImpl::GetVehicleCategoryDistributionEntriesAtIndex(unsigned int index) const + { + if (index >= 0 && _vehicleCategoryDistributionEntries.size() > index) + { + return _vehicleCategoryDistributionEntries[index]; + } + return nullptr; + } + + + void VehicleCategoryDistributionImpl::SetVehicleCategoryDistributionEntries(std::vector>& vehicleCategoryDistributionEntries) + { + _vehicleCategoryDistributionEntries = vehicleCategoryDistributionEntries; + _isSetVehicleCategoryDistributionEntries = true; + } + + std::shared_ptr VehicleCategoryDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleCategoryDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleCategoryDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleCategoryDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleCategoryDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleCategoryDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleCategoryDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleCategoryDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VehicleCategoryDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleCategoryDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleCategoryDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleCategoryDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleCategoryDistributionImpl::GetModelType() const + { + return "VehicleCategoryDistribution"; + } + + // children + + VehicleCategoryDistributionImpl::VehicleCategoryDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void VehicleCategoryDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType VehicleCategoryDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleCategoryDistributionImpl::GetChildren() const + { + std::vector> result; + + auto vehicleCategoryDistributionEntries = GetWriterVehicleCategoryDistributionEntries(); + if (!vehicleCategoryDistributionEntries.empty()) + { + for(auto&& item : vehicleCategoryDistributionEntries) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleCategoryDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVehicleCategoryDistributionEntries = GetWriterVehicleCategoryDistributionEntries(); + if (!kVehicleCategoryDistributionEntries.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kVehicleCategoryDistributionEntries) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetVehicleCategoryDistributionEntries(clonedList); + } + return clonedObject; + } + + std::string VehicleCategoryDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCategoryDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleCategoryDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetVehicleCategoryDistributionEntries()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCategoryDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleCategoryDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VehicleCategoryDistributionImpl::IsSetVehicleCategoryDistributionEntries() const + { + return _isSetVehicleCategoryDistributionEntries; + } + + IOpenScenarioFlexElement* VehicleCategoryDistributionEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + VehicleCategory VehicleCategoryDistributionEntryImpl::GetCategory() const + { + return _category; + } + double VehicleCategoryDistributionEntryImpl::GetWeight() const + { + return _weight; + } + + + void VehicleCategoryDistributionEntryImpl::SetCategory(const VehicleCategory category) + { + _category = category; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATEGORY); + _isSetCategory = true; + } + + void VehicleCategoryDistributionEntryImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + std::shared_ptr VehicleCategoryDistributionEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleCategoryDistributionEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleCategoryDistributionEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleCategoryDistributionEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleCategoryDistributionEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleCategoryDistributionEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleCategoryDistributionEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleCategoryDistributionEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VehicleCategoryDistributionEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleCategoryDistributionEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleCategoryDistributionEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleCategoryDistributionEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleCategoryDistributionEntryImpl::GetModelType() const + { + return "VehicleCategoryDistributionEntry"; + } + + void VehicleCategoryDistributionEntryImpl::WriteParameterToCategory(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, parameterName, nullTextMarker /*no textmarker*/); + _category = {}; + } + + void VehicleCategoryDistributionEntryImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string VehicleCategoryDistributionEntryImpl::GetParameterFromCategory() const + { + auto category = OSC_CONSTANTS::ATTRIBUTE__CATEGORY; + return GetParameterNameFromAttribute(category); + } + + std::string VehicleCategoryDistributionEntryImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool VehicleCategoryDistributionEntryImpl::IsCategoryParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CATEGORY); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleCategoryDistributionEntryImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VehicleCategoryDistributionEntryImpl::VehicleCategoryDistributionEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void VehicleCategoryDistributionEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CATEGORY) + { + // Enumeration Type + const auto kResult = VehicleCategory::GetFromLiteral(parameterLiteralValue); + if (kResult != VehicleCategory::UNKNOWN) + { + _category = kResult; + AddResolvedParameter(attributeKey); + _isSetCategory = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType VehicleCategoryDistributionEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleCategoryDistributionEntryImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleCategoryDistributionEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kCategory = GetCategory(); + if ( kCategory.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_category = VehicleCategory::GetFromLiteral(kCategory.GetLiteral()); + } + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + return clonedObject; + } + + std::string VehicleCategoryDistributionEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCategoryDistributionEntryImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleCategoryDistributionEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleCategoryDistributionEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleCategoryDistributionEntryImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CATEGORY) + { + auto category = GetCategory(); + return category.GetLiteral() != "UNKNOWN" ? category.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void VehicleCategoryDistributionEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool VehicleCategoryDistributionEntryImpl::IsSetCategory() const + { + return _isSetCategory; + } + bool VehicleCategoryDistributionEntryImpl::IsSetWeight() const + { + return _isSetWeight; + } + + IOpenScenarioFlexElement* VehicleComponentImpl::GetOpenScenarioFlexElement() + { + return this; + } + VehicleComponentType VehicleComponentImpl::GetVehicleComponentType() const + { + return _vehicleComponentType; + } + + + void VehicleComponentImpl::SetVehicleComponentType(const VehicleComponentType vehicleComponentType) + { + _vehicleComponentType = vehicleComponentType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE); + _isSetVehicleComponentType = true; + } + + std::shared_ptr VehicleComponentImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleComponentImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleComponent).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleComponentWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleComponentImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleComponentImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleComponentImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleComponentImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VehicleComponentImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleComponentImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleComponentImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleComponentImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleComponentImpl::GetModelType() const + { + return "VehicleComponent"; + } + + void VehicleComponentImpl::WriteParameterToVehicleComponentType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _vehicleComponentType = {}; + } + + std::string VehicleComponentImpl::GetParameterFromVehicleComponentType() const + { + auto vehicleComponentType = OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE; + return GetParameterNameFromAttribute(vehicleComponentType); + } + + bool VehicleComponentImpl::IsVehicleComponentTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VehicleComponentImpl::VehicleComponentImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, SimpleType::ENUM_TYPE); + } + + void VehicleComponentImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE) + { + // Enumeration Type + const auto kResult = VehicleComponentType::GetFromLiteral(parameterLiteralValue); + if (kResult != VehicleComponentType::UNKNOWN) + { + _vehicleComponentType = kResult; + AddResolvedParameter(attributeKey); + _isSetVehicleComponentType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType VehicleComponentImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleComponentImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleComponentImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kVehicleComponentType = GetVehicleComponentType(); + if ( kVehicleComponentType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_vehicleComponentType = VehicleComponentType::GetFromLiteral(kVehicleComponentType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string VehicleComponentImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleComponentImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleComponentImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleComponentImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleComponentImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE) + { + auto vehicleComponentType = GetVehicleComponentType(); + return vehicleComponentType.GetLiteral() != "UNKNOWN" ? vehicleComponentType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool VehicleComponentImpl::IsSetVehicleComponentType() const + { + return _isSetVehicleComponentType; + } + + IOpenScenarioFlexElement* VehicleLightImpl::GetOpenScenarioFlexElement() + { + return this; + } + VehicleLightType VehicleLightImpl::GetVehicleLightType() const + { + return _vehicleLightType; + } + + + void VehicleLightImpl::SetVehicleLightType(const VehicleLightType vehicleLightType) + { + _vehicleLightType = vehicleLightType; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE); + _isSetVehicleLightType = true; + } + + std::shared_ptr VehicleLightImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleLightImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleLight).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleLightWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleLightImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleLightImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleLightImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleLightImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VehicleLightImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleLightImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleLightImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleLightImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleLightImpl::GetModelType() const + { + return "VehicleLight"; + } + + void VehicleLightImpl::WriteParameterToVehicleLightType(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, parameterName, nullTextMarker /*no textmarker*/); + _vehicleLightType = {}; + } + + std::string VehicleLightImpl::GetParameterFromVehicleLightType() const + { + auto vehicleLightType = OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE; + return GetParameterNameFromAttribute(vehicleLightType); + } + + bool VehicleLightImpl::IsVehicleLightTypeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VehicleLightImpl::VehicleLightImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, SimpleType::ENUM_TYPE); + } + + void VehicleLightImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE) + { + // Enumeration Type + const auto kResult = VehicleLightType::GetFromLiteral(parameterLiteralValue); + if (kResult != VehicleLightType::UNKNOWN) + { + _vehicleLightType = kResult; + AddResolvedParameter(attributeKey); + _isSetVehicleLightType = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType VehicleLightImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleLightImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleLightImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kVehicleLightType = GetVehicleLightType(); + if ( kVehicleLightType.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_vehicleLightType = VehicleLightType::GetFromLiteral(kVehicleLightType.GetLiteral()); + } + // clone indicators + // clone children + return clonedObject; + } + + std::string VehicleLightImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleLightImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleLightImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleLightImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleLightImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE) + { + auto vehicleLightType = GetVehicleLightType(); + return vehicleLightType.GetLiteral() != "UNKNOWN" ? vehicleLightType.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool VehicleLightImpl::IsSetVehicleLightType() const + { + return _isSetVehicleLightType; + } + + IOpenScenarioFlexElement* VehicleRoleDistributionImpl::GetOpenScenarioFlexElement() + { + return this; + } + std::vector> VehicleRoleDistributionImpl::GetVehicleRoleDistributionEntries() const + { + std::vector> temp; + for(auto&& elm: _vehicleRoleDistributionEntries) + temp.push_back(elm); + return temp; + } + std::vector> VehicleRoleDistributionImpl::GetWriterVehicleRoleDistributionEntries() const + { + return _vehicleRoleDistributionEntries; + } + + int VehicleRoleDistributionImpl::GetVehicleRoleDistributionEntriesSize() const + { + return static_cast(_vehicleRoleDistributionEntries.size()); + } + + std::shared_ptr VehicleRoleDistributionImpl::GetVehicleRoleDistributionEntriesAtIndex(unsigned int index) const + { + if (index >= 0 && _vehicleRoleDistributionEntries.size() > index) + { + return _vehicleRoleDistributionEntries[index]; + } + return nullptr; + } + + + void VehicleRoleDistributionImpl::SetVehicleRoleDistributionEntries(std::vector>& vehicleRoleDistributionEntries) + { + _vehicleRoleDistributionEntries = vehicleRoleDistributionEntries; + _isSetVehicleRoleDistributionEntries = true; + } + + std::shared_ptr VehicleRoleDistributionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleRoleDistributionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleRoleDistribution).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleRoleDistributionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleRoleDistributionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleRoleDistributionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleRoleDistributionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleRoleDistributionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VehicleRoleDistributionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleRoleDistributionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleRoleDistributionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleRoleDistributionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleRoleDistributionImpl::GetModelType() const + { + return "VehicleRoleDistribution"; + } + + // children + + VehicleRoleDistributionImpl::VehicleRoleDistributionImpl() + { + /** + * Filling the property to type map + */ + } + + void VehicleRoleDistributionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + } + + SimpleType VehicleRoleDistributionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleRoleDistributionImpl::GetChildren() const + { + std::vector> result; + + auto vehicleRoleDistributionEntries = GetWriterVehicleRoleDistributionEntries(); + if (!vehicleRoleDistributionEntries.empty()) + { + for(auto&& item : vehicleRoleDistributionEntries) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleRoleDistributionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // clone indicators + // clone children + const auto kVehicleRoleDistributionEntries = GetWriterVehicleRoleDistributionEntries(); + if (!kVehicleRoleDistributionEntries.empty()) + { + std::vector> clonedList; + for(auto&& kItem : kVehicleRoleDistributionEntries) + { + auto clonedChild = std::dynamic_pointer_cast(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_cast(clonedChild)); + } + clonedObject->SetVehicleRoleDistributionEntries(clonedList); + } + return clonedObject; + } + + std::string VehicleRoleDistributionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleRoleDistributionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleRoleDistributionImpl::GetListChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY) + { + std::vector> vect; + for (auto&& elem : GetVehicleRoleDistributionEntries()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + + } + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleRoleDistributionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleRoleDistributionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + + + bool VehicleRoleDistributionImpl::IsSetVehicleRoleDistributionEntries() const + { + return _isSetVehicleRoleDistributionEntries; + } + + IOpenScenarioFlexElement* VehicleRoleDistributionEntryImpl::GetOpenScenarioFlexElement() + { + return this; + } + Role VehicleRoleDistributionEntryImpl::GetRole() const + { + return _role; + } + double VehicleRoleDistributionEntryImpl::GetWeight() const + { + return _weight; + } + + + void VehicleRoleDistributionEntryImpl::SetRole(const Role role) + { + _role = role; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE); + _isSetRole = true; + } + + void VehicleRoleDistributionEntryImpl::SetWeight(const double weight) + { + _weight = weight; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + _isSetWeight = true; + } + + std::shared_ptr VehicleRoleDistributionEntryImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VehicleRoleDistributionEntryImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVehicleRoleDistributionEntry).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVehicleRoleDistributionEntryWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VehicleRoleDistributionEntryImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VehicleRoleDistributionEntryImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VehicleRoleDistributionEntryImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VehicleRoleDistributionEntryImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + return GetWeight(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VehicleRoleDistributionEntryImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VehicleRoleDistributionEntryImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VehicleRoleDistributionEntryImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VehicleRoleDistributionEntryImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VehicleRoleDistributionEntryImpl::GetModelType() const + { + return "VehicleRoleDistributionEntry"; + } + + void VehicleRoleDistributionEntryImpl::WriteParameterToRole(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, parameterName, nullTextMarker /*no textmarker*/); + _role = {}; + } + + void VehicleRoleDistributionEntryImpl::WriteParameterToWeight(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, parameterName, nullTextMarker /*no textmarker*/); + _weight = {}; + } + + std::string VehicleRoleDistributionEntryImpl::GetParameterFromRole() const + { + auto role = OSC_CONSTANTS::ATTRIBUTE__ROLE; + return GetParameterNameFromAttribute(role); + } + + std::string VehicleRoleDistributionEntryImpl::GetParameterFromWeight() const + { + auto weight = OSC_CONSTANTS::ATTRIBUTE__WEIGHT; + return GetParameterNameFromAttribute(weight); + } + + bool VehicleRoleDistributionEntryImpl::IsRoleParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROLE); + if (kIt != keys.end()) + return true; + return false; + } + + bool VehicleRoleDistributionEntryImpl::IsWeightParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__WEIGHT); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + VehicleRoleDistributionEntryImpl::VehicleRoleDistributionEntryImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROLE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, SimpleType::DOUBLE); + } + + void VehicleRoleDistributionEntryImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + // Enumeration Type + const auto kResult = Role::GetFromLiteral(parameterLiteralValue); + if (kResult != Role::UNKNOWN) + { + _role = kResult; + AddResolvedParameter(attributeKey); + _isSetRole = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + } + + SimpleType VehicleRoleDistributionEntryImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VehicleRoleDistributionEntryImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VehicleRoleDistributionEntryImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kRole = GetRole(); + if ( kRole.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_role = Role::GetFromLiteral(kRole.GetLiteral()); + } + // Simple type + clonedObject->_weight = GetWeight(); + // clone indicators + // clone children + return clonedObject; + } + + std::string VehicleRoleDistributionEntryImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleRoleDistributionEntryImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> VehicleRoleDistributionEntryImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VehicleRoleDistributionEntryImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VehicleRoleDistributionEntryImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ROLE) + { + auto role = GetRole(); + return role.GetLiteral() != "UNKNOWN" ? role.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void VehicleRoleDistributionEntryImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__WEIGHT) + { + // Simple type + _weight = value; + AddResolvedParameter(attributeKey); + _isSetWeight = true; + } + + } + + + bool VehicleRoleDistributionEntryImpl::IsSetRole() const + { + return _isSetRole; + } + bool VehicleRoleDistributionEntryImpl::IsSetWeight() const + { + return _isSetWeight; + } + + IOpenScenarioFlexElement* VertexImpl::GetOpenScenarioFlexElement() + { + return this; + } + double VertexImpl::GetTime() const + { + return _time; + } + std::shared_ptr VertexImpl::GetPosition() const + { + return _position; + } + + + void VertexImpl::SetTime(const double time) + { + _time = time; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME); + _isSetTime = true; + } + + void VertexImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr VertexImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VertexImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVertex).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVertexWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VertexImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VertexImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VertexImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VertexImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + return GetTime(); + } + throw KeyNotSupportedException(); + + } + + uint16_t VertexImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VertexImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime VertexImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VertexImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VertexImpl::GetModelType() const + { + return "Vertex"; + } + + void VertexImpl::WriteParameterToTime(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, parameterName, nullTextMarker /*no textmarker*/); + _time = {}; + } + + std::string VertexImpl::GetParameterFromTime() const + { + auto time = OSC_CONSTANTS::ATTRIBUTE__TIME; + return GetParameterNameFromAttribute(time); + } + + bool VertexImpl::IsTimeParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TIME); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr VertexImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + VertexImpl::VertexImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TIME, SimpleType::DOUBLE); + } + + void VertexImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + } + + SimpleType VertexImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VertexImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VertexImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_time = GetTime(); + // clone indicators + clonedObject->_isSetTime = _isSetTime; + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string VertexImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VertexImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> VertexImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VertexImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VertexImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void VertexImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TIME) + { + // Simple type + _time = value; + AddResolvedParameter(attributeKey); + _isSetTime = true; + } + + } + + + void VertexImpl::ResetTime() + { + _isSetTime = false; + _time = {}; + + } + bool VertexImpl::IsSetTime() const + { + return _isSetTime; + } + bool VertexImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* VisibilityActionImpl::GetOpenScenarioFlexElement() + { + return this; + } + bool VisibilityActionImpl::GetGraphics() const + { + return _graphics; + } + bool VisibilityActionImpl::GetSensors() const + { + return _sensors; + } + bool VisibilityActionImpl::GetTraffic() const + { + return _traffic; + } + std::shared_ptr VisibilityActionImpl::GetSensorReferenceSet() const + { + return _sensorReferenceSet; + } + + + void VisibilityActionImpl::SetGraphics(const bool graphics) + { + _graphics = graphics; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS); + _isSetGraphics = true; + } + + void VisibilityActionImpl::SetSensors(const bool sensors) + { + _sensors = sensors; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SENSORS); + _isSetSensors = true; + } + + void VisibilityActionImpl::SetTraffic(const bool traffic) + { + _traffic = traffic; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC); + _isSetTraffic = true; + } + + void VisibilityActionImpl::SetSensorReferenceSet(std::shared_ptr sensorReferenceSet) + { + _sensorReferenceSet = sensorReferenceSet; + _isSetSensorReferenceSet = true; + } + + std::shared_ptr VisibilityActionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(VisibilityActionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IVisibilityAction).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IVisibilityActionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr VisibilityActionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t VisibilityActionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int VisibilityActionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double VisibilityActionImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t VisibilityActionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool VisibilityActionImpl::GetBooleanProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__GRAPHICS) + { + return GetGraphics(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SENSORS) + { + return GetSensors(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC) + { + return GetTraffic(); + } + throw KeyNotSupportedException(); + + } + + DateTime VisibilityActionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr VisibilityActionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string VisibilityActionImpl::GetModelType() const + { + return "VisibilityAction"; + } + + void VisibilityActionImpl::WriteParameterToGraphics(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, parameterName, nullTextMarker /*no textmarker*/); + _graphics = {}; + } + + void VisibilityActionImpl::WriteParameterToSensors(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SENSORS, parameterName, nullTextMarker /*no textmarker*/); + _sensors = {}; + } + + void VisibilityActionImpl::WriteParameterToTraffic(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, parameterName, nullTextMarker /*no textmarker*/); + _traffic = {}; + } + + std::string VisibilityActionImpl::GetParameterFromGraphics() const + { + auto graphics = OSC_CONSTANTS::ATTRIBUTE__GRAPHICS; + return GetParameterNameFromAttribute(graphics); + } + + std::string VisibilityActionImpl::GetParameterFromSensors() const + { + auto sensors = OSC_CONSTANTS::ATTRIBUTE__SENSORS; + return GetParameterNameFromAttribute(sensors); + } + + std::string VisibilityActionImpl::GetParameterFromTraffic() const + { + auto traffic = OSC_CONSTANTS::ATTRIBUTE__TRAFFIC; + return GetParameterNameFromAttribute(traffic); + } + + bool VisibilityActionImpl::IsGraphicsParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__GRAPHICS); + if (kIt != keys.end()) + return true; + return false; + } + + bool VisibilityActionImpl::IsSensorsParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SENSORS); + if (kIt != keys.end()) + return true; + return false; + } + + bool VisibilityActionImpl::IsTrafficParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TRAFFIC); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr VisibilityActionImpl::GetWriterSensorReferenceSet() const + { + return std::dynamic_pointer_cast(_sensorReferenceSet); + } + + VisibilityActionImpl::VisibilityActionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SENSORS, SimpleType::BOOLEAN); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, SimpleType::BOOLEAN); + } + + void VisibilityActionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GRAPHICS) + { + // Simple type + _graphics = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetGraphics = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SENSORS) + { + // Simple type + _sensors = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSensors = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC) + { + // Simple type + _traffic = ParserHelper::ParseBoolean(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTraffic = true; + } + } + + SimpleType VisibilityActionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> VisibilityActionImpl::GetChildren() const + { + std::vector> result; + + const auto kSensorReferenceSet = GetWriterSensorReferenceSet(); + if (kSensorReferenceSet) + { + result.push_back(std::dynamic_pointer_cast(kSensorReferenceSet)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr VisibilityActionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_graphics = GetGraphics(); + // Simple type + clonedObject->_sensors = GetSensors(); + // Simple type + clonedObject->_traffic = GetTraffic(); + // clone indicators + // clone children + const auto kSensorReferenceSet = GetWriterSensorReferenceSet(); + if (kSensorReferenceSet) + { + auto clonedChild = std::dynamic_pointer_cast(kSensorReferenceSet)->Clone(); + auto clonedChildISensorReferenceSet = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSensorReferenceSet(std::dynamic_pointer_cast(clonedChildISensorReferenceSet)); + } + return clonedObject; + } + + std::string VisibilityActionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr VisibilityActionImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE_SET) + { + return std::dynamic_pointer_cast(GetSensorReferenceSet()); + } + throw KeyNotSupportedException(); + } + + std::vector> VisibilityActionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr VisibilityActionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string VisibilityActionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void VisibilityActionImpl::ResolveBooleanExpression(std::string& attributeKey, bool& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__GRAPHICS) + { + // Simple type + _graphics = value; + AddResolvedParameter(attributeKey); + _isSetGraphics = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SENSORS) + { + // Simple type + _sensors = value; + AddResolvedParameter(attributeKey); + _isSetSensors = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TRAFFIC) + { + // Simple type + _traffic = value; + AddResolvedParameter(attributeKey); + _isSetTraffic = true; + } + + } + + + bool VisibilityActionImpl::IsSetGraphics() const + { + return _isSetGraphics; + } + bool VisibilityActionImpl::IsSetSensors() const + { + return _isSetSensors; + } + bool VisibilityActionImpl::IsSetTraffic() const + { + return _isSetTraffic; + } + void VisibilityActionImpl::ResetSensorReferenceSet() + { + _isSetSensorReferenceSet = false; + _sensorReferenceSet = {}; + + } + bool VisibilityActionImpl::IsSetSensorReferenceSet() const + { + return _isSetSensorReferenceSet; + } + + IOpenScenarioFlexElement* WaypointImpl::GetOpenScenarioFlexElement() + { + return this; + } + RouteStrategy WaypointImpl::GetRouteStrategy() const + { + return _routeStrategy; + } + std::shared_ptr WaypointImpl::GetPosition() const + { + return _position; + } + + + void WaypointImpl::SetRouteStrategy(const RouteStrategy routeStrategy) + { + _routeStrategy = routeStrategy; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY); + _isSetRouteStrategy = true; + } + + void WaypointImpl::SetPosition(std::shared_ptr position) + { + _position = position; + _isSetPosition = true; + } + + std::shared_ptr WaypointImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(WaypointImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IWaypoint).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IWaypointWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr WaypointImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t WaypointImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int WaypointImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double WaypointImpl::GetDoubleProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + uint16_t WaypointImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool WaypointImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime WaypointImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr WaypointImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string WaypointImpl::GetModelType() const + { + return "Waypoint"; + } + + void WaypointImpl::WriteParameterToRouteStrategy(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, parameterName, nullTextMarker /*no textmarker*/); + _routeStrategy = {}; + } + + std::string WaypointImpl::GetParameterFromRouteStrategy() const + { + auto routeStrategy = OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY; + return GetParameterNameFromAttribute(routeStrategy); + } + + bool WaypointImpl::IsRouteStrategyParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr WaypointImpl::GetWriterPosition() const + { + return std::dynamic_pointer_cast(_position); + } + + WaypointImpl::WaypointImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, SimpleType::ENUM_TYPE); + } + + void WaypointImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY) + { + // Enumeration Type + const auto kResult = RouteStrategy::GetFromLiteral(parameterLiteralValue); + if (kResult != RouteStrategy::UNKNOWN) + { + _routeStrategy = kResult; + AddResolvedParameter(attributeKey); + _isSetRouteStrategy = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + } + + SimpleType WaypointImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> WaypointImpl::GetChildren() const + { + std::vector> result; + + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + result.push_back(std::dynamic_pointer_cast(kPosition)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr WaypointImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Enumeration Type + const auto kRouteStrategy = GetRouteStrategy(); + if ( kRouteStrategy.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_routeStrategy = RouteStrategy::GetFromLiteral(kRouteStrategy.GetLiteral()); + } + // clone indicators + // clone children + const auto kPosition = GetWriterPosition(); + if (kPosition) + { + auto clonedChild = std::dynamic_pointer_cast(kPosition)->Clone(); + auto clonedChildIPosition = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPosition(std::dynamic_pointer_cast(clonedChildIPosition)); + } + return clonedObject; + } + + std::string WaypointImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr WaypointImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__POSITION) + { + return std::dynamic_pointer_cast(GetPosition()); + } + throw KeyNotSupportedException(); + } + + std::vector> WaypointImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr WaypointImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string WaypointImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY) + { + auto routeStrategy = GetRouteStrategy(); + return routeStrategy.GetLiteral() != "UNKNOWN" ? routeStrategy.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + + + bool WaypointImpl::IsSetRouteStrategy() const + { + return _isSetRouteStrategy; + } + bool WaypointImpl::IsSetPosition() const + { + return _isSetPosition; + } + + IOpenScenarioFlexElement* WeatherImpl::GetOpenScenarioFlexElement() + { + return this; + } + double WeatherImpl::GetAtmosphericPressure() const + { + return _atmosphericPressure; + } + CloudState WeatherImpl::GetCloudState() const + { + return _cloudState; + } + FractionalCloudCover WeatherImpl::GetFractionalCloudCover() const + { + return _fractionalCloudCover; + } + double WeatherImpl::GetTemperature() const + { + return _temperature; + } + std::shared_ptr WeatherImpl::GetSun() const + { + return _sun; + } + std::shared_ptr WeatherImpl::GetFog() const + { + return _fog; + } + std::shared_ptr WeatherImpl::GetPrecipitation() const + { + return _precipitation; + } + std::shared_ptr WeatherImpl::GetWind() const + { + return _wind; + } + std::shared_ptr WeatherImpl::GetDomeImage() const + { + return _domeImage; + } + + + void WeatherImpl::SetAtmosphericPressure(const double atmosphericPressure) + { + _atmosphericPressure = atmosphericPressure; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + _isSetAtmosphericPressure = true; + } + + void WeatherImpl::SetCloudState(const CloudState cloudState) + { + _cloudState = cloudState; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE); + _isSetCloudState = true; + } + + void WeatherImpl::SetFractionalCloudCover(const FractionalCloudCover fractionalCloudCover) + { + _fractionalCloudCover = fractionalCloudCover; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER); + _isSetFractionalCloudCover = true; + } + + void WeatherImpl::SetTemperature(const double temperature) + { + _temperature = temperature; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + _isSetTemperature = true; + } + + void WeatherImpl::SetSun(std::shared_ptr sun) + { + _sun = sun; + _isSetSun = true; + } + + void WeatherImpl::SetFog(std::shared_ptr fog) + { + _fog = fog; + _isSetFog = true; + } + + void WeatherImpl::SetPrecipitation(std::shared_ptr precipitation) + { + _precipitation = precipitation; + _isSetPrecipitation = true; + } + + void WeatherImpl::SetWind(std::shared_ptr wind) + { + _wind = wind; + _isSetWind = true; + } + + void WeatherImpl::SetDomeImage(std::shared_ptr domeImage) + { + _domeImage = domeImage; + _isSetDomeImage = true; + } + + std::shared_ptr WeatherImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(WeatherImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IWeather).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IWeatherWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr WeatherImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t WeatherImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int WeatherImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double WeatherImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE) + { + return GetAtmosphericPressure(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE) + { + return GetTemperature(); + } + throw KeyNotSupportedException(); + + } + + uint16_t WeatherImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool WeatherImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime WeatherImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr WeatherImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string WeatherImpl::GetModelType() const + { + return "Weather"; + } + + void WeatherImpl::WriteParameterToAtmosphericPressure(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, parameterName, nullTextMarker /*no textmarker*/); + _atmosphericPressure = {}; + } + + void WeatherImpl::WriteParameterToCloudState(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, parameterName, nullTextMarker /*no textmarker*/); + _cloudState = {}; + } + + void WeatherImpl::WriteParameterToFractionalCloudCover(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, parameterName, nullTextMarker /*no textmarker*/); + _fractionalCloudCover = {}; + } + + void WeatherImpl::WriteParameterToTemperature(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, parameterName, nullTextMarker /*no textmarker*/); + _temperature = {}; + } + + std::string WeatherImpl::GetParameterFromAtmosphericPressure() const + { + auto atmosphericPressure = OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE; + return GetParameterNameFromAttribute(atmosphericPressure); + } + + std::string WeatherImpl::GetParameterFromCloudState() const + { + auto cloudState = OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE; + return GetParameterNameFromAttribute(cloudState); + } + + std::string WeatherImpl::GetParameterFromFractionalCloudCover() const + { + auto fractionalCloudCover = OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER; + return GetParameterNameFromAttribute(fractionalCloudCover); + } + + std::string WeatherImpl::GetParameterFromTemperature() const + { + auto temperature = OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE; + return GetParameterNameFromAttribute(temperature); + } + + bool WeatherImpl::IsAtmosphericPressureParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE); + if (kIt != keys.end()) + return true; + return false; + } + + bool WeatherImpl::IsCloudStateParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE); + if (kIt != keys.end()) + return true; + return false; + } + + bool WeatherImpl::IsFractionalCloudCoverParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER); + if (kIt != keys.end()) + return true; + return false; + } + + bool WeatherImpl::IsTemperatureParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE); + if (kIt != keys.end()) + return true; + return false; + } + + // children + std::shared_ptr WeatherImpl::GetWriterSun() const + { + return std::dynamic_pointer_cast(_sun); + } + std::shared_ptr WeatherImpl::GetWriterFog() const + { + return std::dynamic_pointer_cast(_fog); + } + std::shared_ptr WeatherImpl::GetWriterPrecipitation() const + { + return std::dynamic_pointer_cast(_precipitation); + } + std::shared_ptr WeatherImpl::GetWriterWind() const + { + return std::dynamic_pointer_cast(_wind); + } + std::shared_ptr WeatherImpl::GetWriterDomeImage() const + { + return std::dynamic_pointer_cast(_domeImage); + } + + WeatherImpl::WeatherImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, SimpleType::ENUM_TYPE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, SimpleType::DOUBLE); + } + + void WeatherImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE) + { + // Simple type + _atmosphericPressure = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetAtmosphericPressure = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE) + { + // Enumeration Type + const auto kResult = CloudState::GetFromLiteral(parameterLiteralValue); + if (kResult != CloudState::UNKNOWN) + { + _cloudState = kResult; + AddResolvedParameter(attributeKey); + _isSetCloudState = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER) + { + // Enumeration Type + const auto kResult = FractionalCloudCover::GetFromLiteral(parameterLiteralValue); + if (kResult != FractionalCloudCover::UNKNOWN) + { + _fractionalCloudCover = kResult; + AddResolvedParameter(attributeKey); + _isSetFractionalCloudCover = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE) + { + // Simple type + _temperature = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetTemperature = true; + } + } + + SimpleType WeatherImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> WeatherImpl::GetChildren() const + { + std::vector> result; + + const auto kSun = GetWriterSun(); + if (kSun) + { + result.push_back(std::dynamic_pointer_cast(kSun)); + } + const auto kFog = GetWriterFog(); + if (kFog) + { + result.push_back(std::dynamic_pointer_cast(kFog)); + } + const auto kPrecipitation = GetWriterPrecipitation(); + if (kPrecipitation) + { + result.push_back(std::dynamic_pointer_cast(kPrecipitation)); + } + const auto kWind = GetWriterWind(); + if (kWind) + { + result.push_back(std::dynamic_pointer_cast(kWind)); + } + const auto kDomeImage = GetWriterDomeImage(); + if (kDomeImage) + { + result.push_back(std::dynamic_pointer_cast(kDomeImage)); + } + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr WeatherImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_atmosphericPressure = GetAtmosphericPressure(); + // Enumeration Type + const auto kCloudState = GetCloudState(); + if ( kCloudState.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_cloudState = CloudState::GetFromLiteral(kCloudState.GetLiteral()); + } + // Enumeration Type + const auto kFractionalCloudCover = GetFractionalCloudCover(); + if ( kFractionalCloudCover.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_fractionalCloudCover = FractionalCloudCover::GetFromLiteral(kFractionalCloudCover.GetLiteral()); + } + // Simple type + clonedObject->_temperature = GetTemperature(); + // clone indicators + clonedObject->_isSetAtmosphericPressure = _isSetAtmosphericPressure; + clonedObject->_isSetCloudState = _isSetCloudState; + clonedObject->_isSetFractionalCloudCover = _isSetFractionalCloudCover; + clonedObject->_isSetTemperature = _isSetTemperature; + // clone children + const auto kSun = GetWriterSun(); + if (kSun) + { + auto clonedChild = std::dynamic_pointer_cast(kSun)->Clone(); + auto clonedChildISun = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetSun(std::dynamic_pointer_cast(clonedChildISun)); + } + const auto kFog = GetWriterFog(); + if (kFog) + { + auto clonedChild = std::dynamic_pointer_cast(kFog)->Clone(); + auto clonedChildIFog = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetFog(std::dynamic_pointer_cast(clonedChildIFog)); + } + const auto kPrecipitation = GetWriterPrecipitation(); + if (kPrecipitation) + { + auto clonedChild = std::dynamic_pointer_cast(kPrecipitation)->Clone(); + auto clonedChildIPrecipitation = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetPrecipitation(std::dynamic_pointer_cast(clonedChildIPrecipitation)); + } + const auto kWind = GetWriterWind(); + if (kWind) + { + auto clonedChild = std::dynamic_pointer_cast(kWind)->Clone(); + auto clonedChildIWind = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetWind(std::dynamic_pointer_cast(clonedChildIWind)); + } + const auto kDomeImage = GetWriterDomeImage(); + if (kDomeImage) + { + auto clonedChild = std::dynamic_pointer_cast(kDomeImage)->Clone(); + auto clonedChildIDomeImage = std::dynamic_pointer_cast(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->SetDomeImage(std::dynamic_pointer_cast(clonedChildIDomeImage)); + } + return clonedObject; + } + + std::string WeatherImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr WeatherImpl::GetChildElement(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ELEMENT__SUN) + { + return std::dynamic_pointer_cast(GetSun()); + } + + if (key == OSC_CONSTANTS::ELEMENT__FOG) + { + return std::dynamic_pointer_cast(GetFog()); + } + + if (key == OSC_CONSTANTS::ELEMENT__PRECIPITATION) + { + return std::dynamic_pointer_cast(GetPrecipitation()); + } + + if (key == OSC_CONSTANTS::ELEMENT__WIND) + { + return std::dynamic_pointer_cast(GetWind()); + } + + if (key == OSC_CONSTANTS::ELEMENT__DOME_IMAGE) + { + return std::dynamic_pointer_cast(GetDomeImage()); + } + throw KeyNotSupportedException(); + } + + std::vector> WeatherImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr WeatherImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string WeatherImpl::GetEnumerationLiteral(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE) + { + auto cloudState = GetCloudState(); + return cloudState.GetLiteral() != "UNKNOWN" ? cloudState.GetLiteral() : ""; + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER) + { + auto fractionalCloudCover = GetFractionalCloudCover(); + return fractionalCloudCover.GetLiteral() != "UNKNOWN" ? fractionalCloudCover.GetLiteral() : ""; + } + throw KeyNotSupportedException(); + } + void WeatherImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE) + { + // Simple type + _atmosphericPressure = value; + AddResolvedParameter(attributeKey); + _isSetAtmosphericPressure = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE) + { + // Simple type + _temperature = value; + AddResolvedParameter(attributeKey); + _isSetTemperature = true; + } + + } + + + void WeatherImpl::ResetAtmosphericPressure() + { + _isSetAtmosphericPressure = false; + _atmosphericPressure = {}; + + } + bool WeatherImpl::IsSetAtmosphericPressure() const + { + return _isSetAtmosphericPressure; + } + void WeatherImpl::ResetCloudState() + { + _isSetCloudState = false; + _cloudState = {}; + + } + bool WeatherImpl::IsSetCloudState() const + { + return _isSetCloudState; + } + void WeatherImpl::ResetFractionalCloudCover() + { + _isSetFractionalCloudCover = false; + _fractionalCloudCover = {}; + + } + bool WeatherImpl::IsSetFractionalCloudCover() const + { + return _isSetFractionalCloudCover; + } + void WeatherImpl::ResetTemperature() + { + _isSetTemperature = false; + _temperature = {}; + + } + bool WeatherImpl::IsSetTemperature() const + { + return _isSetTemperature; + } + void WeatherImpl::ResetSun() + { + _isSetSun = false; + _sun = {}; + + } + bool WeatherImpl::IsSetSun() const + { + return _isSetSun; + } + void WeatherImpl::ResetFog() + { + _isSetFog = false; + _fog = {}; + + } + bool WeatherImpl::IsSetFog() const + { + return _isSetFog; + } + void WeatherImpl::ResetPrecipitation() + { + _isSetPrecipitation = false; + _precipitation = {}; + + } + bool WeatherImpl::IsSetPrecipitation() const + { + return _isSetPrecipitation; + } + void WeatherImpl::ResetWind() + { + _isSetWind = false; + _wind = {}; + + } + bool WeatherImpl::IsSetWind() const + { + return _isSetWind; + } + void WeatherImpl::ResetDomeImage() + { + _isSetDomeImage = false; + _domeImage = {}; + + } + bool WeatherImpl::IsSetDomeImage() const + { + return _isSetDomeImage; + } + + IOpenScenarioFlexElement* WindImpl::GetOpenScenarioFlexElement() + { + return this; + } + double WindImpl::GetDirection() const + { + return _direction; + } + double WindImpl::GetSpeed() const + { + return _speed; + } + + + void WindImpl::SetDirection(const double direction) + { + _direction = direction; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + _isSetDirection = true; + } + + void WindImpl::SetSpeed(const double speed) + { + _speed = speed; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED); + _isSetSpeed = true; + } + + std::shared_ptr WindImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(WindImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IWind).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IWindWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr WindImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t WindImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int WindImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double WindImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + return GetDirection(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + return GetSpeed(); + } + throw KeyNotSupportedException(); + + } + + uint16_t WindImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool WindImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime WindImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr WindImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string WindImpl::GetModelType() const + { + return "Wind"; + } + + void WindImpl::WriteParameterToDirection(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, parameterName, nullTextMarker /*no textmarker*/); + _direction = {}; + } + + void WindImpl::WriteParameterToSpeed(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, parameterName, nullTextMarker /*no textmarker*/); + _speed = {}; + } + + std::string WindImpl::GetParameterFromDirection() const + { + auto direction = OSC_CONSTANTS::ATTRIBUTE__DIRECTION; + return GetParameterNameFromAttribute(direction); + } + + std::string WindImpl::GetParameterFromSpeed() const + { + auto speed = OSC_CONSTANTS::ATTRIBUTE__SPEED; + return GetParameterNameFromAttribute(speed); + } + + bool WindImpl::IsDirectionParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__DIRECTION); + if (kIt != keys.end()) + return true; + return false; + } + + bool WindImpl::IsSpeedParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__SPEED); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + WindImpl::WindImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__SPEED, SimpleType::DOUBLE); + } + + void WindImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + // Simple type + _direction = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetDirection = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + } + + SimpleType WindImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> WindImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr WindImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_direction = GetDirection(); + // Simple type + clonedObject->_speed = GetSpeed(); + // clone indicators + // clone children + return clonedObject; + } + + std::string WindImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr WindImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> WindImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr WindImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string WindImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void WindImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__DIRECTION) + { + // Simple type + _direction = value; + AddResolvedParameter(attributeKey); + _isSetDirection = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__SPEED) + { + // Simple type + _speed = value; + AddResolvedParameter(attributeKey); + _isSetSpeed = true; + } + + } + + + bool WindImpl::IsSetDirection() const + { + return _isSetDirection; + } + bool WindImpl::IsSetSpeed() const + { + return _isSetSpeed; + } + + IOpenScenarioFlexElement* WorldPositionImpl::GetOpenScenarioFlexElement() + { + return this; + } + double WorldPositionImpl::GetH() const + { + return _h; + } + double WorldPositionImpl::GetP() const + { + return _p; + } + double WorldPositionImpl::GetR() const + { + return _r; + } + double WorldPositionImpl::GetX() const + { + return _x; + } + double WorldPositionImpl::GetY() const + { + return _y; + } + double WorldPositionImpl::GetZ() const + { + return _z; + } + + + void WorldPositionImpl::SetH(const double h) + { + _h = h; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H); + _isSetH = true; + } + + void WorldPositionImpl::SetP(const double p) + { + _p = p; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P); + _isSetP = true; + } + + void WorldPositionImpl::SetR(const double r) + { + _r = r; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R); + _isSetR = true; + } + + void WorldPositionImpl::SetX(const double x) + { + _x = x; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X); + _isSetX = true; + } + + void WorldPositionImpl::SetY(const double y) + { + _y = y; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y); + _isSetY = true; + } + + void WorldPositionImpl::SetZ(const double z) + { + _z = z; + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z); + _isSetZ = true; + } + + std::shared_ptr WorldPositionImpl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(WorldPositionImpl).name()) + return shared_from_this(); + else if (classifier == typeid(IWorldPosition).name()) + return std::dynamic_pointer_cast(shared_from_this()); + else if (classifier == typeid(IWorldPositionWriter).name()) + return std::dynamic_pointer_cast(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr WorldPositionImpl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t WorldPositionImpl::GetUnsignedIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + int WorldPositionImpl::GetIntProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + double WorldPositionImpl::GetDoubleProperty(std::string key) const + { + if (key.empty()) + { + throw KeyNotSupportedException(); + } + + if (key == OSC_CONSTANTS::ATTRIBUTE__H) + { + return GetH(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__P) + { + return GetP(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__R) + { + return GetR(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__X) + { + return GetX(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__Y) + { + return GetY(); + } else + if (key == OSC_CONSTANTS::ATTRIBUTE__Z) + { + return GetZ(); + } + throw KeyNotSupportedException(); + + } + + uint16_t WorldPositionImpl::GetUnsignedShortProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + bool WorldPositionImpl::GetBooleanProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + DateTime WorldPositionImpl::GetDateTimeProperty(std::string key) const + { + throw KeyNotSupportedException(); + + } + + + std::weak_ptr WorldPositionImpl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string WorldPositionImpl::GetModelType() const + { + return "WorldPosition"; + } + + void WorldPositionImpl::WriteParameterToH(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, parameterName, nullTextMarker /*no textmarker*/); + _h = {}; + } + + void WorldPositionImpl::WriteParameterToP(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, parameterName, nullTextMarker /*no textmarker*/); + _p = {}; + } + + void WorldPositionImpl::WriteParameterToR(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, parameterName, nullTextMarker /*no textmarker*/); + _r = {}; + } + + void WorldPositionImpl::WriteParameterToX(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, parameterName, nullTextMarker /*no textmarker*/); + _x = {}; + } + + void WorldPositionImpl::WriteParameterToY(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, parameterName, nullTextMarker /*no textmarker*/); + _y = {}; + } + + void WorldPositionImpl::WriteParameterToZ(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, parameterName, nullTextMarker /*no textmarker*/); + _z = {}; + } + + std::string WorldPositionImpl::GetParameterFromH() const + { + auto h = OSC_CONSTANTS::ATTRIBUTE__H; + return GetParameterNameFromAttribute(h); + } + + std::string WorldPositionImpl::GetParameterFromP() const + { + auto p = OSC_CONSTANTS::ATTRIBUTE__P; + return GetParameterNameFromAttribute(p); + } + + std::string WorldPositionImpl::GetParameterFromR() const + { + auto r = OSC_CONSTANTS::ATTRIBUTE__R; + return GetParameterNameFromAttribute(r); + } + + std::string WorldPositionImpl::GetParameterFromX() const + { + auto x = OSC_CONSTANTS::ATTRIBUTE__X; + return GetParameterNameFromAttribute(x); + } + + std::string WorldPositionImpl::GetParameterFromY() const + { + auto y = OSC_CONSTANTS::ATTRIBUTE__Y; + return GetParameterNameFromAttribute(y); + } + + std::string WorldPositionImpl::GetParameterFromZ() const + { + auto z = OSC_CONSTANTS::ATTRIBUTE__Z; + return GetParameterNameFromAttribute(z); + } + + bool WorldPositionImpl::IsHParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__H); + if (kIt != keys.end()) + return true; + return false; + } + + bool WorldPositionImpl::IsPParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__P); + if (kIt != keys.end()) + return true; + return false; + } + + bool WorldPositionImpl::IsRParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__R); + if (kIt != keys.end()) + return true; + return false; + } + + bool WorldPositionImpl::IsXParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__X); + if (kIt != keys.end()) + return true; + return false; + } + + bool WorldPositionImpl::IsYParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__Y); + if (kIt != keys.end()) + return true; + return false; + } + + bool WorldPositionImpl::IsZParameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__Z); + if (kIt != keys.end()) + return true; + return false; + } + + // children + + WorldPositionImpl::WorldPositionImpl() + { + /** + * Filling the property to type map + */ + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__H, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__P, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__R, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__X, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__Y, SimpleType::DOUBLE); + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__Z, SimpleType::DOUBLE); + } + + void WorldPositionImpl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H) + { + // Simple type + _h = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetH = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__P) + { + // Simple type + _p = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetP = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__R) + { + // Simple type + _r = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetR = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__X) + { + // Simple type + _x = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Y) + { + // Simple type + _y = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetY = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Z) + { + // Simple type + _z = ParserHelper::ParseDouble(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSetZ = true; + } + } + + SimpleType WorldPositionImpl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> WorldPositionImpl::GetChildren() const + { + std::vector> result; + + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr WorldPositionImpl::Clone() + { + auto clonedObject = std::make_shared(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + // Simple type + clonedObject->_h = GetH(); + // Simple type + clonedObject->_p = GetP(); + // Simple type + clonedObject->_r = GetR(); + // Simple type + clonedObject->_x = GetX(); + // Simple type + clonedObject->_y = GetY(); + // Simple type + clonedObject->_z = GetZ(); + // clone indicators + clonedObject->_isSetH = _isSetH; + clonedObject->_isSetP = _isSetP; + clonedObject->_isSetR = _isSetR; + clonedObject->_isSetZ = _isSetZ; + // clone children + return clonedObject; + } + + std::string WorldPositionImpl::GetStringProperty(std::string key) const + { + // proxies and string attributes + throw KeyNotSupportedException(); + } + + std::shared_ptr WorldPositionImpl::GetChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::vector> WorldPositionImpl::GetListChildElement(std::string key) const + { + throw KeyNotSupportedException(); + } + + std::shared_ptr WorldPositionImpl::GetReferencedElement(std::string key, std::string name) const + { + throw KeyNotSupportedException(); + } + + std::string WorldPositionImpl::GetEnumerationLiteral(std::string key) const + { + throw KeyNotSupportedException(); + } + void WorldPositionImpl::ResolveDoubleExpression(std::string& attributeKey, double& value) + { + if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__H) + { + // Simple type + _h = value; + AddResolvedParameter(attributeKey); + _isSetH = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__P) + { + // Simple type + _p = value; + AddResolvedParameter(attributeKey); + _isSetP = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__R) + { + // Simple type + _r = value; + AddResolvedParameter(attributeKey); + _isSetR = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__X) + { + // Simple type + _x = value; + AddResolvedParameter(attributeKey); + _isSetX = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Y) + { + // Simple type + _y = value; + AddResolvedParameter(attributeKey); + _isSetY = true; + } + else if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__Z) + { + // Simple type + _z = value; + AddResolvedParameter(attributeKey); + _isSetZ = true; + } + + } + + + void WorldPositionImpl::ResetH() + { + _isSetH = false; + _h = {0}; + + } + bool WorldPositionImpl::IsSetH() const + { + return _isSetH; + } + void WorldPositionImpl::ResetP() + { + _isSetP = false; + _p = {0}; + + } + bool WorldPositionImpl::IsSetP() const + { + return _isSetP; + } + void WorldPositionImpl::ResetR() + { + _isSetR = false; + _r = {0}; + + } + bool WorldPositionImpl::IsSetR() const + { + return _isSetR; + } + bool WorldPositionImpl::IsSetX() const + { + return _isSetX; + } + bool WorldPositionImpl::IsSetY() const + { + return _isSetY; + } + void WorldPositionImpl::ResetZ() + { + _isSetZ = false; + _z = {0}; + + } + bool WorldPositionImpl::IsSetZ() const + { + return _isSetZ; + } + } +} + + diff --git a/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.h b/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.h new file mode 100644 index 00000000..fb58b3f1 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/impl/ApiClassImplV1_3.h @@ -0,0 +1,31544 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ApiClassInterfacesV1_3.h" +#include "ApiClassWriterInterfacesV1_3.h" +#include "BaseImpl.h" +#include "IParserMessageLogger.h" +#include "ParserHelper.h" +#include "ParameterValue.h" +#include "INamedReference.h" +#include "MemLeakDetection.h" +#include "KeyNotSupportedException.h" +#include "OscConstantsV1_3.h" +#include "ExportDefinitions.h" + +// helper.getTypeImportCpp(element,packageName).each{importedType->%>import =importedType%> + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAbsoluteSpeed. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAbsoluteSpeed) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteSpeedImpl: public BaseImpl, public IAbsoluteSpeedWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + bool _isSetSteadyState = false; + std::shared_ptr _steadyState {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AbsoluteSpeedImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSteadyState() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetSteadyState(std::shared_ptr steadyState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSteadyState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetSteadyState() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSteadyState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAbsoluteTargetLane. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAbsoluteTargetLane) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneImpl: public BaseImpl, public IAbsoluteTargetLaneWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP AbsoluteTargetLaneImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAbsoluteTargetLaneOffset. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAbsoluteTargetLaneOffset) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneOffsetImpl: public BaseImpl, public IAbsoluteTargetLaneOffsetWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AbsoluteTargetLaneOffsetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAbsoluteTargetSpeed. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAbsoluteTargetSpeed) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetSpeedImpl: public BaseImpl, public IAbsoluteTargetSpeedWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AbsoluteTargetSpeedImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAccelerationCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAccelerationCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AccelerationConditionImpl: public BaseImpl, public IAccelerationConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirection = false; + DirectionalDimension _direction {}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AccelerationConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DirectionalDimension GetDirection() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetDirection(const DirectionalDimension direction) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDirection(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDirection() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsDirectionParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetDirection() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirection() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAcquirePositionAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAcquirePositionAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AcquirePositionActionImpl: public BaseImpl, public IAcquirePositionActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + OPENSCENARIOLIB_EXP AcquirePositionActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAct. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAct) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActImpl: public BaseImpl, public IActWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetManeuverGroups = false; + std::vector> _maneuverGroups {}; + bool _isSetStartTrigger = false; + std::shared_ptr _startTrigger {}; + bool _isSetStopTrigger = false; + std::shared_ptr _stopTrigger {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ActImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetManeuverGroups() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterManeuverGroups() const override; + OPENSCENARIOLIB_EXP int GetManeuverGroupsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetManeuverGroupsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStartTrigger() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStopTrigger() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetManeuverGroups(std::vector>& maneuverGroups) override; + + OPENSCENARIOLIB_EXP void SetStartTrigger(std::shared_ptr startTrigger) override; + + OPENSCENARIOLIB_EXP void SetStopTrigger(std::shared_ptr stopTrigger) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStartTrigger() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStopTrigger() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetManeuverGroups() const override; + OPENSCENARIOLIB_EXP virtual void ResetStartTrigger() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStartTrigger() const override; + OPENSCENARIOLIB_EXP virtual void ResetStopTrigger() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStopTrigger() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActionImpl: public BaseImpl, public IActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetGlobalAction = false; + std::shared_ptr _globalAction {}; + bool _isSetUserDefinedAction = false; + std::shared_ptr _userDefinedAction {}; + bool _isSetPrivateAction = false; + std::shared_ptr _privateAction {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGlobalAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPrivateAction() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetGlobalAction(std::shared_ptr globalAction) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedAction(std::shared_ptr userDefinedAction) override; + + OPENSCENARIOLIB_EXP void SetPrivateAction(std::shared_ptr privateAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterGlobalAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPrivateAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetGlobalAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrivateAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IActivateControllerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IActivateControllerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActivateControllerActionImpl: public BaseImpl, public IActivateControllerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAnimation = false; + bool _animation {}; + bool _isSetControllerRef = false; + std::shared_ptr> _controllerRef = nullptr; + bool _isSetLateral = false; + bool _lateral {}; + bool _isSetLighting = false; + bool _lighting {}; + bool _isSetLongitudinal = false; + bool _longitudinal {}; + bool _isSetObjectControllerRef = false; + std::shared_ptr> _objectControllerRef = nullptr; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP ActivateControllerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetAnimation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetControllerRef() const override; + OPENSCENARIOLIB_EXP bool GetLateral() const override; + OPENSCENARIOLIB_EXP bool GetLighting() const override; + OPENSCENARIOLIB_EXP bool GetLongitudinal() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetObjectControllerRef() const override; + + + OPENSCENARIOLIB_EXP void SetAnimation(const bool animation) override; + + OPENSCENARIOLIB_EXP void SetControllerRef(std::shared_ptr> controllerRef) override; + + OPENSCENARIOLIB_EXP void SetLateral(const bool lateral) override; + + OPENSCENARIOLIB_EXP void SetLighting(const bool lighting) override; + + OPENSCENARIOLIB_EXP void SetLongitudinal(const bool longitudinal) override; + + OPENSCENARIOLIB_EXP void SetObjectControllerRef(std::shared_ptr> objectControllerRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAnimation(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToControllerRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLateral(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLighting(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLongitudinal(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToObjectControllerRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAnimation() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromControllerRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLateral() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLighting() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLongitudinal() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromObjectControllerRef() const override; + + OPENSCENARIOLIB_EXP bool IsAnimationParameterized() override; + OPENSCENARIOLIB_EXP bool IsControllerRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsLateralParameterized() override; + OPENSCENARIOLIB_EXP bool IsLightingParameterized() override; + OPENSCENARIOLIB_EXP bool IsLongitudinalParameterized() override; + OPENSCENARIOLIB_EXP bool IsObjectControllerRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetAnimation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimation() const override; + OPENSCENARIOLIB_EXP virtual void ResetControllerRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllerRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetLateral() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLateral() const override; + OPENSCENARIOLIB_EXP virtual void ResetLighting() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLighting() const override; + OPENSCENARIOLIB_EXP virtual void ResetLongitudinal() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLongitudinal() const override; + OPENSCENARIOLIB_EXP virtual void ResetObjectControllerRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetObjectControllerRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IActors. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IActors) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActorsImpl: public BaseImpl, public IActorsWriter, public std::enable_shared_from_this + { + private: + bool _isSetSelectTriggeringEntities = false; + bool _selectTriggeringEntities {}; + bool _isSetEntityRefs = false; + std::vector> _entityRefs {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP ActorsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetSelectTriggeringEntities() const override; + OPENSCENARIOLIB_EXP std::vector> GetEntityRefs() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntityRefs() const override; + OPENSCENARIOLIB_EXP int GetEntityRefsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRefsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetSelectTriggeringEntities(const bool selectTriggeringEntities) override; + + OPENSCENARIOLIB_EXP void SetEntityRefs(std::vector>& entityRefs) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToSelectTriggeringEntities(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSelectTriggeringEntities() const override; + + OPENSCENARIOLIB_EXP bool IsSelectTriggeringEntitiesParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetSelectTriggeringEntities() const override; + OPENSCENARIOLIB_EXP virtual void ResetEntityRefs() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRefs() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAddEntityAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAddEntityAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AddEntityActionImpl: public BaseImpl, public IAddEntityActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + OPENSCENARIOLIB_EXP AddEntityActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAngleCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAngleCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AngleConditionImpl: public BaseImpl, public IAngleConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAngle = false; + double _angle {}; + bool _isSetAngleTolerance = false; + double _angleTolerance {}; + bool _isSetAngleType = false; + AngleType _angleType {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AngleConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAngle() const override; + OPENSCENARIOLIB_EXP double GetAngleTolerance() const override; + OPENSCENARIOLIB_EXP AngleType GetAngleType() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + + + OPENSCENARIOLIB_EXP void SetAngle(const double angle) override; + + OPENSCENARIOLIB_EXP void SetAngleTolerance(const double angleTolerance) override; + + OPENSCENARIOLIB_EXP void SetAngleType(const AngleType angleType) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngle(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngleTolerance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngleType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngle() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngleTolerance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngleType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP bool IsAngleParameterized() override; + OPENSCENARIOLIB_EXP bool IsAngleToleranceParameterized() override; + OPENSCENARIOLIB_EXP bool IsAngleTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetAngle() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAngleTolerance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAngleType() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAnimationAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAnimationAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationActionImpl: public BaseImpl, public IAnimationActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAnimationDuration = false; + double _animationDuration {}; + bool _isSetLoop = false; + bool _loop {false}; + bool _isSetAnimationType = false; + std::shared_ptr _animationType {}; + bool _isSetAnimationState = false; + std::shared_ptr _animationState {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AnimationActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAnimationDuration() const override; + OPENSCENARIOLIB_EXP bool GetLoop() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAnimationType() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAnimationState() const override; + + + OPENSCENARIOLIB_EXP void SetAnimationDuration(const double animationDuration) override; + + OPENSCENARIOLIB_EXP void SetLoop(const bool loop) override; + + OPENSCENARIOLIB_EXP void SetAnimationType(std::shared_ptr animationType) override; + + OPENSCENARIOLIB_EXP void SetAnimationState(std::shared_ptr animationState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAnimationDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLoop(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAnimationDuration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLoop() const override; + + OPENSCENARIOLIB_EXP bool IsAnimationDurationParameterized() override; + OPENSCENARIOLIB_EXP bool IsLoopParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAnimationType() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAnimationState() const override; + OPENSCENARIOLIB_EXP virtual void ResetAnimationDuration() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimationDuration() const override; + OPENSCENARIOLIB_EXP virtual void ResetLoop() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLoop() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimationType() const override; + OPENSCENARIOLIB_EXP virtual void ResetAnimationState() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimationState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAnimationFile. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAnimationFile) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationFileImpl: public BaseImpl, public IAnimationFileWriter, public std::enable_shared_from_this + { + private: + bool _isSetTimeOffset = false; + double _timeOffset {}; + bool _isSetFile = false; + std::shared_ptr _file {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AnimationFileImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTimeOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFile() const override; + + + OPENSCENARIOLIB_EXP void SetTimeOffset(const double timeOffset) override; + + OPENSCENARIOLIB_EXP void SetFile(std::shared_ptr file) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTimeOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTimeOffset() const override; + + OPENSCENARIOLIB_EXP bool IsTimeOffsetParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFile() const override; + OPENSCENARIOLIB_EXP virtual void ResetTimeOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFile() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAnimationState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAnimationState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationStateImpl: public BaseImpl, public IAnimationStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetState = false; + double _state {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AnimationStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetState() const override; + + + OPENSCENARIOLIB_EXP void SetState(const double state) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAnimationType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAnimationType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationTypeImpl: public BaseImpl, public IAnimationTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetComponentAnimation = false; + std::shared_ptr _componentAnimation {}; + bool _isSetPedestrianAnimation = false; + std::shared_ptr _pedestrianAnimation {}; + bool _isSetAnimationFile = false; + std::shared_ptr _animationFile {}; + bool _isSetUserDefinedAnimation = false; + std::shared_ptr _userDefinedAnimation {}; + + public: + + OPENSCENARIOLIB_EXP AnimationTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetComponentAnimation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPedestrianAnimation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAnimationFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedAnimation() const override; + + + OPENSCENARIOLIB_EXP void SetComponentAnimation(std::shared_ptr componentAnimation) override; + + OPENSCENARIOLIB_EXP void SetPedestrianAnimation(std::shared_ptr pedestrianAnimation) override; + + OPENSCENARIOLIB_EXP void SetAnimationFile(std::shared_ptr animationFile) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedAnimation(std::shared_ptr userDefinedAnimation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterComponentAnimation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPedestrianAnimation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAnimationFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedAnimation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetComponentAnimation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPedestrianAnimation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimationFile() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedAnimation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAppearanceAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAppearanceAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AppearanceActionImpl: public BaseImpl, public IAppearanceActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetLightStateAction = false; + std::shared_ptr _lightStateAction {}; + bool _isSetAnimationAction = false; + std::shared_ptr _animationAction {}; + + public: + + OPENSCENARIOLIB_EXP AppearanceActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetLightStateAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAnimationAction() const override; + + + OPENSCENARIOLIB_EXP void SetLightStateAction(std::shared_ptr lightStateAction) override; + + OPENSCENARIOLIB_EXP void SetAnimationAction(std::shared_ptr animationAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLightStateAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAnimationAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLightStateAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAnimationAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAssignControllerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAssignControllerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignControllerActionImpl: public BaseImpl, public IAssignControllerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActivateAnimation = false; + bool _activateAnimation {}; + bool _isSetActivateLateral = false; + bool _activateLateral {}; + bool _isSetActivateLighting = false; + bool _activateLighting {}; + bool _isSetActivateLongitudinal = false; + bool _activateLongitudinal {}; + bool _isSetController = false; + std::shared_ptr _controller {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + bool _isSetObjectController = false; + std::shared_ptr _objectController {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP AssignControllerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActivateAnimation() const override; + OPENSCENARIOLIB_EXP bool GetActivateLateral() const override; + OPENSCENARIOLIB_EXP bool GetActivateLighting() const override; + OPENSCENARIOLIB_EXP bool GetActivateLongitudinal() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetController() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetObjectController() const override; + + + OPENSCENARIOLIB_EXP void SetActivateAnimation(const bool activateAnimation) override; + + OPENSCENARIOLIB_EXP void SetActivateLateral(const bool activateLateral) override; + + OPENSCENARIOLIB_EXP void SetActivateLighting(const bool activateLighting) override; + + OPENSCENARIOLIB_EXP void SetActivateLongitudinal(const bool activateLongitudinal) override; + + OPENSCENARIOLIB_EXP void SetController(std::shared_ptr controller) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void SetObjectController(std::shared_ptr objectController) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActivateAnimation(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToActivateLateral(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToActivateLighting(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToActivateLongitudinal(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActivateAnimation() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActivateLateral() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActivateLighting() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActivateLongitudinal() const override; + + OPENSCENARIOLIB_EXP bool IsActivateAnimationParameterized() override; + OPENSCENARIOLIB_EXP bool IsActivateLateralParameterized() override; + OPENSCENARIOLIB_EXP bool IsActivateLightingParameterized() override; + OPENSCENARIOLIB_EXP bool IsActivateLongitudinalParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterController() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterObjectController() const override; + OPENSCENARIOLIB_EXP virtual void ResetActivateAnimation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateAnimation() const override; + OPENSCENARIOLIB_EXP virtual void ResetActivateLateral() override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateLateral() const override; + OPENSCENARIOLIB_EXP virtual void ResetActivateLighting() override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateLighting() const override; + OPENSCENARIOLIB_EXP virtual void ResetActivateLongitudinal() override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateLongitudinal() const override; + OPENSCENARIOLIB_EXP virtual void ResetController() override; + OPENSCENARIOLIB_EXP virtual bool IsSetController() const override; + OPENSCENARIOLIB_EXP virtual void ResetCatalogReference() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual void ResetObjectController() override; + OPENSCENARIOLIB_EXP virtual bool IsSetObjectController() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAssignRouteAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAssignRouteAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignRouteActionImpl: public BaseImpl, public IAssignRouteActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRoute = false; + std::shared_ptr _route {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + + public: + + OPENSCENARIOLIB_EXP AssignRouteActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRoute() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + + + OPENSCENARIOLIB_EXP void SetRoute(std::shared_ptr route) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoute() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoute() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAutomaticGear. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAutomaticGear) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AutomaticGearImpl: public BaseImpl, public IAutomaticGearWriter, public std::enable_shared_from_this + { + private: + bool _isSetGear = false; + AutomaticGearType _gear {}; + + public: + + OPENSCENARIOLIB_EXP AutomaticGearImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP AutomaticGearType GetGear() const override; + + + OPENSCENARIOLIB_EXP void SetGear(const AutomaticGearType gear) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToGear(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromGear() const override; + + OPENSCENARIOLIB_EXP bool IsGearParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetGear() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAxle. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAxle) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxleImpl: public BaseImpl, public IAxleWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaxSteering = false; + double _maxSteering {}; + bool _isSetPositionX = false; + double _positionX {}; + bool _isSetPositionZ = false; + double _positionZ {}; + bool _isSetTrackWidth = false; + double _trackWidth {}; + bool _isSetWheelDiameter = false; + double _wheelDiameter {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP AxleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMaxSteering() const override; + OPENSCENARIOLIB_EXP double GetPositionX() const override; + OPENSCENARIOLIB_EXP double GetPositionZ() const override; + OPENSCENARIOLIB_EXP double GetTrackWidth() const override; + OPENSCENARIOLIB_EXP double GetWheelDiameter() const override; + + + OPENSCENARIOLIB_EXP void SetMaxSteering(const double maxSteering) override; + + OPENSCENARIOLIB_EXP void SetPositionX(const double positionX) override; + + OPENSCENARIOLIB_EXP void SetPositionZ(const double positionZ) override; + + OPENSCENARIOLIB_EXP void SetTrackWidth(const double trackWidth) override; + + OPENSCENARIOLIB_EXP void SetWheelDiameter(const double wheelDiameter) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxSteering(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPositionX(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPositionZ(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrackWidth(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWheelDiameter(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxSteering() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPositionX() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPositionZ() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrackWidth() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWheelDiameter() const override; + + OPENSCENARIOLIB_EXP bool IsMaxSteeringParameterized() override; + OPENSCENARIOLIB_EXP bool IsPositionXParameterized() override; + OPENSCENARIOLIB_EXP bool IsPositionZParameterized() override; + OPENSCENARIOLIB_EXP bool IsTrackWidthParameterized() override; + OPENSCENARIOLIB_EXP bool IsWheelDiameterParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetMaxSteering() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPositionX() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPositionZ() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrackWidth() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWheelDiameter() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IAxles. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IAxles) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxlesImpl: public BaseImpl, public IAxlesWriter, public std::enable_shared_from_this + { + private: + bool _isSetFrontAxle = false; + std::shared_ptr _frontAxle {}; + bool _isSetRearAxle = false; + std::shared_ptr _rearAxle {}; + bool _isSetAdditionalAxles = false; + std::vector> _additionalAxles {}; + + public: + + OPENSCENARIOLIB_EXP AxlesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetFrontAxle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRearAxle() const override; + OPENSCENARIOLIB_EXP std::vector> GetAdditionalAxles() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterAdditionalAxles() const override; + OPENSCENARIOLIB_EXP int GetAdditionalAxlesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAdditionalAxlesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetFrontAxle(std::shared_ptr frontAxle) override; + + OPENSCENARIOLIB_EXP void SetRearAxle(std::shared_ptr rearAxle) override; + + OPENSCENARIOLIB_EXP void SetAdditionalAxles(std::vector>& additionalAxles) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFrontAxle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRearAxle() const override; + OPENSCENARIOLIB_EXP virtual void ResetFrontAxle() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFrontAxle() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRearAxle() const override; + OPENSCENARIOLIB_EXP virtual void ResetAdditionalAxles() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAdditionalAxles() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IBoundingBox. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IBoundingBox) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BoundingBoxImpl: public BaseImpl, public IBoundingBoxWriter, public std::enable_shared_from_this + { + private: + bool _isSetCenter = false; + std::shared_ptr _center {}; + bool _isSetDimensions = false; + std::shared_ptr _dimensions {}; + + public: + + OPENSCENARIOLIB_EXP BoundingBoxImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetCenter() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDimensions() const override; + + + OPENSCENARIOLIB_EXP void SetCenter(std::shared_ptr center) override; + + OPENSCENARIOLIB_EXP void SetDimensions(std::shared_ptr dimensions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCenter() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDimensions() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCenter() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDimensions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IBrake. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IBrake) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeImpl: public BaseImpl, public IBrakeWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaxRate = false; + double _maxRate {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP BrakeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMaxRate() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetMaxRate(const double maxRate) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsMaxRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetMaxRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IBrakeInput. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IBrakeInput) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeInputImpl: public BaseImpl, public IBrakeInputWriter, public std::enable_shared_from_this + { + private: + bool _isSetBrakePercent = false; + std::shared_ptr _brakePercent {}; + bool _isSetBrakeForce = false; + std::shared_ptr _brakeForce {}; + + public: + + OPENSCENARIOLIB_EXP BrakeInputImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetBrakePercent() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBrakeForce() const override; + + + OPENSCENARIOLIB_EXP void SetBrakePercent(std::shared_ptr brakePercent) override; + + OPENSCENARIOLIB_EXP void SetBrakeForce(std::shared_ptr brakeForce) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBrakePercent() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBrakeForce() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetBrakePercent() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetBrakeForce() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IByEntityCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IByEntityCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByEntityConditionImpl: public BaseImpl, public IByEntityConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTriggeringEntities = false; + std::shared_ptr _triggeringEntities {}; + bool _isSetEntityCondition = false; + std::shared_ptr _entityCondition {}; + + public: + + OPENSCENARIOLIB_EXP ByEntityConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTriggeringEntities() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityCondition() const override; + + + OPENSCENARIOLIB_EXP void SetTriggeringEntities(std::shared_ptr triggeringEntities) override; + + OPENSCENARIOLIB_EXP void SetEntityCondition(std::shared_ptr entityCondition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTriggeringEntities() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTriggeringEntities() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityCondition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IByObjectType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IByObjectType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByObjectTypeImpl: public BaseImpl, public IByObjectTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetType = false; + ObjectType _type {}; + + public: + + OPENSCENARIOLIB_EXP ByObjectTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ObjectType GetType() const override; + + + OPENSCENARIOLIB_EXP void SetType(const ObjectType type) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromType() const override; + + OPENSCENARIOLIB_EXP bool IsTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IByType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IByType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByTypeImpl: public BaseImpl, public IByTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetObjectType = false; + ObjectType _objectType {}; + + public: + + OPENSCENARIOLIB_EXP ByTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ObjectType GetObjectType() const override; + + + OPENSCENARIOLIB_EXP void SetObjectType(const ObjectType objectType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToObjectType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromObjectType() const override; + + OPENSCENARIOLIB_EXP bool IsObjectTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetObjectType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IByValueCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IByValueCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByValueConditionImpl: public BaseImpl, public IByValueConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterCondition = false; + std::shared_ptr _parameterCondition {}; + bool _isSetTimeOfDayCondition = false; + std::shared_ptr _timeOfDayCondition {}; + bool _isSetSimulationTimeCondition = false; + std::shared_ptr _simulationTimeCondition {}; + bool _isSetStoryboardElementStateCondition = false; + std::shared_ptr _storyboardElementStateCondition {}; + bool _isSetUserDefinedValueCondition = false; + std::shared_ptr _userDefinedValueCondition {}; + bool _isSetTrafficSignalCondition = false; + std::shared_ptr _trafficSignalCondition {}; + bool _isSetTrafficSignalControllerCondition = false; + std::shared_ptr _trafficSignalControllerCondition {}; + bool _isSetVariableCondition = false; + std::shared_ptr _variableCondition {}; + + public: + + OPENSCENARIOLIB_EXP ByValueConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeOfDayCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSimulationTimeCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStoryboardElementStateCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedValueCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalControllerCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVariableCondition() const override; + + + OPENSCENARIOLIB_EXP void SetParameterCondition(std::shared_ptr parameterCondition) override; + + OPENSCENARIOLIB_EXP void SetTimeOfDayCondition(std::shared_ptr timeOfDayCondition) override; + + OPENSCENARIOLIB_EXP void SetSimulationTimeCondition(std::shared_ptr simulationTimeCondition) override; + + OPENSCENARIOLIB_EXP void SetStoryboardElementStateCondition(std::shared_ptr storyboardElementStateCondition) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedValueCondition(std::shared_ptr userDefinedValueCondition) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalCondition(std::shared_ptr trafficSignalCondition) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalControllerCondition(std::shared_ptr trafficSignalControllerCondition) override; + + OPENSCENARIOLIB_EXP void SetVariableCondition(std::shared_ptr variableCondition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterParameterCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeOfDayCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSimulationTimeCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStoryboardElementStateCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedValueCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalControllerCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVariableCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeOfDayCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSimulationTimeCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStoryboardElementStateCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedValueCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalControllerCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableCondition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICatalog. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICatalog) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogImpl: public BaseImpl, public ICatalogWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetVehicles = false; + std::vector> _vehicles {}; + bool _isSetControllers = false; + std::vector> _controllers {}; + bool _isSetPedestrians = false; + std::vector> _pedestrians {}; + bool _isSetMiscObjects = false; + std::vector> _miscObjects {}; + bool _isSetEnvironments = false; + std::vector> _environments {}; + bool _isSetManeuvers = false; + std::vector> _maneuvers {}; + bool _isSetTrajectories = false; + std::vector> _trajectories {}; + bool _isSetRoutes = false; + std::vector> _routes {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP CatalogImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetVehicles() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterVehicles() const override; + OPENSCENARIOLIB_EXP int GetVehiclesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehiclesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetControllers() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterControllers() const override; + OPENSCENARIOLIB_EXP int GetControllersSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControllersAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetPedestrians() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPedestrians() const override; + OPENSCENARIOLIB_EXP int GetPedestriansSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPedestriansAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetMiscObjects() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterMiscObjects() const override; + OPENSCENARIOLIB_EXP int GetMiscObjectsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMiscObjectsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetEnvironments() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEnvironments() const override; + OPENSCENARIOLIB_EXP int GetEnvironmentsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEnvironmentsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetManeuvers() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterManeuvers() const override; + OPENSCENARIOLIB_EXP int GetManeuversSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetManeuversAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetTrajectories() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterTrajectories() const override; + OPENSCENARIOLIB_EXP int GetTrajectoriesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoriesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetRoutes() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterRoutes() const override; + OPENSCENARIOLIB_EXP int GetRoutesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoutesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetVehicles(std::vector>& vehicles) override; + + OPENSCENARIOLIB_EXP void SetControllers(std::vector>& controllers) override; + + OPENSCENARIOLIB_EXP void SetPedestrians(std::vector>& pedestrians) override; + + OPENSCENARIOLIB_EXP void SetMiscObjects(std::vector>& miscObjects) override; + + OPENSCENARIOLIB_EXP void SetEnvironments(std::vector>& environments) override; + + OPENSCENARIOLIB_EXP void SetManeuvers(std::vector>& maneuvers) override; + + OPENSCENARIOLIB_EXP void SetTrajectories(std::vector>& trajectories) override; + + OPENSCENARIOLIB_EXP void SetRoutes(std::vector>& routes) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetVehicles() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicles() const override; + OPENSCENARIOLIB_EXP virtual void ResetControllers() override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllers() const override; + OPENSCENARIOLIB_EXP virtual void ResetPedestrians() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPedestrians() const override; + OPENSCENARIOLIB_EXP virtual void ResetMiscObjects() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMiscObjects() const override; + OPENSCENARIOLIB_EXP virtual void ResetEnvironments() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEnvironments() const override; + OPENSCENARIOLIB_EXP virtual void ResetManeuvers() override; + OPENSCENARIOLIB_EXP virtual bool IsSetManeuvers() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrajectories() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectories() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoutes() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutes() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICatalogDefinition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICatalogDefinition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogDefinitionImpl: public BaseImpl, public ICatalogDefinitionWriter, public std::enable_shared_from_this + { + private: + bool _isSetCatalog = false; + std::shared_ptr _catalog {}; + + public: + + OPENSCENARIOLIB_EXP CatalogDefinitionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalog() const override; + + + OPENSCENARIOLIB_EXP void SetCatalog(std::shared_ptr catalog) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalog() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalog() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICatalogLocations. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICatalogLocations) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogLocationsImpl: public BaseImpl, public ICatalogLocationsWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleCatalog = false; + std::shared_ptr _vehicleCatalog {}; + bool _isSetControllerCatalog = false; + std::shared_ptr _controllerCatalog {}; + bool _isSetPedestrianCatalog = false; + std::shared_ptr _pedestrianCatalog {}; + bool _isSetMiscObjectCatalog = false; + std::shared_ptr _miscObjectCatalog {}; + bool _isSetEnvironmentCatalog = false; + std::shared_ptr _environmentCatalog {}; + bool _isSetManeuverCatalog = false; + std::shared_ptr _maneuverCatalog {}; + bool _isSetTrajectoryCatalog = false; + std::shared_ptr _trajectoryCatalog {}; + bool _isSetRouteCatalog = false; + std::shared_ptr _routeCatalog {}; + + public: + + OPENSCENARIOLIB_EXP CatalogLocationsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControllerCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPedestrianCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMiscObjectCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEnvironmentCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetManeuverCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoryCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRouteCatalog() const override; + + + OPENSCENARIOLIB_EXP void SetVehicleCatalog(std::shared_ptr vehicleCatalog) override; + + OPENSCENARIOLIB_EXP void SetControllerCatalog(std::shared_ptr controllerCatalog) override; + + OPENSCENARIOLIB_EXP void SetPedestrianCatalog(std::shared_ptr pedestrianCatalog) override; + + OPENSCENARIOLIB_EXP void SetMiscObjectCatalog(std::shared_ptr miscObjectCatalog) override; + + OPENSCENARIOLIB_EXP void SetEnvironmentCatalog(std::shared_ptr environmentCatalog) override; + + OPENSCENARIOLIB_EXP void SetManeuverCatalog(std::shared_ptr maneuverCatalog) override; + + OPENSCENARIOLIB_EXP void SetTrajectoryCatalog(std::shared_ptr trajectoryCatalog) override; + + OPENSCENARIOLIB_EXP void SetRouteCatalog(std::shared_ptr routeCatalog) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicleCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterControllerCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPedestrianCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterMiscObjectCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEnvironmentCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterManeuverCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectoryCatalog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRouteCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetVehicleCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetControllerCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllerCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetPedestrianCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPedestrianCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetMiscObjectCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMiscObjectCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetEnvironmentCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEnvironmentCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetManeuverCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetManeuverCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrajectoryCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectoryCatalog() const override; + OPENSCENARIOLIB_EXP virtual void ResetRouteCatalog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRouteCatalog() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICatalogReference. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICatalogReference) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogReferenceImpl: public BaseImpl, public ICatalogReferenceWriter, public std::enable_shared_from_this + { + private: + bool _isSetCatalogName = false; + std::string _catalogName {}; + bool _isSetEntryName = false; + std::string _entryName {}; + bool _isSetParameterAssignments = false; + std::vector> _parameterAssignments {}; + bool _isSetRef = false; + std::shared_ptr _ref {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP CatalogReferenceImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetCatalogName() const override; + OPENSCENARIOLIB_EXP std::string GetEntryName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterAssignments() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterAssignments() const override; + OPENSCENARIOLIB_EXP int GetParameterAssignmentsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterAssignmentsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRef() const override; + + + OPENSCENARIOLIB_EXP void SetCatalogName(const std::string catalogName) override; + + OPENSCENARIOLIB_EXP void SetEntryName(const std::string entryName) override; + + OPENSCENARIOLIB_EXP void SetParameterAssignments(std::vector>& parameterAssignments) override; + + OPENSCENARIOLIB_EXP void SetRef(const std::shared_ptr ref) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCatalogName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntryName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCatalogName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntryName() const override; + + OPENSCENARIOLIB_EXP bool IsCatalogNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntryNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntryName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterAssignments() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterAssignments() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICenter. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICenter) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CenterImpl: public BaseImpl, public ICenterWriter, public std::enable_shared_from_this + { + private: + bool _isSetX = false; + double _x {}; + bool _isSetY = false; + double _y {}; + bool _isSetZ = false; + double _z {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP CenterImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetX() const override; + OPENSCENARIOLIB_EXP double GetY() const override; + OPENSCENARIOLIB_EXP double GetZ() const override; + + + OPENSCENARIOLIB_EXP void SetX(const double x) override; + + OPENSCENARIOLIB_EXP void SetY(const double y) override; + + OPENSCENARIOLIB_EXP void SetZ(const double z) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToX(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToY(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToZ(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromX() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromY() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromZ() const override; + + OPENSCENARIOLIB_EXP bool IsXParameterized() override; + OPENSCENARIOLIB_EXP bool IsYParameterized() override; + OPENSCENARIOLIB_EXP bool IsZParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetX() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetY() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetZ() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICentralSwarmObject. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICentralSwarmObject) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CentralSwarmObjectImpl: public BaseImpl, public ICentralSwarmObjectWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + + public: + + OPENSCENARIOLIB_EXP CentralSwarmObjectImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IClothoid. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IClothoid) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidImpl: public BaseImpl, public IClothoidWriter, public std::enable_shared_from_this + { + private: + bool _isSetCurvature = false; + double _curvature {}; + bool _isSetCurvatureDot = false; + double _curvatureDot {}; + bool _isSetCurvaturePrime = false; + double _curvaturePrime {}; + bool _isSetLength = false; + double _length {}; + bool _isSetStartTime = false; + double _startTime {}; + bool _isSetStopTime = false; + double _stopTime {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ClothoidImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetCurvature() const override; + OPENSCENARIOLIB_EXP double GetCurvatureDot() const override; + OPENSCENARIOLIB_EXP double GetCurvaturePrime() const override; + OPENSCENARIOLIB_EXP double GetLength() const override; + OPENSCENARIOLIB_EXP double GetStartTime() const override; + OPENSCENARIOLIB_EXP double GetStopTime() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetCurvature(const double curvature) override; + + OPENSCENARIOLIB_EXP void SetCurvatureDot(const double curvatureDot) override; + + OPENSCENARIOLIB_EXP void SetCurvaturePrime(const double curvaturePrime) override; + + OPENSCENARIOLIB_EXP void SetLength(const double length) override; + + OPENSCENARIOLIB_EXP void SetStartTime(const double startTime) override; + + OPENSCENARIOLIB_EXP void SetStopTime(const double stopTime) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCurvature(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCurvatureDot(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCurvaturePrime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLength(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToStartTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToStopTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCurvature() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCurvatureDot() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCurvaturePrime() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLength() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromStartTime() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromStopTime() const override; + + OPENSCENARIOLIB_EXP bool IsCurvatureParameterized() override; + OPENSCENARIOLIB_EXP bool IsCurvatureDotParameterized() override; + OPENSCENARIOLIB_EXP bool IsCurvaturePrimeParameterized() override; + OPENSCENARIOLIB_EXP bool IsLengthParameterized() override; + OPENSCENARIOLIB_EXP bool IsStartTimeParameterized() override; + OPENSCENARIOLIB_EXP bool IsStopTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCurvature() const override; + OPENSCENARIOLIB_EXP virtual void ResetCurvatureDot() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCurvatureDot() const override; + OPENSCENARIOLIB_EXP virtual void ResetCurvaturePrime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCurvaturePrime() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLength() const override; + OPENSCENARIOLIB_EXP virtual void ResetStartTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStartTime() const override; + OPENSCENARIOLIB_EXP virtual void ResetStopTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStopTime() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IClothoidSpline. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IClothoidSpline) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineImpl: public BaseImpl, public IClothoidSplineWriter, public std::enable_shared_from_this + { + private: + bool _isSetTimeEnd = false; + double _timeEnd {}; + bool _isSetSegments = false; + std::vector> _segments {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ClothoidSplineImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTimeEnd() const override; + OPENSCENARIOLIB_EXP std::vector> GetSegments() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterSegments() const override; + OPENSCENARIOLIB_EXP int GetSegmentsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSegmentsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetTimeEnd(const double timeEnd) override; + + OPENSCENARIOLIB_EXP void SetSegments(std::vector>& segments) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTimeEnd(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTimeEnd() const override; + + OPENSCENARIOLIB_EXP bool IsTimeEndParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetTimeEnd() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeEnd() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSegments() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IClothoidSplineSegment. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IClothoidSplineSegment) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineSegmentImpl: public BaseImpl, public IClothoidSplineSegmentWriter, public std::enable_shared_from_this + { + private: + bool _isSetCurvatureEnd = false; + double _curvatureEnd {}; + bool _isSetCurvatureStart = false; + double _curvatureStart {}; + bool _isSetHOffset = false; + double _hOffset {}; + bool _isSetLength = false; + double _length {}; + bool _isSetTimeStart = false; + double _timeStart {}; + bool _isSetPositionStart = false; + std::shared_ptr _positionStart {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ClothoidSplineSegmentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetCurvatureEnd() const override; + OPENSCENARIOLIB_EXP double GetCurvatureStart() const override; + OPENSCENARIOLIB_EXP double GetHOffset() const override; + OPENSCENARIOLIB_EXP double GetLength() const override; + OPENSCENARIOLIB_EXP double GetTimeStart() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPositionStart() const override; + + + OPENSCENARIOLIB_EXP void SetCurvatureEnd(const double curvatureEnd) override; + + OPENSCENARIOLIB_EXP void SetCurvatureStart(const double curvatureStart) override; + + OPENSCENARIOLIB_EXP void SetHOffset(const double hOffset) override; + + OPENSCENARIOLIB_EXP void SetLength(const double length) override; + + OPENSCENARIOLIB_EXP void SetTimeStart(const double timeStart) override; + + OPENSCENARIOLIB_EXP void SetPositionStart(std::shared_ptr positionStart) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCurvatureEnd(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCurvatureStart(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToHOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLength(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTimeStart(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCurvatureEnd() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCurvatureStart() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromHOffset() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLength() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTimeStart() const override; + + OPENSCENARIOLIB_EXP bool IsCurvatureEndParameterized() override; + OPENSCENARIOLIB_EXP bool IsCurvatureStartParameterized() override; + OPENSCENARIOLIB_EXP bool IsHOffsetParameterized() override; + OPENSCENARIOLIB_EXP bool IsLengthParameterized() override; + OPENSCENARIOLIB_EXP bool IsTimeStartParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPositionStart() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCurvatureEnd() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCurvatureStart() const override; + OPENSCENARIOLIB_EXP virtual void ResetHOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetHOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLength() const override; + OPENSCENARIOLIB_EXP virtual void ResetTimeStart() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeStart() const override; + OPENSCENARIOLIB_EXP virtual void ResetPositionStart() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPositionStart() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICollisionCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICollisionCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CollisionConditionImpl: public BaseImpl, public ICollisionConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr _entityRef {}; + bool _isSetByType = false; + std::shared_ptr _byType {}; + + public: + + OPENSCENARIOLIB_EXP CollisionConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetByType() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr entityRef) override; + + OPENSCENARIOLIB_EXP void SetByType(std::shared_ptr byType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterByType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetByType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IColor. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IColor) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorImpl: public BaseImpl, public IColorWriter, public std::enable_shared_from_this + { + private: + bool _isSetColorType = false; + ColorType _colorType {}; + bool _isSetColorRgb = false; + std::shared_ptr _colorRgb {}; + bool _isSetColorCmyk = false; + std::shared_ptr _colorCmyk {}; + + public: + + OPENSCENARIOLIB_EXP ColorImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ColorType GetColorType() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetColorRgb() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetColorCmyk() const override; + + + OPENSCENARIOLIB_EXP void SetColorType(const ColorType colorType) override; + + OPENSCENARIOLIB_EXP void SetColorRgb(std::shared_ptr colorRgb) override; + + OPENSCENARIOLIB_EXP void SetColorCmyk(std::shared_ptr colorCmyk) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToColorType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromColorType() const override; + + OPENSCENARIOLIB_EXP bool IsColorTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterColorRgb() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterColorCmyk() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetColorType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetColorRgb() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetColorCmyk() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IColorCmyk. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IColorCmyk) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorCmykImpl: public BaseImpl, public IColorCmykWriter, public std::enable_shared_from_this + { + private: + bool _isSetCyan = false; + double _cyan {}; + bool _isSetKey = false; + double _key {}; + bool _isSetMagenta = false; + double _magenta {}; + bool _isSetYellow = false; + double _yellow {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ColorCmykImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetCyan() const override; + OPENSCENARIOLIB_EXP double GetKey() const override; + OPENSCENARIOLIB_EXP double GetMagenta() const override; + OPENSCENARIOLIB_EXP double GetYellow() const override; + + + OPENSCENARIOLIB_EXP void SetCyan(const double cyan) override; + + OPENSCENARIOLIB_EXP void SetKey(const double key) override; + + OPENSCENARIOLIB_EXP void SetMagenta(const double magenta) override; + + OPENSCENARIOLIB_EXP void SetYellow(const double yellow) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCyan(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToKey(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMagenta(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToYellow(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCyan() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromKey() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMagenta() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromYellow() const override; + + OPENSCENARIOLIB_EXP bool IsCyanParameterized() override; + OPENSCENARIOLIB_EXP bool IsKeyParameterized() override; + OPENSCENARIOLIB_EXP bool IsMagentaParameterized() override; + OPENSCENARIOLIB_EXP bool IsYellowParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetCyan() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetKey() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMagenta() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetYellow() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IColorRgb. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IColorRgb) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorRgbImpl: public BaseImpl, public IColorRgbWriter, public std::enable_shared_from_this + { + private: + bool _isSetBlue = false; + double _blue {}; + bool _isSetGreen = false; + double _green {}; + bool _isSetRed = false; + double _red {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ColorRgbImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetBlue() const override; + OPENSCENARIOLIB_EXP double GetGreen() const override; + OPENSCENARIOLIB_EXP double GetRed() const override; + + + OPENSCENARIOLIB_EXP void SetBlue(const double blue) override; + + OPENSCENARIOLIB_EXP void SetGreen(const double green) override; + + OPENSCENARIOLIB_EXP void SetRed(const double red) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToBlue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToGreen(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromBlue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromGreen() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRed() const override; + + OPENSCENARIOLIB_EXP bool IsBlueParameterized() override; + OPENSCENARIOLIB_EXP bool IsGreenParameterized() override; + OPENSCENARIOLIB_EXP bool IsRedParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetBlue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetGreen() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IComponentAnimation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IComponentAnimation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ComponentAnimationImpl: public BaseImpl, public IComponentAnimationWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleComponent = false; + std::shared_ptr _vehicleComponent {}; + bool _isSetUserDefinedComponent = false; + std::shared_ptr _userDefinedComponent {}; + + public: + + OPENSCENARIOLIB_EXP ComponentAnimationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleComponent() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedComponent() const override; + + + OPENSCENARIOLIB_EXP void SetVehicleComponent(std::shared_ptr vehicleComponent) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedComponent(std::shared_ptr userDefinedComponent) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicleComponent() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedComponent() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleComponent() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedComponent() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionImpl: public BaseImpl, public IConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetConditionEdge = false; + ConditionEdge _conditionEdge {}; + bool _isSetDelay = false; + double _delay {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetByEntityCondition = false; + std::shared_ptr _byEntityCondition {}; + bool _isSetByValueCondition = false; + std::shared_ptr _byValueCondition {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ConditionEdge GetConditionEdge() const override; + OPENSCENARIOLIB_EXP double GetDelay() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetByEntityCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetByValueCondition() const override; + + + OPENSCENARIOLIB_EXP void SetConditionEdge(const ConditionEdge conditionEdge) override; + + OPENSCENARIOLIB_EXP void SetDelay(const double delay) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetByEntityCondition(std::shared_ptr byEntityCondition) override; + + OPENSCENARIOLIB_EXP void SetByValueCondition(std::shared_ptr byValueCondition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToConditionEdge(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDelay(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromConditionEdge() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDelay() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsConditionEdgeParameterized() override; + OPENSCENARIOLIB_EXP bool IsDelayParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterByEntityCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterByValueCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetConditionEdge() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDelay() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetByEntityCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetByValueCondition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IConditionGroup. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IConditionGroup) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionGroupImpl: public BaseImpl, public IConditionGroupWriter, public std::enable_shared_from_this + { + private: + bool _isSetConditions = false; + std::vector> _conditions {}; + + public: + + OPENSCENARIOLIB_EXP ConditionGroupImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetConditions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterConditions() const override; + OPENSCENARIOLIB_EXP int GetConditionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetConditionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetConditions(std::vector>& conditions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetConditions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IConnectTrailerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IConnectTrailerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConnectTrailerActionImpl: public BaseImpl, public IConnectTrailerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrailerRef = false; + std::shared_ptr> _trailerRef = nullptr; + + public: + + OPENSCENARIOLIB_EXP ConnectTrailerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetTrailerRef() const override; + + + OPENSCENARIOLIB_EXP void SetTrailerRef(std::shared_ptr> trailerRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrailerRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrailerRef() const override; + + OPENSCENARIOLIB_EXP bool IsTrailerRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetTrailerRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IControlPoint. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IControlPoint) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControlPointImpl: public BaseImpl, public IControlPointWriter, public std::enable_shared_from_this + { + private: + bool _isSetTime = false; + double _time {}; + bool _isSetWeight = false; + double _weight {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ControlPointImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTime() const override; + OPENSCENARIOLIB_EXP double GetWeight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetTime(const double time) override; + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTime() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsTimeParameterized() override; + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTime() const override; + OPENSCENARIOLIB_EXP virtual void ResetWeight() override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IController. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IController) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerImpl: public BaseImpl, public IControllerWriter, public std::enable_shared_from_this + { + private: + bool _isSetControllerType = false; + ControllerType _controllerType {ControllerType::ControllerTypeEnum::MOVEMENT}; + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ControllerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ControllerType GetControllerType() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetControllerType(const ControllerType controllerType) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToControllerType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromControllerType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsControllerTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual void ResetControllerType() override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllerType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IControllerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IControllerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerActionImpl: public BaseImpl, public IControllerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAssignControllerAction = false; + std::shared_ptr _assignControllerAction {}; + bool _isSetOverrideControllerValueAction = false; + std::shared_ptr _overrideControllerValueAction {}; + bool _isSetActivateControllerAction = false; + std::shared_ptr _activateControllerAction {}; + + public: + + OPENSCENARIOLIB_EXP ControllerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetAssignControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOverrideControllerValueAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetActivateControllerAction() const override; + + + OPENSCENARIOLIB_EXP void SetAssignControllerAction(std::shared_ptr assignControllerAction) override; + + OPENSCENARIOLIB_EXP void SetOverrideControllerValueAction(std::shared_ptr overrideControllerValueAction) override; + + OPENSCENARIOLIB_EXP void SetActivateControllerAction(std::shared_ptr activateControllerAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAssignControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOverrideControllerValueAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterActivateControllerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAssignControllerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOverrideControllerValueAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateControllerAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IControllerCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IControllerCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerCatalogLocationImpl: public BaseImpl, public IControllerCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP ControllerCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IControllerDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IControllerDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionImpl: public BaseImpl, public IControllerDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetControllerDistributionEntries = false; + std::vector> _controllerDistributionEntries {}; + + public: + + OPENSCENARIOLIB_EXP ControllerDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetControllerDistributionEntries() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterControllerDistributionEntries() const override; + OPENSCENARIOLIB_EXP int GetControllerDistributionEntriesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControllerDistributionEntriesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetControllerDistributionEntries(std::vector>& controllerDistributionEntries) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetControllerDistributionEntries() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IControllerDistributionEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IControllerDistributionEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionEntryImpl: public BaseImpl, public IControllerDistributionEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetWeight = false; + double _weight {}; + bool _isSetController = false; + std::shared_ptr _controller {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ControllerDistributionEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetWeight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetController() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void SetController(std::shared_ptr controller) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterController() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetController() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICustomCommandAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICustomCommandAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomCommandActionImpl: public BaseImpl, public ICustomCommandActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContent = false; + std::string _content {}; + bool _isSetType = false; + std::string _type {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP CustomCommandActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetContent() const override; + OPENSCENARIOLIB_EXP std::string GetType() const override; + + + OPENSCENARIOLIB_EXP void SetContent(const std::string content) override; + + OPENSCENARIOLIB_EXP void SetType(const std::string type) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContent(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContent() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromType() const override; + + OPENSCENARIOLIB_EXP bool IsContentParameterized() override; + OPENSCENARIOLIB_EXP bool IsTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetContent() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ICustomContent. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ICustomContent) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomContentImpl: public BaseImpl, public ICustomContentWriter, public std::enable_shared_from_this + { + private: + bool _isSetContent = false; + std::string _content {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP CustomContentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetContent() const override; + + + OPENSCENARIOLIB_EXP void SetContent(const std::string content) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContent(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContent() const override; + + OPENSCENARIOLIB_EXP bool IsContentParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetContent() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeleteEntityAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeleteEntityAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeleteEntityActionImpl: public BaseImpl, public IDeleteEntityActionWriter, public std::enable_shared_from_this + { + private: + + public: + + OPENSCENARIOLIB_EXP DeleteEntityActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministic. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministic) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicImpl: public BaseImpl, public IDeterministicWriter, public std::enable_shared_from_this + { + private: + bool _isSetDeterministicParameterDistributions = false; + std::vector> _deterministicParameterDistributions {}; + + public: + + OPENSCENARIOLIB_EXP DeterministicImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetDeterministicParameterDistributions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterDeterministicParameterDistributions() const override; + OPENSCENARIOLIB_EXP int GetDeterministicParameterDistributionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministicParameterDistributionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetDeterministicParameterDistributions(std::vector>& deterministicParameterDistributions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual void ResetDeterministicParameterDistributions() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministicParameterDistributions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministicMultiParameterDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministicMultiParameterDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionImpl: public BaseImpl, public IDeterministicMultiParameterDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDeterministicMultiParameterDistributionType = false; + std::shared_ptr _deterministicMultiParameterDistributionType {}; + + public: + + OPENSCENARIOLIB_EXP DeterministicMultiParameterDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministicMultiParameterDistributionType() const override; + + + OPENSCENARIOLIB_EXP void SetDeterministicMultiParameterDistributionType(std::shared_ptr deterministicMultiParameterDistributionType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeterministicMultiParameterDistributionType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministicMultiParameterDistributionType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministicMultiParameterDistributionType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministicMultiParameterDistributionType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionTypeImpl: public BaseImpl, public IDeterministicMultiParameterDistributionTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetValueSetDistribution = false; + std::shared_ptr _valueSetDistribution {}; + + public: + + OPENSCENARIOLIB_EXP DeterministicMultiParameterDistributionTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetValueSetDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetValueSetDistribution(std::shared_ptr valueSetDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterValueSetDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValueSetDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministicParameterDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministicParameterDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicParameterDistributionImpl: public BaseImpl, public IDeterministicParameterDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDeterministicMultiParameterDistribution = false; + std::shared_ptr _deterministicMultiParameterDistribution {}; + bool _isSetDeterministicSingleParameterDistribution = false; + std::shared_ptr _deterministicSingleParameterDistribution {}; + + public: + + OPENSCENARIOLIB_EXP DeterministicParameterDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministicMultiParameterDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministicSingleParameterDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetDeterministicMultiParameterDistribution(std::shared_ptr deterministicMultiParameterDistribution) override; + + OPENSCENARIOLIB_EXP void SetDeterministicSingleParameterDistribution(std::shared_ptr deterministicSingleParameterDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeterministicMultiParameterDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeterministicSingleParameterDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministicMultiParameterDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministicSingleParameterDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministicSingleParameterDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministicSingleParameterDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionImpl: public BaseImpl, public IDeterministicSingleParameterDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterName = false; + std::string _parameterName {}; + bool _isSetDeterministicSingleParameterDistributionType = false; + std::shared_ptr _deterministicSingleParameterDistributionType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP DeterministicSingleParameterDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetParameterName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministicSingleParameterDistributionType() const override; + + + OPENSCENARIOLIB_EXP void SetParameterName(const std::string parameterName) override; + + OPENSCENARIOLIB_EXP void SetDeterministicSingleParameterDistributionType(std::shared_ptr deterministicSingleParameterDistributionType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToParameterName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromParameterName() const override; + + OPENSCENARIOLIB_EXP bool IsParameterNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeterministicSingleParameterDistributionType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministicSingleParameterDistributionType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDeterministicSingleParameterDistributionType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDeterministicSingleParameterDistributionType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionTypeImpl: public BaseImpl, public IDeterministicSingleParameterDistributionTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetDistributionSet = false; + std::shared_ptr _distributionSet {}; + bool _isSetDistributionRange = false; + std::shared_ptr _distributionRange {}; + bool _isSetUserDefinedDistribution = false; + std::shared_ptr _userDefinedDistribution {}; + + public: + + OPENSCENARIOLIB_EXP DeterministicSingleParameterDistributionTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDistributionSet() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDistributionRange() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetDistributionSet(std::shared_ptr distributionSet) override; + + OPENSCENARIOLIB_EXP void SetDistributionRange(std::shared_ptr distributionRange) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDistributionSet() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDistributionRange() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistributionSet() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistributionRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDimensions. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDimensions) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DimensionsImpl: public BaseImpl, public IDimensionsWriter, public std::enable_shared_from_this + { + private: + bool _isSetHeight = false; + double _height {}; + bool _isSetLength = false; + double _length {}; + bool _isSetWidth = false; + double _width {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DimensionsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetHeight() const override; + OPENSCENARIOLIB_EXP double GetLength() const override; + OPENSCENARIOLIB_EXP double GetWidth() const override; + + + OPENSCENARIOLIB_EXP void SetHeight(const double height) override; + + OPENSCENARIOLIB_EXP void SetLength(const double length) override; + + OPENSCENARIOLIB_EXP void SetWidth(const double width) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToHeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLength(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWidth(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromHeight() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLength() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWidth() const override; + + OPENSCENARIOLIB_EXP bool IsHeightParameterized() override; + OPENSCENARIOLIB_EXP bool IsLengthParameterized() override; + OPENSCENARIOLIB_EXP bool IsWidthParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetHeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLength() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWidth() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDirectionOfTravelDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDirectionOfTravelDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectionOfTravelDistributionImpl: public BaseImpl, public IDirectionOfTravelDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetOpposite = false; + double _opposite {}; + bool _isSetSame = false; + double _same {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DirectionOfTravelDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetOpposite() const override; + OPENSCENARIOLIB_EXP double GetSame() const override; + + + OPENSCENARIOLIB_EXP void SetOpposite(const double opposite) override; + + OPENSCENARIOLIB_EXP void SetSame(const double same) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToOpposite(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSame(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOpposite() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSame() const override; + + OPENSCENARIOLIB_EXP bool IsOppositeParameterized() override; + OPENSCENARIOLIB_EXP bool IsSameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetOpposite() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSame() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDirectory. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDirectory) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectoryImpl: public BaseImpl, public IDirectoryWriter, public std::enable_shared_from_this + { + private: + bool _isSetPath = false; + std::string _path {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP DirectoryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetPath() const override; + + + OPENSCENARIOLIB_EXP void SetPath(const std::string path) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToPath(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPath() const override; + + OPENSCENARIOLIB_EXP bool IsPathParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPath() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDisconnectTrailerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDisconnectTrailerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DisconnectTrailerActionImpl: public BaseImpl, public IDisconnectTrailerActionWriter, public std::enable_shared_from_this + { + private: + + public: + + OPENSCENARIOLIB_EXP DisconnectTrailerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDistanceCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDistanceCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistanceConditionImpl: public BaseImpl, public IDistanceConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAlongRoute = false; + bool _alongRoute {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetRelativeDistanceType = false; + RelativeDistanceType _relativeDistanceType {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + bool _isSetRoutingAlgorithm = false; + RoutingAlgorithm _routingAlgorithm {RoutingAlgorithm::RoutingAlgorithmEnum::UNDEFINED}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DistanceConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetAlongRoute() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP RelativeDistanceType GetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP RoutingAlgorithm GetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetAlongRoute(const bool alongRoute) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) override; + + OPENSCENARIOLIB_EXP void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAlongRoute(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRelativeDistanceType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoutingAlgorithm(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAlongRoute() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRelativeDistanceType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoutingAlgorithm() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsAlongRouteParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsRelativeDistanceTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoutingAlgorithmParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetAlongRoute() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAlongRoute() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual void ResetRelativeDistanceType() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoutingAlgorithm() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDistributionDefinition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDistributionDefinition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionDefinitionImpl: public BaseImpl, public IDistributionDefinitionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDeterministic = false; + std::shared_ptr _deterministic {}; + bool _isSetStochastic = false; + std::shared_ptr _stochastic {}; + + public: + + OPENSCENARIOLIB_EXP DistributionDefinitionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDeterministic() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStochastic() const override; + + + OPENSCENARIOLIB_EXP void SetDeterministic(std::shared_ptr deterministic) override; + + OPENSCENARIOLIB_EXP void SetStochastic(std::shared_ptr stochastic) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeterministic() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStochastic() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeterministic() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStochastic() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDistributionRange. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDistributionRange) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionRangeImpl: public BaseImpl, public IDistributionRangeWriter, public std::enable_shared_from_this + { + private: + bool _isSetStepWidth = false; + double _stepWidth {}; + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DistributionRangeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetStepWidth() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetStepWidth(const double stepWidth) override; + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToStepWidth(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromStepWidth() const override; + + OPENSCENARIOLIB_EXP bool IsStepWidthParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStepWidth() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDistributionSet. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDistributionSet) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetImpl: public BaseImpl, public IDistributionSetWriter, public std::enable_shared_from_this + { + private: + bool _isSetElements = false; + std::vector> _elements {}; + + public: + + OPENSCENARIOLIB_EXP DistributionSetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetElements() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterElements() const override; + OPENSCENARIOLIB_EXP int GetElementsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetElementsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetElements(std::vector>& elements) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetElements() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDistributionSetElement. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDistributionSetElement) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetElementImpl: public BaseImpl, public IDistributionSetElementWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP DistributionSetElementImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDomeImage. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDomeImage) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DomeImageImpl: public BaseImpl, public IDomeImageWriter, public std::enable_shared_from_this + { + private: + bool _isSetAzimuthOffset = false; + double _azimuthOffset {0}; + bool _isSetDomeFile = false; + std::shared_ptr _domeFile {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DomeImageImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAzimuthOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDomeFile() const override; + + + OPENSCENARIOLIB_EXP void SetAzimuthOffset(const double azimuthOffset) override; + + OPENSCENARIOLIB_EXP void SetDomeFile(std::shared_ptr domeFile) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAzimuthOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAzimuthOffset() const override; + + OPENSCENARIOLIB_EXP bool IsAzimuthOffsetParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDomeFile() const override; + OPENSCENARIOLIB_EXP virtual void ResetAzimuthOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAzimuthOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDomeFile() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IDynamicConstraints. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IDynamicConstraints) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DynamicConstraintsImpl: public BaseImpl, public IDynamicConstraintsWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaxAcceleration = false; + double _maxAcceleration {}; + bool _isSetMaxAccelerationRate = false; + double _maxAccelerationRate {}; + bool _isSetMaxDeceleration = false; + double _maxDeceleration {}; + bool _isSetMaxDecelerationRate = false; + double _maxDecelerationRate {}; + bool _isSetMaxSpeed = false; + double _maxSpeed {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP DynamicConstraintsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMaxAcceleration() const override; + OPENSCENARIOLIB_EXP double GetMaxAccelerationRate() const override; + OPENSCENARIOLIB_EXP double GetMaxDeceleration() const override; + OPENSCENARIOLIB_EXP double GetMaxDecelerationRate() const override; + OPENSCENARIOLIB_EXP double GetMaxSpeed() const override; + + + OPENSCENARIOLIB_EXP void SetMaxAcceleration(const double maxAcceleration) override; + + OPENSCENARIOLIB_EXP void SetMaxAccelerationRate(const double maxAccelerationRate) override; + + OPENSCENARIOLIB_EXP void SetMaxDeceleration(const double maxDeceleration) override; + + OPENSCENARIOLIB_EXP void SetMaxDecelerationRate(const double maxDecelerationRate) override; + + OPENSCENARIOLIB_EXP void SetMaxSpeed(const double maxSpeed) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxAcceleration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxAccelerationRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxDeceleration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxDecelerationRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxSpeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxAcceleration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxAccelerationRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxDeceleration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxDecelerationRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxSpeed() const override; + + OPENSCENARIOLIB_EXP bool IsMaxAccelerationParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxAccelerationRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxDecelerationParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxDecelerationRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxSpeedParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetMaxAcceleration() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxAcceleration() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxAccelerationRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxAccelerationRate() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxDeceleration() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxDeceleration() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxDecelerationRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxDecelerationRate() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxSpeed() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxSpeed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEndOfRoadCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEndOfRoadCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EndOfRoadConditionImpl: public BaseImpl, public IEndOfRoadConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDuration = false; + double _duration {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP EndOfRoadConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDuration() const override; + + + OPENSCENARIOLIB_EXP void SetDuration(const double duration) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDuration() const override; + + OPENSCENARIOLIB_EXP bool IsDurationParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDuration() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntities. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntities) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntitiesImpl: public BaseImpl, public IEntitiesWriter, public std::enable_shared_from_this + { + private: + bool _isSetScenarioObjects = false; + std::vector> _scenarioObjects {}; + bool _isSetEntitySelections = false; + std::vector> _entitySelections {}; + + public: + + OPENSCENARIOLIB_EXP EntitiesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetScenarioObjects() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterScenarioObjects() const override; + OPENSCENARIOLIB_EXP int GetScenarioObjectsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetScenarioObjectsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetEntitySelections() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntitySelections() const override; + OPENSCENARIOLIB_EXP int GetEntitySelectionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntitySelectionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetScenarioObjects(std::vector>& scenarioObjects) override; + + OPENSCENARIOLIB_EXP void SetEntitySelections(std::vector>& entitySelections) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual void ResetScenarioObjects() override; + OPENSCENARIOLIB_EXP virtual bool IsSetScenarioObjects() const override; + OPENSCENARIOLIB_EXP virtual void ResetEntitySelections() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntitySelections() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityActionImpl: public BaseImpl, public IEntityActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetAddEntityAction = false; + std::shared_ptr _addEntityAction {}; + bool _isSetDeleteEntityAction = false; + std::shared_ptr _deleteEntityAction {}; + + public: + + OPENSCENARIOLIB_EXP EntityActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAddEntityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDeleteEntityAction() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetAddEntityAction(std::shared_ptr addEntityAction) override; + + OPENSCENARIOLIB_EXP void SetDeleteEntityAction(std::shared_ptr deleteEntityAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAddEntityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDeleteEntityAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAddEntityAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDeleteEntityAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityConditionImpl: public BaseImpl, public IEntityConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEndOfRoadCondition = false; + std::shared_ptr _endOfRoadCondition {}; + bool _isSetCollisionCondition = false; + std::shared_ptr _collisionCondition {}; + bool _isSetOffroadCondition = false; + std::shared_ptr _offroadCondition {}; + bool _isSetTimeHeadwayCondition = false; + std::shared_ptr _timeHeadwayCondition {}; + bool _isSetTimeToCollisionCondition = false; + std::shared_ptr _timeToCollisionCondition {}; + bool _isSetAccelerationCondition = false; + std::shared_ptr _accelerationCondition {}; + bool _isSetStandStillCondition = false; + std::shared_ptr _standStillCondition {}; + bool _isSetSpeedCondition = false; + std::shared_ptr _speedCondition {}; + bool _isSetRelativeSpeedCondition = false; + std::shared_ptr _relativeSpeedCondition {}; + bool _isSetTraveledDistanceCondition = false; + std::shared_ptr _traveledDistanceCondition {}; + bool _isSetReachPositionCondition = false; + std::shared_ptr _reachPositionCondition {}; + bool _isSetDistanceCondition = false; + std::shared_ptr _distanceCondition {}; + bool _isSetRelativeDistanceCondition = false; + std::shared_ptr _relativeDistanceCondition {}; + bool _isSetRelativeClearanceCondition = false; + std::shared_ptr _relativeClearanceCondition {}; + bool _isSetAngleCondition = false; + std::shared_ptr _angleCondition {}; + bool _isSetRelativeAngleCondition = false; + std::shared_ptr _relativeAngleCondition {}; + + public: + + OPENSCENARIOLIB_EXP EntityConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetEndOfRoadCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCollisionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOffroadCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeHeadwayCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeToCollisionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAccelerationCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStandStillCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeSpeedCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTraveledDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetReachPositionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeClearanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAngleCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeAngleCondition() const override; + + + OPENSCENARIOLIB_EXP void SetEndOfRoadCondition(std::shared_ptr endOfRoadCondition) override; + + OPENSCENARIOLIB_EXP void SetCollisionCondition(std::shared_ptr collisionCondition) override; + + OPENSCENARIOLIB_EXP void SetOffroadCondition(std::shared_ptr offroadCondition) override; + + OPENSCENARIOLIB_EXP void SetTimeHeadwayCondition(std::shared_ptr timeHeadwayCondition) override; + + OPENSCENARIOLIB_EXP void SetTimeToCollisionCondition(std::shared_ptr timeToCollisionCondition) override; + + OPENSCENARIOLIB_EXP void SetAccelerationCondition(std::shared_ptr accelerationCondition) override; + + OPENSCENARIOLIB_EXP void SetStandStillCondition(std::shared_ptr standStillCondition) override; + + OPENSCENARIOLIB_EXP void SetSpeedCondition(std::shared_ptr speedCondition) override; + + OPENSCENARIOLIB_EXP void SetRelativeSpeedCondition(std::shared_ptr relativeSpeedCondition) override; + + OPENSCENARIOLIB_EXP void SetTraveledDistanceCondition(std::shared_ptr traveledDistanceCondition) override; + + OPENSCENARIOLIB_EXP void SetReachPositionCondition(std::shared_ptr reachPositionCondition) override; + + OPENSCENARIOLIB_EXP void SetDistanceCondition(std::shared_ptr distanceCondition) override; + + OPENSCENARIOLIB_EXP void SetRelativeDistanceCondition(std::shared_ptr relativeDistanceCondition) override; + + OPENSCENARIOLIB_EXP void SetRelativeClearanceCondition(std::shared_ptr relativeClearanceCondition) override; + + OPENSCENARIOLIB_EXP void SetAngleCondition(std::shared_ptr angleCondition) override; + + OPENSCENARIOLIB_EXP void SetRelativeAngleCondition(std::shared_ptr relativeAngleCondition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEndOfRoadCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCollisionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOffroadCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeHeadwayCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeToCollisionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAccelerationCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStandStillCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSpeedCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeSpeedCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTraveledDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterReachPositionCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeDistanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeClearanceCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAngleCondition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeAngleCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEndOfRoadCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCollisionCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOffroadCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeHeadwayCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeToCollisionCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAccelerationCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStandStillCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeSpeedCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTraveledDistanceCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetReachPositionCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistanceCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeDistanceCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeClearanceCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAngleCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeAngleCondition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionImpl: public BaseImpl, public IEntityDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityDistributionEntry = false; + std::vector> _entityDistributionEntry {}; + + public: + + OPENSCENARIOLIB_EXP EntityDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetEntityDistributionEntry() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntityDistributionEntry() const override; + OPENSCENARIOLIB_EXP int GetEntityDistributionEntrySize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityDistributionEntryAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetEntityDistributionEntry(std::vector>& entityDistributionEntry) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityDistributionEntry() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityDistributionEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityDistributionEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionEntryImpl: public BaseImpl, public IEntityDistributionEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetWeight = false; + double _weight {}; + bool _isSetScenarioObjectTemplate = false; + std::shared_ptr _scenarioObjectTemplate {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP EntityDistributionEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetWeight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetScenarioObjectTemplate() const override; + + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void SetScenarioObjectTemplate(std::shared_ptr scenarioObjectTemplate) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterScenarioObjectTemplate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetScenarioObjectTemplate() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityObject. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityObject) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityObjectImpl: public BaseImpl, public IEntityObjectWriter, public std::enable_shared_from_this + { + private: + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + bool _isSetVehicle = false; + std::shared_ptr _vehicle {}; + bool _isSetPedestrian = false; + std::shared_ptr _pedestrian {}; + bool _isSetMiscObject = false; + std::shared_ptr _miscObject {}; + bool _isSetExternalObjectReference = false; + std::shared_ptr _externalObjectReference {}; + + public: + + OPENSCENARIOLIB_EXP EntityObjectImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPedestrian() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMiscObject() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetExternalObjectReference() const override; + + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void SetVehicle(std::shared_ptr vehicle) override; + + OPENSCENARIOLIB_EXP void SetPedestrian(std::shared_ptr pedestrian) override; + + OPENSCENARIOLIB_EXP void SetMiscObject(std::shared_ptr miscObject) override; + + OPENSCENARIOLIB_EXP void SetExternalObjectReference(std::shared_ptr externalObjectReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPedestrian() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterMiscObject() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterExternalObjectReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicle() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPedestrian() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMiscObject() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetExternalObjectReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntityRef. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntityRef) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityRefImpl: public BaseImpl, public IEntityRefWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + + public: + + OPENSCENARIOLIB_EXP EntityRefImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEntitySelection. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEntitySelection) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntitySelectionImpl: public BaseImpl, public IEntitySelectionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetMembers = false; + std::shared_ptr _members {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP EntitySelectionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMembers() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetMembers(std::shared_ptr members) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterMembers() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMembers() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEnvironment. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEnvironment) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentImpl: public BaseImpl, public IEnvironmentWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetTimeOfDay = false; + std::shared_ptr _timeOfDay {}; + bool _isSetWeather = false; + std::shared_ptr _weather {}; + bool _isSetRoadCondition = false; + std::shared_ptr _roadCondition {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP EnvironmentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeOfDay() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWeather() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoadCondition() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetTimeOfDay(std::shared_ptr timeOfDay) override; + + OPENSCENARIOLIB_EXP void SetWeather(std::shared_ptr weather) override; + + OPENSCENARIOLIB_EXP void SetRoadCondition(std::shared_ptr roadCondition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeOfDay() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterWeather() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoadCondition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual void ResetTimeOfDay() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeOfDay() const override; + OPENSCENARIOLIB_EXP virtual void ResetWeather() override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeather() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoadCondition() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadCondition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEnvironmentAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEnvironmentAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentActionImpl: public BaseImpl, public IEnvironmentActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEnvironment = false; + std::shared_ptr _environment {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + + public: + + OPENSCENARIOLIB_EXP EnvironmentActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetEnvironment() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + + + OPENSCENARIOLIB_EXP void SetEnvironment(std::shared_ptr environment) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEnvironment() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEnvironment() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEnvironmentCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEnvironmentCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentCatalogLocationImpl: public BaseImpl, public IEnvironmentCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP EnvironmentCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IEvent. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IEvent) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EventImpl: public BaseImpl, public IEventWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaximumExecutionCount = false; + uint32_t _maximumExecutionCount {1}; + bool _isSetName = false; + std::string _name {}; + bool _isSetPriority = false; + Priority _priority {}; + bool _isSetActions = false; + std::vector> _actions {}; + bool _isSetStartTrigger = false; + std::shared_ptr _startTrigger {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP EventImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP uint32_t GetMaximumExecutionCount() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP Priority GetPriority() const override; + OPENSCENARIOLIB_EXP std::vector> GetActions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterActions() const override; + OPENSCENARIOLIB_EXP int GetActionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetActionsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStartTrigger() const override; + + + OPENSCENARIOLIB_EXP void SetMaximumExecutionCount(const uint32_t maximumExecutionCount) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetPriority(const Priority priority) override; + + OPENSCENARIOLIB_EXP void SetActions(std::vector>& actions) override; + + OPENSCENARIOLIB_EXP void SetStartTrigger(std::shared_ptr startTrigger) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaximumExecutionCount(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPriority(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaximumExecutionCount() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPriority() const override; + + OPENSCENARIOLIB_EXP bool IsMaximumExecutionCountParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsPriorityParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStartTrigger() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaximumExecutionCount() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaximumExecutionCount() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPriority() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActions() const override; + OPENSCENARIOLIB_EXP virtual void ResetStartTrigger() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStartTrigger() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IExternalObjectReference. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IExternalObjectReference) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ExternalObjectReferenceImpl: public BaseImpl, public IExternalObjectReferenceWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ExternalObjectReferenceImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IFile. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IFile) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileImpl: public BaseImpl, public IFileWriter, public std::enable_shared_from_this + { + private: + bool _isSetFilepath = false; + std::string _filepath {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP FileImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetFilepath() const override; + + + OPENSCENARIOLIB_EXP void SetFilepath(const std::string filepath) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToFilepath(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFilepath() const override; + + OPENSCENARIOLIB_EXP bool IsFilepathParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetFilepath() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IFileHeader. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IFileHeader) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileHeaderImpl: public BaseImpl, public IFileHeaderWriter, public std::enable_shared_from_this + { + private: + bool _isSetAuthor = false; + std::string _author {}; + bool _isSetDate = false; + DateTime _date {}; + bool _isSetDescription = false; + std::string _description {}; + bool _isSetRevMajor = false; + uint16_t _revMajor {}; + bool _isSetRevMinor = false; + uint16_t _revMinor {}; + bool _isSetLicense = false; + std::shared_ptr _license {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveUnsignedShortExpression(std::string& attributeKey, unsigned short& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) override; + OPENSCENARIOLIB_EXP FileHeaderImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetAuthor() const override; + OPENSCENARIOLIB_EXP DateTime GetDate() const override; + OPENSCENARIOLIB_EXP std::string GetDescription() const override; + OPENSCENARIOLIB_EXP uint16_t GetRevMajor() const override; + OPENSCENARIOLIB_EXP uint16_t GetRevMinor() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLicense() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetAuthor(const std::string author) override; + + OPENSCENARIOLIB_EXP void SetDate(const DateTime date) override; + + OPENSCENARIOLIB_EXP void SetDescription(const std::string description) override; + + OPENSCENARIOLIB_EXP void SetRevMajor(const uint16_t revMajor) override; + + OPENSCENARIOLIB_EXP void SetRevMinor(const uint16_t revMinor) override; + + OPENSCENARIOLIB_EXP void SetLicense(std::shared_ptr license) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAuthor(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDescription(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRevMajor(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRevMinor(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAuthor() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDescription() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRevMajor() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRevMinor() const override; + + OPENSCENARIOLIB_EXP bool IsAuthorParameterized() override; + OPENSCENARIOLIB_EXP bool IsDateParameterized() override; + OPENSCENARIOLIB_EXP bool IsDescriptionParameterized() override; + OPENSCENARIOLIB_EXP bool IsRevMajorParameterized() override; + OPENSCENARIOLIB_EXP bool IsRevMinorParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLicense() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAuthor() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDescription() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRevMajor() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRevMinor() const override; + OPENSCENARIOLIB_EXP virtual void ResetLicense() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLicense() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IFinalSpeed. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IFinalSpeed) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FinalSpeedImpl: public BaseImpl, public IFinalSpeedWriter, public std::enable_shared_from_this + { + private: + bool _isSetAbsoluteSpeed = false; + std::shared_ptr _absoluteSpeed {}; + bool _isSetRelativeSpeedToMaster = false; + std::shared_ptr _relativeSpeedToMaster {}; + + public: + + OPENSCENARIOLIB_EXP FinalSpeedImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetAbsoluteSpeed() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeSpeedToMaster() const override; + + + OPENSCENARIOLIB_EXP void SetAbsoluteSpeed(std::shared_ptr absoluteSpeed) override; + + OPENSCENARIOLIB_EXP void SetRelativeSpeedToMaster(std::shared_ptr relativeSpeedToMaster) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAbsoluteSpeed() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeSpeedToMaster() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAbsoluteSpeed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeSpeedToMaster() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IFog. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IFog) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FogImpl: public BaseImpl, public IFogWriter, public std::enable_shared_from_this + { + private: + bool _isSetVisualRange = false; + double _visualRange {}; + bool _isSetBoundingBox = false; + std::shared_ptr _boundingBox {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP FogImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetVisualRange() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBoundingBox() const override; + + + OPENSCENARIOLIB_EXP void SetVisualRange(const double visualRange) override; + + OPENSCENARIOLIB_EXP void SetBoundingBox(std::shared_ptr boundingBox) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToVisualRange(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVisualRange() const override; + + OPENSCENARIOLIB_EXP bool IsVisualRangeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBoundingBox() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVisualRange() const override; + OPENSCENARIOLIB_EXP virtual void ResetBoundingBox() override; + OPENSCENARIOLIB_EXP virtual bool IsSetBoundingBox() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IFollowTrajectoryAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IFollowTrajectoryAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FollowTrajectoryActionImpl: public BaseImpl, public IFollowTrajectoryActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetInitialDistanceOffset = false; + double _initialDistanceOffset {0}; + bool _isSetTrajectory = false; + std::shared_ptr _trajectory {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + bool _isSetTimeReference = false; + std::shared_ptr _timeReference {}; + bool _isSetTrajectoryFollowingMode = false; + std::shared_ptr _trajectoryFollowingMode {}; + bool _isSetTrajectoryRef = false; + std::shared_ptr _trajectoryRef {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP FollowTrajectoryActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetInitialDistanceOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectory() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoryFollowingMode() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoryRef() const override; + + + OPENSCENARIOLIB_EXP void SetInitialDistanceOffset(const double initialDistanceOffset) override; + + OPENSCENARIOLIB_EXP void SetTrajectory(std::shared_ptr trajectory) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void SetTimeReference(std::shared_ptr timeReference) override; + + OPENSCENARIOLIB_EXP void SetTrajectoryFollowingMode(std::shared_ptr trajectoryFollowingMode) override; + + OPENSCENARIOLIB_EXP void SetTrajectoryRef(std::shared_ptr trajectoryRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToInitialDistanceOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromInitialDistanceOffset() const override; + + OPENSCENARIOLIB_EXP bool IsInitialDistanceOffsetParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectory() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectoryFollowingMode() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectoryRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetInitialDistanceOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetInitialDistanceOffset() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrajectory() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectory() const override; + OPENSCENARIOLIB_EXP virtual void ResetCatalogReference() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectoryFollowingMode() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrajectoryRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectoryRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IGear. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IGear) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GearImpl: public BaseImpl, public IGearWriter, public std::enable_shared_from_this + { + private: + bool _isSetManualGear = false; + std::shared_ptr _manualGear {}; + bool _isSetAutomaticGear = false; + std::shared_ptr _automaticGear {}; + + public: + + OPENSCENARIOLIB_EXP GearImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetManualGear() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAutomaticGear() const override; + + + OPENSCENARIOLIB_EXP void SetManualGear(std::shared_ptr manualGear) override; + + OPENSCENARIOLIB_EXP void SetAutomaticGear(std::shared_ptr automaticGear) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterManualGear() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAutomaticGear() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetManualGear() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAutomaticGear() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IGeoPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IGeoPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GeoPositionImpl: public BaseImpl, public IGeoPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAltitude = false; + double _altitude {0}; + bool _isSetHeight = false; + double _height {0}; + bool _isSetLatitude = false; + double _latitude {0}; + bool _isSetLatitudeDeg = false; + double _latitudeDeg {}; + bool _isSetLongitude = false; + double _longitude {0}; + bool _isSetLongitudeDeg = false; + double _longitudeDeg {0}; + bool _isSetVerticalRoadSelection = false; + int _verticalRoadSelection {}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP GeoPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAltitude() const override; + OPENSCENARIOLIB_EXP double GetHeight() const override; + OPENSCENARIOLIB_EXP double GetLatitude() const override; + OPENSCENARIOLIB_EXP double GetLatitudeDeg() const override; + OPENSCENARIOLIB_EXP double GetLongitude() const override; + OPENSCENARIOLIB_EXP double GetLongitudeDeg() const override; + OPENSCENARIOLIB_EXP int GetVerticalRoadSelection() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetAltitude(const double altitude) override; + + OPENSCENARIOLIB_EXP void SetHeight(const double height) override; + + OPENSCENARIOLIB_EXP void SetLatitude(const double latitude) override; + + OPENSCENARIOLIB_EXP void SetLatitudeDeg(const double latitudeDeg) override; + + OPENSCENARIOLIB_EXP void SetLongitude(const double longitude) override; + + OPENSCENARIOLIB_EXP void SetLongitudeDeg(const double longitudeDeg) override; + + OPENSCENARIOLIB_EXP void SetVerticalRoadSelection(const int verticalRoadSelection) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAltitude(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToHeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLatitude(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLatitudeDeg(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLongitude(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLongitudeDeg(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVerticalRoadSelection(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAltitude() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromHeight() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLatitude() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLatitudeDeg() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLongitude() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLongitudeDeg() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVerticalRoadSelection() const override; + + OPENSCENARIOLIB_EXP bool IsAltitudeParameterized() override; + OPENSCENARIOLIB_EXP bool IsHeightParameterized() override; + OPENSCENARIOLIB_EXP bool IsLatitudeParameterized() override; + OPENSCENARIOLIB_EXP bool IsLatitudeDegParameterized() override; + OPENSCENARIOLIB_EXP bool IsLongitudeParameterized() override; + OPENSCENARIOLIB_EXP bool IsLongitudeDegParameterized() override; + OPENSCENARIOLIB_EXP bool IsVerticalRoadSelectionParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual void ResetAltitude() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAltitude() const override; + OPENSCENARIOLIB_EXP virtual void ResetHeight() override; + OPENSCENARIOLIB_EXP virtual bool IsSetHeight() const override; + OPENSCENARIOLIB_EXP virtual void ResetLatitude() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLatitude() const override; + OPENSCENARIOLIB_EXP virtual void ResetLatitudeDeg() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLatitudeDeg() const override; + OPENSCENARIOLIB_EXP virtual void ResetLongitude() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLongitude() const override; + OPENSCENARIOLIB_EXP virtual void ResetLongitudeDeg() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLongitudeDeg() const override; + OPENSCENARIOLIB_EXP virtual void ResetVerticalRoadSelection() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVerticalRoadSelection() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IGlobalAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IGlobalAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GlobalActionImpl: public BaseImpl, public IGlobalActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEnvironmentAction = false; + std::shared_ptr _environmentAction {}; + bool _isSetEntityAction = false; + std::shared_ptr _entityAction {}; + bool _isSetInfrastructureAction = false; + std::shared_ptr _infrastructureAction {}; + bool _isSetSetMonitorAction = false; + std::shared_ptr _setMonitorAction {}; + bool _isSetParameterAction = false; + std::shared_ptr _parameterAction {}; + bool _isSetTrafficAction = false; + std::shared_ptr _trafficAction {}; + bool _isSetVariableAction = false; + std::shared_ptr _variableAction {}; + + public: + + OPENSCENARIOLIB_EXP GlobalActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetEnvironmentAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetInfrastructureAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSetMonitorAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVariableAction() const override; + + + OPENSCENARIOLIB_EXP void SetEnvironmentAction(std::shared_ptr environmentAction) override; + + OPENSCENARIOLIB_EXP void SetEntityAction(std::shared_ptr entityAction) override; + + OPENSCENARIOLIB_EXP void SetInfrastructureAction(std::shared_ptr infrastructureAction) override; + + OPENSCENARIOLIB_EXP void SetSetMonitorAction(std::shared_ptr setMonitorAction) override; + + OPENSCENARIOLIB_EXP void SetParameterAction(std::shared_ptr parameterAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficAction(std::shared_ptr trafficAction) override; + + OPENSCENARIOLIB_EXP void SetVariableAction(std::shared_ptr variableAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEnvironmentAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterInfrastructureAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSetMonitorAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterParameterAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVariableAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEnvironmentAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetInfrastructureAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSetMonitorAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IHistogram. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IHistogram) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramImpl: public BaseImpl, public IHistogramWriter, public std::enable_shared_from_this + { + private: + bool _isSetBins = false; + std::vector> _bins {}; + + public: + + OPENSCENARIOLIB_EXP HistogramImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetBins() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterBins() const override; + OPENSCENARIOLIB_EXP int GetBinsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBinsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetBins(std::vector>& bins) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetBins() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IHistogramBin. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IHistogramBin) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramBinImpl: public BaseImpl, public IHistogramBinWriter, public std::enable_shared_from_this + { + private: + bool _isSetWeight = false; + double _weight {}; + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP HistogramBinImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetWeight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IInRoutePosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IInRoutePosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InRoutePositionImpl: public BaseImpl, public IInRoutePositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetFromCurrentEntity = false; + std::shared_ptr _fromCurrentEntity {}; + bool _isSetFromRoadCoordinates = false; + std::shared_ptr _fromRoadCoordinates {}; + bool _isSetFromLaneCoordinates = false; + std::shared_ptr _fromLaneCoordinates {}; + + public: + + OPENSCENARIOLIB_EXP InRoutePositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetFromCurrentEntity() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFromRoadCoordinates() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFromLaneCoordinates() const override; + + + OPENSCENARIOLIB_EXP void SetFromCurrentEntity(std::shared_ptr fromCurrentEntity) override; + + OPENSCENARIOLIB_EXP void SetFromRoadCoordinates(std::shared_ptr fromRoadCoordinates) override; + + OPENSCENARIOLIB_EXP void SetFromLaneCoordinates(std::shared_ptr fromLaneCoordinates) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFromCurrentEntity() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFromRoadCoordinates() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFromLaneCoordinates() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFromCurrentEntity() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFromRoadCoordinates() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFromLaneCoordinates() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IInfrastructureAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IInfrastructureAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InfrastructureActionImpl: public BaseImpl, public IInfrastructureActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrafficSignalAction = false; + std::shared_ptr _trafficSignalAction {}; + + public: + + OPENSCENARIOLIB_EXP InfrastructureActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalAction() const override; + + + OPENSCENARIOLIB_EXP void SetTrafficSignalAction(std::shared_ptr trafficSignalAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IInit. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IInit) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InitImpl: public BaseImpl, public IInitWriter, public std::enable_shared_from_this + { + private: + bool _isSetActions = false; + std::shared_ptr _actions {}; + + public: + + OPENSCENARIOLIB_EXP InitImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetActions() const override; + + + OPENSCENARIOLIB_EXP void SetActions(std::shared_ptr actions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterActions() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IInitActions. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IInitActions) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InitActionsImpl: public BaseImpl, public IInitActionsWriter, public std::enable_shared_from_this + { + private: + bool _isSetGlobalActions = false; + std::vector> _globalActions {}; + bool _isSetUserDefinedActions = false; + std::vector> _userDefinedActions {}; + bool _isSetPrivates = false; + std::vector> _privates {}; + + public: + + OPENSCENARIOLIB_EXP InitActionsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetGlobalActions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterGlobalActions() const override; + OPENSCENARIOLIB_EXP int GetGlobalActionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGlobalActionsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetUserDefinedActions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterUserDefinedActions() const override; + OPENSCENARIOLIB_EXP int GetUserDefinedActionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedActionsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetPrivates() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPrivates() const override; + OPENSCENARIOLIB_EXP int GetPrivatesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPrivatesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetGlobalActions(std::vector>& globalActions) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedActions(std::vector>& userDefinedActions) override; + + OPENSCENARIOLIB_EXP void SetPrivates(std::vector>& privates) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual void ResetGlobalActions() override; + OPENSCENARIOLIB_EXP virtual bool IsSetGlobalActions() const override; + OPENSCENARIOLIB_EXP virtual void ResetUserDefinedActions() override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedActions() const override; + OPENSCENARIOLIB_EXP virtual void ResetPrivates() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrivates() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IKnot. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IKnot) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class KnotImpl: public BaseImpl, public IKnotWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP KnotImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILane. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILane) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneImpl: public BaseImpl, public ILaneWriter, public std::enable_shared_from_this + { + private: + bool _isSetId = false; + int _id {}; + + public: + + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP LaneImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP int GetId() const override; + + + OPENSCENARIOLIB_EXP void SetId(const int id) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromId() const override; + + OPENSCENARIOLIB_EXP bool IsIdParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetId() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILaneChangeAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILaneChangeAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeActionImpl: public BaseImpl, public ILaneChangeActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTargetLaneOffset = false; + double _targetLaneOffset {0}; + bool _isSetLaneChangeActionDynamics = false; + std::shared_ptr _laneChangeActionDynamics {}; + bool _isSetLaneChangeTarget = false; + std::shared_ptr _laneChangeTarget {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LaneChangeActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneChangeActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneChangeTarget() const override; + + + OPENSCENARIOLIB_EXP void SetTargetLaneOffset(const double targetLaneOffset) override; + + OPENSCENARIOLIB_EXP void SetLaneChangeActionDynamics(std::shared_ptr laneChangeActionDynamics) override; + + OPENSCENARIOLIB_EXP void SetLaneChangeTarget(std::shared_ptr laneChangeTarget) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTargetLaneOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTargetLaneOffset() const override; + + OPENSCENARIOLIB_EXP bool IsTargetLaneOffsetParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneChangeActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneChangeTarget() const override; + OPENSCENARIOLIB_EXP virtual void ResetTargetLaneOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneChangeActionDynamics() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneChangeTarget() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILaneChangeTarget. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILaneChangeTarget) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeTargetImpl: public BaseImpl, public ILaneChangeTargetWriter, public std::enable_shared_from_this + { + private: + bool _isSetRelativeTargetLane = false; + std::shared_ptr _relativeTargetLane {}; + bool _isSetAbsoluteTargetLane = false; + std::shared_ptr _absoluteTargetLane {}; + + public: + + OPENSCENARIOLIB_EXP LaneChangeTargetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeTargetLane() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAbsoluteTargetLane() const override; + + + OPENSCENARIOLIB_EXP void SetRelativeTargetLane(std::shared_ptr relativeTargetLane) override; + + OPENSCENARIOLIB_EXP void SetAbsoluteTargetLane(std::shared_ptr absoluteTargetLane) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeTargetLane() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAbsoluteTargetLane() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeTargetLane() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAbsoluteTargetLane() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILaneOffsetAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILaneOffsetAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionImpl: public BaseImpl, public ILaneOffsetActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContinuous = false; + bool _continuous {}; + bool _isSetLaneOffsetActionDynamics = false; + std::shared_ptr _laneOffsetActionDynamics {}; + bool _isSetLaneOffsetTarget = false; + std::shared_ptr _laneOffsetTarget {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP LaneOffsetActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetContinuous() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneOffsetActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneOffsetTarget() const override; + + + OPENSCENARIOLIB_EXP void SetContinuous(const bool continuous) override; + + OPENSCENARIOLIB_EXP void SetLaneOffsetActionDynamics(std::shared_ptr laneOffsetActionDynamics) override; + + OPENSCENARIOLIB_EXP void SetLaneOffsetTarget(std::shared_ptr laneOffsetTarget) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContinuous(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContinuous() const override; + + OPENSCENARIOLIB_EXP bool IsContinuousParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneOffsetActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneOffsetTarget() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetContinuous() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneOffsetActionDynamics() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneOffsetTarget() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILaneOffsetActionDynamics. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILaneOffsetActionDynamics) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionDynamicsImpl: public BaseImpl, public ILaneOffsetActionDynamicsWriter, public std::enable_shared_from_this + { + private: + bool _isSetDynamicsShape = false; + DynamicsShape _dynamicsShape {}; + bool _isSetMaxLateralAcc = false; + double _maxLateralAcc {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LaneOffsetActionDynamicsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DynamicsShape GetDynamicsShape() const override; + OPENSCENARIOLIB_EXP double GetMaxLateralAcc() const override; + + + OPENSCENARIOLIB_EXP void SetDynamicsShape(const DynamicsShape dynamicsShape) override; + + OPENSCENARIOLIB_EXP void SetMaxLateralAcc(const double maxLateralAcc) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDynamicsShape(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxLateralAcc(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDynamicsShape() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxLateralAcc() const override; + + OPENSCENARIOLIB_EXP bool IsDynamicsShapeParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxLateralAccParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicsShape() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxLateralAcc() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxLateralAcc() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILaneOffsetTarget. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILaneOffsetTarget) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetTargetImpl: public BaseImpl, public ILaneOffsetTargetWriter, public std::enable_shared_from_this + { + private: + bool _isSetRelativeTargetLaneOffset = false; + std::shared_ptr _relativeTargetLaneOffset {}; + bool _isSetAbsoluteTargetLaneOffset = false; + std::shared_ptr _absoluteTargetLaneOffset {}; + + public: + + OPENSCENARIOLIB_EXP LaneOffsetTargetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAbsoluteTargetLaneOffset() const override; + + + OPENSCENARIOLIB_EXP void SetRelativeTargetLaneOffset(std::shared_ptr relativeTargetLaneOffset) override; + + OPENSCENARIOLIB_EXP void SetAbsoluteTargetLaneOffset(std::shared_ptr absoluteTargetLaneOffset) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAbsoluteTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeTargetLaneOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAbsoluteTargetLaneOffset() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILanePosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILanePosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LanePositionImpl: public BaseImpl, public ILanePositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetLaneId = false; + std::string _laneId {}; + bool _isSetOffset = false; + double _offset {0}; + bool _isSetRoadId = false; + std::string _roadId {}; + bool _isSetS = false; + double _s {}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LanePositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetLaneId() const override; + OPENSCENARIOLIB_EXP double GetOffset() const override; + OPENSCENARIOLIB_EXP std::string GetRoadId() const override; + OPENSCENARIOLIB_EXP double GetS() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetLaneId(const std::string laneId) override; + + OPENSCENARIOLIB_EXP void SetOffset(const double offset) override; + + OPENSCENARIOLIB_EXP void SetRoadId(const std::string roadId) override; + + OPENSCENARIOLIB_EXP void SetS(const double s) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToLaneId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoadId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLaneId() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOffset() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoadId() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromS() const override; + + OPENSCENARIOLIB_EXP bool IsLaneIdParameterized() override; + OPENSCENARIOLIB_EXP bool IsOffsetParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoadIdParameterized() override; + OPENSCENARIOLIB_EXP bool IsSParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneId() const override; + OPENSCENARIOLIB_EXP virtual void ResetOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadId() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetS() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILateralAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILateralAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralActionImpl: public BaseImpl, public ILateralActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetLaneChangeAction = false; + std::shared_ptr _laneChangeAction {}; + bool _isSetLaneOffsetAction = false; + std::shared_ptr _laneOffsetAction {}; + bool _isSetLateralDistanceAction = false; + std::shared_ptr _lateralDistanceAction {}; + + public: + + OPENSCENARIOLIB_EXP LateralActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneChangeAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneOffsetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLateralDistanceAction() const override; + + + OPENSCENARIOLIB_EXP void SetLaneChangeAction(std::shared_ptr laneChangeAction) override; + + OPENSCENARIOLIB_EXP void SetLaneOffsetAction(std::shared_ptr laneOffsetAction) override; + + OPENSCENARIOLIB_EXP void SetLateralDistanceAction(std::shared_ptr lateralDistanceAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneChangeAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLaneOffsetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLateralDistanceAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneChangeAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneOffsetAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLateralDistanceAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILateralDistanceAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILateralDistanceAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralDistanceActionImpl: public BaseImpl, public ILateralDistanceActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContinuous = false; + bool _continuous {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetDisplacement = false; + LateralDisplacement _displacement {LateralDisplacement::LateralDisplacementEnum::ANY}; + bool _isSetDistance = false; + double _distance {0}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetDynamicConstraints = false; + std::shared_ptr _dynamicConstraints {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LateralDistanceActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetContinuous() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP LateralDisplacement GetDisplacement() const override; + OPENSCENARIOLIB_EXP double GetDistance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDynamicConstraints() const override; + + + OPENSCENARIOLIB_EXP void SetContinuous(const bool continuous) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetDisplacement(const LateralDisplacement displacement) override; + + OPENSCENARIOLIB_EXP void SetDistance(const double distance) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetDynamicConstraints(std::shared_ptr dynamicConstraints) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContinuous(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDisplacement(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDistance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContinuous() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDisplacement() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDistance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP bool IsContinuousParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsDisplacementParameterized() override; + OPENSCENARIOLIB_EXP bool IsDistanceParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDynamicConstraints() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetContinuous() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual void ResetDisplacement() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDisplacement() const override; + OPENSCENARIOLIB_EXP virtual void ResetDistance() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual void ResetDynamicConstraints() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicConstraints() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILicense. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILicense) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LicenseImpl: public BaseImpl, public ILicenseWriter, public std::enable_shared_from_this + { + private: + bool _isSetText = false; + std::string _text {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetResource = false; + std::string _resource {}; + bool _isSetSpdxId = false; + std::string _spdxId {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP LicenseImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetText() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetResource() const override; + OPENSCENARIOLIB_EXP std::string GetSpdxId() const override; + + + OPENSCENARIOLIB_EXP void SetText(const std::string text) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetResource(const std::string resource) override; + + OPENSCENARIOLIB_EXP void SetSpdxId(const std::string spdxId) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToText(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToResource(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpdxId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromText() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromResource() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpdxId() const override; + + OPENSCENARIOLIB_EXP bool IsTextParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsResourceParameterized() override; + OPENSCENARIOLIB_EXP bool IsSpdxIdParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetText() override; + OPENSCENARIOLIB_EXP virtual bool IsSetText() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetResource() override; + OPENSCENARIOLIB_EXP virtual bool IsSetResource() const override; + OPENSCENARIOLIB_EXP virtual void ResetSpdxId() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpdxId() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILightState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILightState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateImpl: public BaseImpl, public ILightStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetFlashingOffDuration = false; + double _flashingOffDuration {0.5}; + bool _isSetFlashingOnDuration = false; + double _flashingOnDuration {0.5}; + bool _isSetLuminousIntensity = false; + double _luminousIntensity {}; + bool _isSetMode = false; + LightMode _mode {}; + bool _isSetColor = false; + std::shared_ptr _color {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LightStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetFlashingOffDuration() const override; + OPENSCENARIOLIB_EXP double GetFlashingOnDuration() const override; + OPENSCENARIOLIB_EXP double GetLuminousIntensity() const override; + OPENSCENARIOLIB_EXP LightMode GetMode() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetColor() const override; + + + OPENSCENARIOLIB_EXP void SetFlashingOffDuration(const double flashingOffDuration) override; + + OPENSCENARIOLIB_EXP void SetFlashingOnDuration(const double flashingOnDuration) override; + + OPENSCENARIOLIB_EXP void SetLuminousIntensity(const double luminousIntensity) override; + + OPENSCENARIOLIB_EXP void SetMode(const LightMode mode) override; + + OPENSCENARIOLIB_EXP void SetColor(std::shared_ptr color) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToFlashingOffDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFlashingOnDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLuminousIntensity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMode(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFlashingOffDuration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFlashingOnDuration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLuminousIntensity() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMode() const override; + + OPENSCENARIOLIB_EXP bool IsFlashingOffDurationParameterized() override; + OPENSCENARIOLIB_EXP bool IsFlashingOnDurationParameterized() override; + OPENSCENARIOLIB_EXP bool IsLuminousIntensityParameterized() override; + OPENSCENARIOLIB_EXP bool IsModeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterColor() const override; + OPENSCENARIOLIB_EXP virtual void ResetFlashingOffDuration() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFlashingOffDuration() const override; + OPENSCENARIOLIB_EXP virtual void ResetFlashingOnDuration() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFlashingOnDuration() const override; + OPENSCENARIOLIB_EXP virtual void ResetLuminousIntensity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLuminousIntensity() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMode() const override; + OPENSCENARIOLIB_EXP virtual void ResetColor() override; + OPENSCENARIOLIB_EXP virtual bool IsSetColor() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILightStateAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILightStateAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateActionImpl: public BaseImpl, public ILightStateActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTransitionTime = false; + double _transitionTime {0}; + bool _isSetLightType = false; + std::shared_ptr _lightType {}; + bool _isSetLightState = false; + std::shared_ptr _lightState {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LightStateActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTransitionTime() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLightType() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLightState() const override; + + + OPENSCENARIOLIB_EXP void SetTransitionTime(const double transitionTime) override; + + OPENSCENARIOLIB_EXP void SetLightType(std::shared_ptr lightType) override; + + OPENSCENARIOLIB_EXP void SetLightState(std::shared_ptr lightState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTransitionTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTransitionTime() const override; + + OPENSCENARIOLIB_EXP bool IsTransitionTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLightType() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLightState() const override; + OPENSCENARIOLIB_EXP virtual void ResetTransitionTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTransitionTime() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLightType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLightState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILightType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILightType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightTypeImpl: public BaseImpl, public ILightTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleLight = false; + std::shared_ptr _vehicleLight {}; + bool _isSetUserDefinedLight = false; + std::shared_ptr _userDefinedLight {}; + + public: + + OPENSCENARIOLIB_EXP LightTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleLight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedLight() const override; + + + OPENSCENARIOLIB_EXP void SetVehicleLight(std::shared_ptr vehicleLight) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedLight(std::shared_ptr userDefinedLight) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicleLight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedLight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleLight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedLight() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILogNormalDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILogNormalDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LogNormalDistributionImpl: public BaseImpl, public ILogNormalDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetExpectedValue = false; + double _expectedValue {}; + bool _isSetVariance = false; + double _variance {}; + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LogNormalDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetExpectedValue() const override; + OPENSCENARIOLIB_EXP double GetVariance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetExpectedValue(const double expectedValue) override; + + OPENSCENARIOLIB_EXP void SetVariance(const double variance) override; + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToExpectedValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVariance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromExpectedValue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVariance() const override; + + OPENSCENARIOLIB_EXP bool IsExpectedValueParameterized() override; + OPENSCENARIOLIB_EXP bool IsVarianceParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetExpectedValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariance() const override; + OPENSCENARIOLIB_EXP virtual void ResetRange() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILongitudinalAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILongitudinalAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalActionImpl: public BaseImpl, public ILongitudinalActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetSpeedAction = false; + std::shared_ptr _speedAction {}; + bool _isSetLongitudinalDistanceAction = false; + std::shared_ptr _longitudinalDistanceAction {}; + bool _isSetSpeedProfileAction = false; + std::shared_ptr _speedProfileAction {}; + + public: + + OPENSCENARIOLIB_EXP LongitudinalActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLongitudinalDistanceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedProfileAction() const override; + + + OPENSCENARIOLIB_EXP void SetSpeedAction(std::shared_ptr speedAction) override; + + OPENSCENARIOLIB_EXP void SetLongitudinalDistanceAction(std::shared_ptr longitudinalDistanceAction) override; + + OPENSCENARIOLIB_EXP void SetSpeedProfileAction(std::shared_ptr speedProfileAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSpeedAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLongitudinalDistanceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSpeedProfileAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLongitudinalDistanceAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedProfileAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ILongitudinalDistanceAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ILongitudinalDistanceAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalDistanceActionImpl: public BaseImpl, public ILongitudinalDistanceActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContinuous = false; + bool _continuous {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetDisplacement = false; + LongitudinalDisplacement _displacement {LongitudinalDisplacement::LongitudinalDisplacementEnum::TRAILING_REFERENCED_ENTITY}; + bool _isSetDistance = false; + double _distance {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetTimeGap = false; + double _timeGap {}; + bool _isSetDynamicConstraints = false; + std::shared_ptr _dynamicConstraints {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP LongitudinalDistanceActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetContinuous() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP LongitudinalDisplacement GetDisplacement() const override; + OPENSCENARIOLIB_EXP double GetDistance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP double GetTimeGap() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDynamicConstraints() const override; + + + OPENSCENARIOLIB_EXP void SetContinuous(const bool continuous) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetDisplacement(const LongitudinalDisplacement displacement) override; + + OPENSCENARIOLIB_EXP void SetDistance(const double distance) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetTimeGap(const double timeGap) override; + + OPENSCENARIOLIB_EXP void SetDynamicConstraints(std::shared_ptr dynamicConstraints) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContinuous(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDisplacement(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDistance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTimeGap(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContinuous() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDisplacement() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDistance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTimeGap() const override; + + OPENSCENARIOLIB_EXP bool IsContinuousParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsDisplacementParameterized() override; + OPENSCENARIOLIB_EXP bool IsDistanceParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsTimeGapParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDynamicConstraints() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetContinuous() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual void ResetDisplacement() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDisplacement() const override; + OPENSCENARIOLIB_EXP virtual void ResetDistance() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual void ResetTimeGap() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeGap() const override; + OPENSCENARIOLIB_EXP virtual void ResetDynamicConstraints() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicConstraints() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IManeuver. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IManeuver) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverImpl: public BaseImpl, public IManeuverWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetEvents = false; + std::vector> _events {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ManeuverImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetEvents() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEvents() const override; + OPENSCENARIOLIB_EXP int GetEventsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEventsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetEvents(std::vector>& events) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEvents() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IManeuverCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IManeuverCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverCatalogLocationImpl: public BaseImpl, public IManeuverCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP ManeuverCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IManeuverGroup. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IManeuverGroup) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverGroupImpl: public BaseImpl, public IManeuverGroupWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaximumExecutionCount = false; + uint32_t _maximumExecutionCount {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetActors = false; + std::shared_ptr _actors {}; + bool _isSetCatalogReferences = false; + std::vector> _catalogReferences {}; + bool _isSetManeuvers = false; + std::vector> _maneuvers {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ManeuverGroupImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP uint32_t GetMaximumExecutionCount() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetActors() const override; + OPENSCENARIOLIB_EXP std::vector> GetCatalogReferences() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterCatalogReferences() const override; + OPENSCENARIOLIB_EXP int GetCatalogReferencesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReferencesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetManeuvers() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterManeuvers() const override; + OPENSCENARIOLIB_EXP int GetManeuversSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetManeuversAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetMaximumExecutionCount(const uint32_t maximumExecutionCount) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetActors(std::shared_ptr actors) override; + + OPENSCENARIOLIB_EXP void SetCatalogReferences(std::vector>& catalogReferences) override; + + OPENSCENARIOLIB_EXP void SetManeuvers(std::vector>& maneuvers) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaximumExecutionCount(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaximumExecutionCount() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsMaximumExecutionCountParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterActors() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaximumExecutionCount() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActors() const override; + OPENSCENARIOLIB_EXP virtual void ResetCatalogReferences() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReferences() const override; + OPENSCENARIOLIB_EXP virtual void ResetManeuvers() override; + OPENSCENARIOLIB_EXP virtual bool IsSetManeuvers() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IManualGear. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IManualGear) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManualGearImpl: public BaseImpl, public IManualGearWriter, public std::enable_shared_from_this + { + private: + bool _isSetNumber = false; + int _number {}; + + public: + + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP ManualGearImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP int GetNumber() const override; + + + OPENSCENARIOLIB_EXP void SetNumber(const int number) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToNumber(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromNumber() const override; + + OPENSCENARIOLIB_EXP bool IsNumberParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetNumber() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IMiscObject. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IMiscObject) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectImpl: public BaseImpl, public IMiscObjectWriter, public std::enable_shared_from_this + { + private: + bool _isSetMass = false; + double _mass {}; + bool _isSetMiscObjectCategory = false; + MiscObjectCategory _miscObjectCategory {}; + bool _isSetModel3d = false; + std::string _model3d {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetBoundingBox = false; + std::shared_ptr _boundingBox {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP MiscObjectImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMass() const override; + OPENSCENARIOLIB_EXP MiscObjectCategory GetMiscObjectCategory() const override; + OPENSCENARIOLIB_EXP std::string GetModel3d() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetMass(const double mass) override; + + OPENSCENARIOLIB_EXP void SetMiscObjectCategory(const MiscObjectCategory miscObjectCategory) override; + + OPENSCENARIOLIB_EXP void SetModel3d(const std::string model3d) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetBoundingBox(std::shared_ptr boundingBox) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMass(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMiscObjectCategory(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToModel3d(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMass() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMiscObjectCategory() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromModel3d() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsMassParameterized() override; + OPENSCENARIOLIB_EXP bool IsMiscObjectCategoryParameterized() override; + OPENSCENARIOLIB_EXP bool IsModel3dParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMass() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMiscObjectCategory() const override; + OPENSCENARIOLIB_EXP virtual void ResetModel3d() override; + OPENSCENARIOLIB_EXP virtual bool IsSetModel3d() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetBoundingBox() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IMiscObjectCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IMiscObjectCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectCatalogLocationImpl: public BaseImpl, public IMiscObjectCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP MiscObjectCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IModifyRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IModifyRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ModifyRuleImpl: public BaseImpl, public IModifyRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetAddValue = false; + std::shared_ptr _addValue {}; + bool _isSetMultiplyByValue = false; + std::shared_ptr _multiplyByValue {}; + + public: + + OPENSCENARIOLIB_EXP ModifyRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetAddValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMultiplyByValue() const override; + + + OPENSCENARIOLIB_EXP void SetAddValue(std::shared_ptr addValue) override; + + OPENSCENARIOLIB_EXP void SetMultiplyByValue(std::shared_ptr multiplyByValue) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAddValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterMultiplyByValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAddValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMultiplyByValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IMonitorDeclaration. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IMonitorDeclaration) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MonitorDeclarationImpl: public BaseImpl, public IMonitorDeclarationWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetValue = false; + bool _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP MonitorDeclarationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP bool GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetValue(const bool value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements INone. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of INone) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NoneImpl: public BaseImpl, public INoneWriter, public std::enable_shared_from_this + { + private: + + public: + + OPENSCENARIOLIB_EXP NoneImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements INormalDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of INormalDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NormalDistributionImpl: public BaseImpl, public INormalDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetExpectedValue = false; + double _expectedValue {}; + bool _isSetVariance = false; + double _variance {}; + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP NormalDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetExpectedValue() const override; + OPENSCENARIOLIB_EXP double GetVariance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetExpectedValue(const double expectedValue) override; + + OPENSCENARIOLIB_EXP void SetVariance(const double variance) override; + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToExpectedValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVariance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromExpectedValue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVariance() const override; + + OPENSCENARIOLIB_EXP bool IsExpectedValueParameterized() override; + OPENSCENARIOLIB_EXP bool IsVarianceParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetExpectedValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariance() const override; + OPENSCENARIOLIB_EXP virtual void ResetRange() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements INurbs. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of INurbs) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NurbsImpl: public BaseImpl, public INurbsWriter, public std::enable_shared_from_this + { + private: + bool _isSetOrder = false; + uint32_t _order {}; + bool _isSetControlPoints = false; + std::vector> _controlPoints {}; + bool _isSetKnots = false; + std::vector> _knots {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + OPENSCENARIOLIB_EXP NurbsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP uint32_t GetOrder() const override; + OPENSCENARIOLIB_EXP std::vector> GetControlPoints() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterControlPoints() const override; + OPENSCENARIOLIB_EXP int GetControlPointsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControlPointsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetKnots() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterKnots() const override; + OPENSCENARIOLIB_EXP int GetKnotsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetKnotsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetOrder(const uint32_t order) override; + + OPENSCENARIOLIB_EXP void SetControlPoints(std::vector>& controlPoints) override; + + OPENSCENARIOLIB_EXP void SetKnots(std::vector>& knots) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToOrder(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOrder() const override; + + OPENSCENARIOLIB_EXP bool IsOrderParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetOrder() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetControlPoints() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetKnots() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IObjectController. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IObjectController) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ObjectControllerImpl: public BaseImpl, public IObjectControllerWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + bool _isSetController = false; + std::shared_ptr _controller {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ObjectControllerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetController() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void SetController(std::shared_ptr controller) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterController() const override; + OPENSCENARIOLIB_EXP virtual void ResetName() override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetController() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOffroadCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOffroadCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OffroadConditionImpl: public BaseImpl, public IOffroadConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDuration = false; + double _duration {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OffroadConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDuration() const override; + + + OPENSCENARIOLIB_EXP void SetDuration(const double duration) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDuration() const override; + + OPENSCENARIOLIB_EXP bool IsDurationParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDuration() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOpenScenario. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOpenScenario) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioImpl: public BaseImpl, public IOpenScenarioWriter, public std::enable_shared_from_this + { + private: + bool _isSetFileHeader = false; + std::shared_ptr _fileHeader {}; + bool _isSetOpenScenarioCategory = false; + std::shared_ptr _openScenarioCategory {}; + + public: + + OPENSCENARIOLIB_EXP OpenScenarioImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetFileHeader() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOpenScenarioCategory() const override; + + + OPENSCENARIOLIB_EXP void SetFileHeader(std::shared_ptr fileHeader) override; + + OPENSCENARIOLIB_EXP void SetOpenScenarioCategory(std::shared_ptr openScenarioCategory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFileHeader() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOpenScenarioCategory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFileHeader() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOpenScenarioCategory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOpenScenarioCategory. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOpenScenarioCategory) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioCategoryImpl: public BaseImpl, public IOpenScenarioCategoryWriter, public std::enable_shared_from_this + { + private: + bool _isSetScenarioDefinition = false; + std::shared_ptr _scenarioDefinition {}; + bool _isSetCatalogDefinition = false; + std::shared_ptr _catalogDefinition {}; + bool _isSetParameterValueDistributionDefinition = false; + std::shared_ptr _parameterValueDistributionDefinition {}; + + public: + + OPENSCENARIOLIB_EXP OpenScenarioCategoryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetScenarioDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterValueDistributionDefinition() const override; + + + OPENSCENARIOLIB_EXP void SetScenarioDefinition(std::shared_ptr scenarioDefinition) override; + + OPENSCENARIOLIB_EXP void SetCatalogDefinition(std::shared_ptr catalogDefinition) override; + + OPENSCENARIOLIB_EXP void SetParameterValueDistributionDefinition(std::shared_ptr parameterValueDistributionDefinition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterScenarioDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterParameterValueDistributionDefinition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetScenarioDefinition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogDefinition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterValueDistributionDefinition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOrientation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOrientation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OrientationImpl: public BaseImpl, public IOrientationWriter, public std::enable_shared_from_this + { + private: + bool _isSetH = false; + double _h {0}; + bool _isSetP = false; + double _p {0}; + bool _isSetR = false; + double _r {0}; + bool _isSetType = false; + ReferenceContext _type {ReferenceContext::ReferenceContextEnum::ABSOLUTE}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OrientationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetH() const override; + OPENSCENARIOLIB_EXP double GetP() const override; + OPENSCENARIOLIB_EXP double GetR() const override; + OPENSCENARIOLIB_EXP ReferenceContext GetType() const override; + + + OPENSCENARIOLIB_EXP void SetH(const double h) override; + + OPENSCENARIOLIB_EXP void SetP(const double p) override; + + OPENSCENARIOLIB_EXP void SetR(const double r) override; + + OPENSCENARIOLIB_EXP void SetType(const ReferenceContext type) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToH(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToP(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToR(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromH() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromP() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromR() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromType() const override; + + OPENSCENARIOLIB_EXP bool IsHParameterized() override; + OPENSCENARIOLIB_EXP bool IsPParameterized() override; + OPENSCENARIOLIB_EXP bool IsRParameterized() override; + OPENSCENARIOLIB_EXP bool IsTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetH() override; + OPENSCENARIOLIB_EXP virtual bool IsSetH() const override; + OPENSCENARIOLIB_EXP virtual void ResetP() override; + OPENSCENARIOLIB_EXP virtual bool IsSetP() const override; + OPENSCENARIOLIB_EXP virtual void ResetR() override; + OPENSCENARIOLIB_EXP virtual bool IsSetR() const override; + OPENSCENARIOLIB_EXP virtual void ResetType() override; + OPENSCENARIOLIB_EXP virtual bool IsSetType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideBrakeAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideBrakeAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideBrakeActionImpl: public BaseImpl, public IOverrideBrakeActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetValue = false; + double _value {}; + bool _isSetBrakeInput = false; + std::shared_ptr _brakeInput {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideBrakeActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBrakeInput() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetBrakeInput(std::shared_ptr brakeInput) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBrakeInput() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetValue() override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetBrakeInput() override; + OPENSCENARIOLIB_EXP virtual bool IsSetBrakeInput() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideClutchAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideClutchAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideClutchActionImpl: public BaseImpl, public IOverrideClutchActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetMaxRate = false; + double _maxRate {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideClutchActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetMaxRate() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetMaxRate(const double maxRate) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideControllerValueAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideControllerValueAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideControllerValueActionImpl: public BaseImpl, public IOverrideControllerValueActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetThrottle = false; + std::shared_ptr _throttle {}; + bool _isSetBrake = false; + std::shared_ptr _brake {}; + bool _isSetClutch = false; + std::shared_ptr _clutch {}; + bool _isSetParkingBrake = false; + std::shared_ptr _parkingBrake {}; + bool _isSetSteeringWheel = false; + std::shared_ptr _steeringWheel {}; + bool _isSetGear = false; + std::shared_ptr _gear {}; + + public: + + OPENSCENARIOLIB_EXP OverrideControllerValueActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetThrottle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBrake() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetClutch() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParkingBrake() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSteeringWheel() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGear() const override; + + + OPENSCENARIOLIB_EXP void SetThrottle(std::shared_ptr throttle) override; + + OPENSCENARIOLIB_EXP void SetBrake(std::shared_ptr brake) override; + + OPENSCENARIOLIB_EXP void SetClutch(std::shared_ptr clutch) override; + + OPENSCENARIOLIB_EXP void SetParkingBrake(std::shared_ptr parkingBrake) override; + + OPENSCENARIOLIB_EXP void SetSteeringWheel(std::shared_ptr steeringWheel) override; + + OPENSCENARIOLIB_EXP void SetGear(std::shared_ptr gear) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterThrottle() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBrake() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterClutch() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterParkingBrake() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSteeringWheel() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterGear() const override; + OPENSCENARIOLIB_EXP virtual void ResetThrottle() override; + OPENSCENARIOLIB_EXP virtual bool IsSetThrottle() const override; + OPENSCENARIOLIB_EXP virtual void ResetBrake() override; + OPENSCENARIOLIB_EXP virtual bool IsSetBrake() const override; + OPENSCENARIOLIB_EXP virtual void ResetClutch() override; + OPENSCENARIOLIB_EXP virtual bool IsSetClutch() const override; + OPENSCENARIOLIB_EXP virtual void ResetParkingBrake() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParkingBrake() const override; + OPENSCENARIOLIB_EXP virtual void ResetSteeringWheel() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSteeringWheel() const override; + OPENSCENARIOLIB_EXP virtual void ResetGear() override; + OPENSCENARIOLIB_EXP virtual bool IsSetGear() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideGearAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideGearAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideGearActionImpl: public BaseImpl, public IOverrideGearActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetNumber = false; + double _number {}; + bool _isSetGear = false; + std::shared_ptr _gear {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideGearActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetNumber() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGear() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetNumber(const double number) override; + + OPENSCENARIOLIB_EXP void SetGear(std::shared_ptr gear) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToNumber(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromNumber() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsNumberParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterGear() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetNumber() override; + OPENSCENARIOLIB_EXP virtual bool IsSetNumber() const override; + OPENSCENARIOLIB_EXP virtual void ResetGear() override; + OPENSCENARIOLIB_EXP virtual bool IsSetGear() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideParkingBrakeAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideParkingBrakeAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideParkingBrakeActionImpl: public BaseImpl, public IOverrideParkingBrakeActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetValue = false; + double _value {}; + bool _isSetBrakeInput = false; + std::shared_ptr _brakeInput {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideParkingBrakeActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBrakeInput() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetBrakeInput(std::shared_ptr brakeInput) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBrakeInput() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetValue() override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetBrakeInput() override; + OPENSCENARIOLIB_EXP virtual bool IsSetBrakeInput() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideSteeringWheelAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideSteeringWheelAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideSteeringWheelActionImpl: public BaseImpl, public IOverrideSteeringWheelActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetMaxRate = false; + double _maxRate {}; + bool _isSetMaxTorque = false; + double _maxTorque {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideSteeringWheelActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetMaxRate() const override; + OPENSCENARIOLIB_EXP double GetMaxTorque() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetMaxRate(const double maxRate) override; + + OPENSCENARIOLIB_EXP void SetMaxTorque(const double maxTorque) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxTorque(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxTorque() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxTorqueParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxRate() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxTorque() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxTorque() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IOverrideThrottleAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IOverrideThrottleAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideThrottleActionImpl: public BaseImpl, public IOverrideThrottleActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetActive = false; + bool _active {}; + bool _isSetMaxRate = false; + double _maxRate {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP OverrideThrottleActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetActive() const override; + OPENSCENARIOLIB_EXP double GetMaxRate() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetActive(const bool active) override; + + OPENSCENARIOLIB_EXP void SetMaxRate(const double maxRate) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToActive(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromActive() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsActiveParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetActive() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterActionImpl: public BaseImpl, public IParameterActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterRef = false; + std::shared_ptr> _parameterRef = nullptr; + bool _isSetSetAction = false; + std::shared_ptr _setAction {}; + bool _isSetModifyAction = false; + std::shared_ptr _modifyAction {}; + + public: + + OPENSCENARIOLIB_EXP ParameterActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetParameterRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetModifyAction() const override; + + + OPENSCENARIOLIB_EXP void SetParameterRef(std::shared_ptr> parameterRef) override; + + OPENSCENARIOLIB_EXP void SetSetAction(std::shared_ptr setAction) override; + + OPENSCENARIOLIB_EXP void SetModifyAction(std::shared_ptr modifyAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToParameterRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromParameterRef() const override; + + OPENSCENARIOLIB_EXP bool IsParameterRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterModifyAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSetAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetModifyAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterAddValueRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterAddValueRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAddValueRuleImpl: public BaseImpl, public IParameterAddValueRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ParameterAddValueRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterAssignment. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterAssignment) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAssignmentImpl: public BaseImpl, public IParameterAssignmentWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterRef = false; + std::shared_ptr> _parameterRef = nullptr; + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + + OPENSCENARIOLIB_EXP ParameterAssignmentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetParameterRef() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetParameterRef(std::shared_ptr> parameterRef) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetParameterRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterConditionImpl: public BaseImpl, public IParameterConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterRef = false; + std::shared_ptr> _parameterRef = nullptr; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ParameterConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetParameterRef() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetParameterRef(std::shared_ptr> parameterRef) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToParameterRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromParameterRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsParameterRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetParameterRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterDeclaration. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterDeclaration) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterDeclarationImpl: public BaseImpl, public IParameterDeclarationWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterType = false; + ParameterType _parameterType {}; + bool _isSetValue = false; + std::string _value {}; + bool _isSetConstraintGroups = false; + std::vector> _constraintGroups {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + + OPENSCENARIOLIB_EXP ParameterDeclarationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP ParameterType GetParameterType() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + OPENSCENARIOLIB_EXP std::vector> GetConstraintGroups() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterConstraintGroups() const override; + OPENSCENARIOLIB_EXP int GetConstraintGroupsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetConstraintGroupsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterType(const ParameterType parameterType) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void SetConstraintGroups(std::vector>& constraintGroups) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToParameterType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromParameterType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsParameterTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetConstraintGroups() override; + OPENSCENARIOLIB_EXP virtual bool IsSetConstraintGroups() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterModifyAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterModifyAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterModifyActionImpl: public BaseImpl, public IParameterModifyActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRule = false; + std::shared_ptr _rule {}; + + public: + + OPENSCENARIOLIB_EXP ParameterModifyActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRule() const override; + + + OPENSCENARIOLIB_EXP void SetRule(std::shared_ptr rule) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterMultiplyByValueRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterMultiplyByValueRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterMultiplyByValueRuleImpl: public BaseImpl, public IParameterMultiplyByValueRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ParameterMultiplyByValueRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterSetAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterSetAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterSetActionImpl: public BaseImpl, public IParameterSetActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ParameterSetActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterValueDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterValueDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionImpl: public BaseImpl, public IParameterValueDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetScenarioFile = false; + std::shared_ptr _scenarioFile {}; + bool _isSetDistributionDefinition = false; + std::shared_ptr _distributionDefinition {}; + + public: + + OPENSCENARIOLIB_EXP ParameterValueDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetScenarioFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDistributionDefinition() const override; + + + OPENSCENARIOLIB_EXP void SetScenarioFile(std::shared_ptr scenarioFile) override; + + OPENSCENARIOLIB_EXP void SetDistributionDefinition(std::shared_ptr distributionDefinition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterScenarioFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDistributionDefinition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetScenarioFile() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistributionDefinition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterValueDistributionDefinition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterValueDistributionDefinition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionDefinitionImpl: public BaseImpl, public IParameterValueDistributionDefinitionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterValueDistribution = false; + std::shared_ptr _parameterValueDistribution {}; + + public: + + OPENSCENARIOLIB_EXP ParameterValueDistributionDefinitionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterValueDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetParameterValueDistribution(std::shared_ptr parameterValueDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterParameterValueDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterValueDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IParameterValueSet. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IParameterValueSet) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueSetImpl: public BaseImpl, public IParameterValueSetWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterAssignments = false; + std::vector> _parameterAssignments {}; + + public: + + OPENSCENARIOLIB_EXP ParameterValueSetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetParameterAssignments() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterAssignments() const override; + OPENSCENARIOLIB_EXP int GetParameterAssignmentsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterAssignmentsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetParameterAssignments(std::vector>& parameterAssignments) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetParameterAssignments() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPedestrian. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPedestrian) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianImpl: public BaseImpl, public IPedestrianWriter, public std::enable_shared_from_this + { + private: + bool _isSetMass = false; + double _mass {}; + bool _isSetModel = false; + std::string _model {}; + bool _isSetModel3d = false; + std::string _model3d {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetPedestrianCategory = false; + PedestrianCategory _pedestrianCategory {}; + bool _isSetRole = false; + Role _role {Role::RoleEnum::NONE}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetBoundingBox = false; + std::shared_ptr _boundingBox {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PedestrianImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMass() const override; + OPENSCENARIOLIB_EXP std::string GetModel() const override; + OPENSCENARIOLIB_EXP std::string GetModel3d() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP PedestrianCategory GetPedestrianCategory() const override; + OPENSCENARIOLIB_EXP Role GetRole() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetMass(const double mass) override; + + OPENSCENARIOLIB_EXP void SetModel(const std::string model) override; + + OPENSCENARIOLIB_EXP void SetModel3d(const std::string model3d) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetPedestrianCategory(const PedestrianCategory pedestrianCategory) override; + + OPENSCENARIOLIB_EXP void SetRole(const Role role) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetBoundingBox(std::shared_ptr boundingBox) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMass(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToModel(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToModel3d(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPedestrianCategory(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRole(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMass() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromModel() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromModel3d() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPedestrianCategory() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRole() const override; + + OPENSCENARIOLIB_EXP bool IsMassParameterized() override; + OPENSCENARIOLIB_EXP bool IsModelParameterized() override; + OPENSCENARIOLIB_EXP bool IsModel3dParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsPedestrianCategoryParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoleParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMass() const override; + OPENSCENARIOLIB_EXP virtual void ResetModel() override; + OPENSCENARIOLIB_EXP virtual bool IsSetModel() const override; + OPENSCENARIOLIB_EXP virtual void ResetModel3d() override; + OPENSCENARIOLIB_EXP virtual bool IsSetModel3d() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPedestrianCategory() const override; + OPENSCENARIOLIB_EXP virtual void ResetRole() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRole() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetBoundingBox() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPedestrianAnimation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPedestrianAnimation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianAnimationImpl: public BaseImpl, public IPedestrianAnimationWriter, public std::enable_shared_from_this + { + private: + bool _isSetMotion = false; + PedestrianMotionType _motion {}; + bool _isSetUserDefinedPedestrianAnimation = false; + std::string _userDefinedPedestrianAnimation {}; + bool _isSetGestures = false; + std::vector> _gestures {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP PedestrianAnimationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP PedestrianMotionType GetMotion() const override; + OPENSCENARIOLIB_EXP std::string GetUserDefinedPedestrianAnimation() const override; + OPENSCENARIOLIB_EXP std::vector> GetGestures() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterGestures() const override; + OPENSCENARIOLIB_EXP int GetGesturesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGesturesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetMotion(const PedestrianMotionType motion) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedPedestrianAnimation(const std::string userDefinedPedestrianAnimation) override; + + OPENSCENARIOLIB_EXP void SetGestures(std::vector>& gestures) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMotion(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToUserDefinedPedestrianAnimation(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMotion() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromUserDefinedPedestrianAnimation() const override; + + OPENSCENARIOLIB_EXP bool IsMotionParameterized() override; + OPENSCENARIOLIB_EXP bool IsUserDefinedPedestrianAnimationParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetMotion() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMotion() const override; + OPENSCENARIOLIB_EXP virtual void ResetUserDefinedPedestrianAnimation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedPedestrianAnimation() const override; + OPENSCENARIOLIB_EXP virtual void ResetGestures() override; + OPENSCENARIOLIB_EXP virtual bool IsSetGestures() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPedestrianCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPedestrianCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianCatalogLocationImpl: public BaseImpl, public IPedestrianCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP PedestrianCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPedestrianGesture. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPedestrianGesture) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianGestureImpl: public BaseImpl, public IPedestrianGestureWriter, public std::enable_shared_from_this + { + private: + bool _isSetGesture = false; + PedestrianGestureType _gesture {}; + + public: + + OPENSCENARIOLIB_EXP PedestrianGestureImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP PedestrianGestureType GetGesture() const override; + + + OPENSCENARIOLIB_EXP void SetGesture(const PedestrianGestureType gesture) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToGesture(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromGesture() const override; + + OPENSCENARIOLIB_EXP bool IsGestureParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetGesture() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPerformance. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPerformance) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PerformanceImpl: public BaseImpl, public IPerformanceWriter, public std::enable_shared_from_this + { + private: + bool _isSetMaxAcceleration = false; + double _maxAcceleration {}; + bool _isSetMaxAccelerationRate = false; + double _maxAccelerationRate {}; + bool _isSetMaxDeceleration = false; + double _maxDeceleration {}; + bool _isSetMaxDecelerationRate = false; + double _maxDecelerationRate {}; + bool _isSetMaxSpeed = false; + double _maxSpeed {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PerformanceImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMaxAcceleration() const override; + OPENSCENARIOLIB_EXP double GetMaxAccelerationRate() const override; + OPENSCENARIOLIB_EXP double GetMaxDeceleration() const override; + OPENSCENARIOLIB_EXP double GetMaxDecelerationRate() const override; + OPENSCENARIOLIB_EXP double GetMaxSpeed() const override; + + + OPENSCENARIOLIB_EXP void SetMaxAcceleration(const double maxAcceleration) override; + + OPENSCENARIOLIB_EXP void SetMaxAccelerationRate(const double maxAccelerationRate) override; + + OPENSCENARIOLIB_EXP void SetMaxDeceleration(const double maxDeceleration) override; + + OPENSCENARIOLIB_EXP void SetMaxDecelerationRate(const double maxDecelerationRate) override; + + OPENSCENARIOLIB_EXP void SetMaxSpeed(const double maxSpeed) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxAcceleration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxAccelerationRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxDeceleration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxDecelerationRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToMaxSpeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxAcceleration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxAccelerationRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxDeceleration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxDecelerationRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMaxSpeed() const override; + + OPENSCENARIOLIB_EXP bool IsMaxAccelerationParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxAccelerationRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxDecelerationParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxDecelerationRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsMaxSpeedParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetMaxAcceleration() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxAccelerationRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxAccelerationRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxDeceleration() const override; + OPENSCENARIOLIB_EXP virtual void ResetMaxDecelerationRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxDecelerationRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMaxSpeed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPhase. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPhase) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PhaseImpl: public BaseImpl, public IPhaseWriter, public std::enable_shared_from_this + { + private: + bool _isSetDuration = false; + double _duration {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetTrafficSignalStates = false; + std::vector> _trafficSignalStates {}; + bool _isSetTrafficSignalGroupState = false; + std::shared_ptr _trafficSignalGroupState {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PhaseImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDuration() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetTrafficSignalStates() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterTrafficSignalStates() const override; + OPENSCENARIOLIB_EXP int GetTrafficSignalStatesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalStatesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalGroupState() const override; + + + OPENSCENARIOLIB_EXP void SetDuration(const double duration) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalStates(std::vector>& trafficSignalStates) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalGroupState(std::shared_ptr trafficSignalGroupState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDuration() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsDurationParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalGroupState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDuration() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficSignalStates() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalStates() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficSignalGroupState() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalGroupState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPoissonDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPoissonDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PoissonDistributionImpl: public BaseImpl, public IPoissonDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetExpectedValue = false; + double _expectedValue {}; + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PoissonDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetExpectedValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetExpectedValue(const double expectedValue) override; + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToExpectedValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromExpectedValue() const override; + + OPENSCENARIOLIB_EXP bool IsExpectedValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetExpectedValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetRange() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPolygon. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPolygon) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolygonImpl: public BaseImpl, public IPolygonWriter, public std::enable_shared_from_this + { + private: + bool _isSetPositions = false; + std::vector> _positions {}; + + public: + + OPENSCENARIOLIB_EXP PolygonImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetPositions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPositions() const override; + OPENSCENARIOLIB_EXP int GetPositionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPositionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetPositions(std::vector>& positions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPositions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPolyline. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPolyline) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolylineImpl: public BaseImpl, public IPolylineWriter, public std::enable_shared_from_this + { + private: + bool _isSetVertices = false; + std::vector> _vertices {}; + + public: + + OPENSCENARIOLIB_EXP PolylineImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetVertices() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterVertices() const override; + OPENSCENARIOLIB_EXP int GetVerticesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVerticesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetVertices(std::vector>& vertices) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetVertices() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionImpl: public BaseImpl, public IPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetWorldPosition = false; + std::shared_ptr _worldPosition {}; + bool _isSetRelativeWorldPosition = false; + std::shared_ptr _relativeWorldPosition {}; + bool _isSetRelativeObjectPosition = false; + std::shared_ptr _relativeObjectPosition {}; + bool _isSetRoadPosition = false; + std::shared_ptr _roadPosition {}; + bool _isSetRelativeRoadPosition = false; + std::shared_ptr _relativeRoadPosition {}; + bool _isSetLanePosition = false; + std::shared_ptr _lanePosition {}; + bool _isSetRelativeLanePosition = false; + std::shared_ptr _relativeLanePosition {}; + bool _isSetRoutePosition = false; + std::shared_ptr _routePosition {}; + bool _isSetGeoPosition = false; + std::shared_ptr _geoPosition {}; + bool _isSetTrajectoryPosition = false; + std::shared_ptr _trajectoryPosition {}; + + public: + + OPENSCENARIOLIB_EXP PositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetWorldPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeWorldPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeObjectPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoadPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeRoadPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLanePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeLanePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoutePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetGeoPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoryPosition() const override; + + + OPENSCENARIOLIB_EXP void SetWorldPosition(std::shared_ptr worldPosition) override; + + OPENSCENARIOLIB_EXP void SetRelativeWorldPosition(std::shared_ptr relativeWorldPosition) override; + + OPENSCENARIOLIB_EXP void SetRelativeObjectPosition(std::shared_ptr relativeObjectPosition) override; + + OPENSCENARIOLIB_EXP void SetRoadPosition(std::shared_ptr roadPosition) override; + + OPENSCENARIOLIB_EXP void SetRelativeRoadPosition(std::shared_ptr relativeRoadPosition) override; + + OPENSCENARIOLIB_EXP void SetLanePosition(std::shared_ptr lanePosition) override; + + OPENSCENARIOLIB_EXP void SetRelativeLanePosition(std::shared_ptr relativeLanePosition) override; + + OPENSCENARIOLIB_EXP void SetRoutePosition(std::shared_ptr routePosition) override; + + OPENSCENARIOLIB_EXP void SetGeoPosition(std::shared_ptr geoPosition) override; + + OPENSCENARIOLIB_EXP void SetTrajectoryPosition(std::shared_ptr trajectoryPosition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterWorldPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeWorldPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeObjectPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoadPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeRoadPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLanePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeLanePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoutePosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterGeoPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectoryPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWorldPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeWorldPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeObjectPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeRoadPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLanePosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeLanePosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutePosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetGeoPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectoryPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPositionInLaneCoordinates. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPositionInLaneCoordinates) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInLaneCoordinatesImpl: public BaseImpl, public IPositionInLaneCoordinatesWriter, public std::enable_shared_from_this + { + private: + bool _isSetLaneId = false; + std::string _laneId {}; + bool _isSetLaneOffset = false; + double _laneOffset {0}; + bool _isSetPathS = false; + double _pathS {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PositionInLaneCoordinatesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetLaneId() const override; + OPENSCENARIOLIB_EXP double GetLaneOffset() const override; + OPENSCENARIOLIB_EXP double GetPathS() const override; + + + OPENSCENARIOLIB_EXP void SetLaneId(const std::string laneId) override; + + OPENSCENARIOLIB_EXP void SetLaneOffset(const double laneOffset) override; + + OPENSCENARIOLIB_EXP void SetPathS(const double pathS) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToLaneId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToLaneOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPathS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLaneId() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLaneOffset() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPathS() const override; + + OPENSCENARIOLIB_EXP bool IsLaneIdParameterized() override; + OPENSCENARIOLIB_EXP bool IsLaneOffsetParameterized() override; + OPENSCENARIOLIB_EXP bool IsPathSParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetLaneId() const override; + OPENSCENARIOLIB_EXP virtual void ResetLaneOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLaneOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPathS() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPositionInRoadCoordinates. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPositionInRoadCoordinates) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInRoadCoordinatesImpl: public BaseImpl, public IPositionInRoadCoordinatesWriter, public std::enable_shared_from_this + { + private: + bool _isSetPathS = false; + double _pathS {}; + bool _isSetT = false; + double _t {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PositionInRoadCoordinatesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetPathS() const override; + OPENSCENARIOLIB_EXP double GetT() const override; + + + OPENSCENARIOLIB_EXP void SetPathS(const double pathS) override; + + OPENSCENARIOLIB_EXP void SetT(const double t) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToPathS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToT(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPathS() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromT() const override; + + OPENSCENARIOLIB_EXP bool IsPathSParameterized() override; + OPENSCENARIOLIB_EXP bool IsTParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPathS() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetT() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPositionOfCurrentEntity. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPositionOfCurrentEntity) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionOfCurrentEntityImpl: public BaseImpl, public IPositionOfCurrentEntityWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + + public: + + OPENSCENARIOLIB_EXP PositionOfCurrentEntityImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPrecipitation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPrecipitation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrecipitationImpl: public BaseImpl, public IPrecipitationWriter, public std::enable_shared_from_this + { + private: + bool _isSetIntensity = false; + double _intensity {}; + bool _isSetPrecipitationIntensity = false; + double _precipitationIntensity {}; + bool _isSetPrecipitationType = false; + PrecipitationType _precipitationType {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP PrecipitationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetIntensity() const override; + OPENSCENARIOLIB_EXP double GetPrecipitationIntensity() const override; + OPENSCENARIOLIB_EXP PrecipitationType GetPrecipitationType() const override; + + + OPENSCENARIOLIB_EXP void SetIntensity(const double intensity) override; + + OPENSCENARIOLIB_EXP void SetPrecipitationIntensity(const double precipitationIntensity) override; + + OPENSCENARIOLIB_EXP void SetPrecipitationType(const PrecipitationType precipitationType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToIntensity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPrecipitationIntensity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToPrecipitationType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromIntensity() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPrecipitationIntensity() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPrecipitationType() const override; + + OPENSCENARIOLIB_EXP bool IsIntensityParameterized() override; + OPENSCENARIOLIB_EXP bool IsPrecipitationIntensityParameterized() override; + OPENSCENARIOLIB_EXP bool IsPrecipitationTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetIntensity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetIntensity() const override; + OPENSCENARIOLIB_EXP virtual void ResetPrecipitationIntensity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrecipitationIntensity() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrecipitationType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPrivate. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPrivate) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateImpl: public BaseImpl, public IPrivateWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetPrivateActions = false; + std::vector> _privateActions {}; + + public: + + OPENSCENARIOLIB_EXP PrivateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::vector> GetPrivateActions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPrivateActions() const override; + OPENSCENARIOLIB_EXP int GetPrivateActionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPrivateActionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetPrivateActions(std::vector>& privateActions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrivateActions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IPrivateAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IPrivateAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateActionImpl: public BaseImpl, public IPrivateActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetLongitudinalAction = false; + std::shared_ptr _longitudinalAction {}; + bool _isSetLateralAction = false; + std::shared_ptr _lateralAction {}; + bool _isSetVisibilityAction = false; + std::shared_ptr _visibilityAction {}; + bool _isSetSynchronizeAction = false; + std::shared_ptr _synchronizeAction {}; + bool _isSetActivateControllerAction = false; + std::shared_ptr _activateControllerAction {}; + bool _isSetControllerAction = false; + std::shared_ptr _controllerAction {}; + bool _isSetTeleportAction = false; + std::shared_ptr _teleportAction {}; + bool _isSetRoutingAction = false; + std::shared_ptr _routingAction {}; + bool _isSetAppearanceAction = false; + std::shared_ptr _appearanceAction {}; + bool _isSetTrailerAction = false; + std::shared_ptr _trailerAction {}; + + public: + + OPENSCENARIOLIB_EXP PrivateActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetLongitudinalAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLateralAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVisibilityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSynchronizeAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetActivateControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTeleportAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoutingAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAppearanceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailerAction() const override; + + + OPENSCENARIOLIB_EXP void SetLongitudinalAction(std::shared_ptr longitudinalAction) override; + + OPENSCENARIOLIB_EXP void SetLateralAction(std::shared_ptr lateralAction) override; + + OPENSCENARIOLIB_EXP void SetVisibilityAction(std::shared_ptr visibilityAction) override; + + OPENSCENARIOLIB_EXP void SetSynchronizeAction(std::shared_ptr synchronizeAction) override; + + OPENSCENARIOLIB_EXP void SetActivateControllerAction(std::shared_ptr activateControllerAction) override; + + OPENSCENARIOLIB_EXP void SetControllerAction(std::shared_ptr controllerAction) override; + + OPENSCENARIOLIB_EXP void SetTeleportAction(std::shared_ptr teleportAction) override; + + OPENSCENARIOLIB_EXP void SetRoutingAction(std::shared_ptr routingAction) override; + + OPENSCENARIOLIB_EXP void SetAppearanceAction(std::shared_ptr appearanceAction) override; + + OPENSCENARIOLIB_EXP void SetTrailerAction(std::shared_ptr trailerAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLongitudinalAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLateralAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVisibilityAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSynchronizeAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterActivateControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTeleportAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoutingAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAppearanceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLongitudinalAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLateralAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVisibilityAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSynchronizeAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActivateControllerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTeleportAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutingAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAppearanceAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailerAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IProbabilityDistributionSet. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IProbabilityDistributionSet) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetImpl: public BaseImpl, public IProbabilityDistributionSetWriter, public std::enable_shared_from_this + { + private: + bool _isSetElements = false; + std::vector> _elements {}; + + public: + + OPENSCENARIOLIB_EXP ProbabilityDistributionSetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetElements() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterElements() const override; + OPENSCENARIOLIB_EXP int GetElementsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetElementsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetElements(std::vector>& elements) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetElements() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IProbabilityDistributionSetElement. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IProbabilityDistributionSetElement) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetElementImpl: public BaseImpl, public IProbabilityDistributionSetElementWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + std::string _value {}; + bool _isSetWeight = false; + double _weight {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ProbabilityDistributionSetElementImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetValue() const override; + OPENSCENARIOLIB_EXP double GetWeight() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IProperties. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IProperties) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PropertiesImpl: public BaseImpl, public IPropertiesWriter, public std::enable_shared_from_this + { + private: + bool _isSetProperties = false; + std::vector> _properties {}; + bool _isSetFiles = false; + std::vector> _files {}; + bool _isSetCustomContent = false; + std::vector> _customContent {}; + + public: + + OPENSCENARIOLIB_EXP PropertiesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetProperties() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterProperties() const override; + OPENSCENARIOLIB_EXP int GetPropertiesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPropertiesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetFiles() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterFiles() const override; + OPENSCENARIOLIB_EXP int GetFilesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFilesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetCustomContent() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterCustomContent() const override; + OPENSCENARIOLIB_EXP int GetCustomContentSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCustomContentAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetProperties(std::vector>& properties) override; + + OPENSCENARIOLIB_EXP void SetFiles(std::vector>& files) override; + + OPENSCENARIOLIB_EXP void SetCustomContent(std::vector>& customContent) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + OPENSCENARIOLIB_EXP virtual void ResetFiles() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFiles() const override; + OPENSCENARIOLIB_EXP virtual void ResetCustomContent() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCustomContent() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IProperty. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IProperty) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PropertyImpl: public BaseImpl, public IPropertyWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP PropertyImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRandomRouteAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRandomRouteAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RandomRouteActionImpl: public BaseImpl, public IRandomRouteActionWriter, public std::enable_shared_from_this + { + private: + + public: + + OPENSCENARIOLIB_EXP RandomRouteActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRange. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRange) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RangeImpl: public BaseImpl, public IRangeWriter, public std::enable_shared_from_this + { + private: + bool _isSetLowerLimit = false; + double _lowerLimit {}; + bool _isSetUpperLimit = false; + double _upperLimit {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RangeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetLowerLimit() const override; + OPENSCENARIOLIB_EXP double GetUpperLimit() const override; + + + OPENSCENARIOLIB_EXP void SetLowerLimit(const double lowerLimit) override; + + OPENSCENARIOLIB_EXP void SetUpperLimit(const double upperLimit) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToLowerLimit(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToUpperLimit(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLowerLimit() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromUpperLimit() const override; + + OPENSCENARIOLIB_EXP bool IsLowerLimitParameterized() override; + OPENSCENARIOLIB_EXP bool IsUpperLimitParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetLowerLimit() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUpperLimit() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IReachPositionCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IReachPositionCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ReachPositionConditionImpl: public BaseImpl, public IReachPositionConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTolerance = false; + double _tolerance {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP ReachPositionConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTolerance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetTolerance(const double tolerance) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTolerance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTolerance() const override; + + OPENSCENARIOLIB_EXP bool IsToleranceParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTolerance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeAngleCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeAngleCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeAngleConditionImpl: public BaseImpl, public IRelativeAngleConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAngle = false; + double _angle {}; + bool _isSetAngleTolerance = false; + double _angleTolerance {}; + bool _isSetAngleType = false; + AngleType _angleType {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeAngleConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAngle() const override; + OPENSCENARIOLIB_EXP double GetAngleTolerance() const override; + OPENSCENARIOLIB_EXP AngleType GetAngleType() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + + + OPENSCENARIOLIB_EXP void SetAngle(const double angle) override; + + OPENSCENARIOLIB_EXP void SetAngleTolerance(const double angleTolerance) override; + + OPENSCENARIOLIB_EXP void SetAngleType(const AngleType angleType) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngle(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngleTolerance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToAngleType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngle() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngleTolerance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAngleType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsAngleParameterized() override; + OPENSCENARIOLIB_EXP bool IsAngleToleranceParameterized() override; + OPENSCENARIOLIB_EXP bool IsAngleTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetAngle() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAngleTolerance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAngleType() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeClearanceCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeClearanceCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeClearanceConditionImpl: public BaseImpl, public IRelativeClearanceConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDistanceBackward = false; + double _distanceBackward {0}; + bool _isSetDistanceForward = false; + double _distanceForward {0}; + bool _isSetFreeSpace = false; + bool _freeSpace {}; + bool _isSetOppositeLanes = false; + bool _oppositeLanes {}; + bool _isSetRelativeLaneRange = false; + std::vector> _relativeLaneRange {}; + bool _isSetEntityRef = false; + std::vector> _entityRef {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeClearanceConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDistanceBackward() const override; + OPENSCENARIOLIB_EXP double GetDistanceForward() const override; + OPENSCENARIOLIB_EXP bool GetFreeSpace() const override; + OPENSCENARIOLIB_EXP bool GetOppositeLanes() const override; + OPENSCENARIOLIB_EXP std::vector> GetRelativeLaneRange() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterRelativeLaneRange() const override; + OPENSCENARIOLIB_EXP int GetRelativeLaneRangeSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeLaneRangeAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetEntityRef() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntityRef() const override; + OPENSCENARIOLIB_EXP int GetEntityRefSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRefAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetDistanceBackward(const double distanceBackward) override; + + OPENSCENARIOLIB_EXP void SetDistanceForward(const double distanceForward) override; + + OPENSCENARIOLIB_EXP void SetFreeSpace(const bool freeSpace) override; + + OPENSCENARIOLIB_EXP void SetOppositeLanes(const bool oppositeLanes) override; + + OPENSCENARIOLIB_EXP void SetRelativeLaneRange(std::vector>& relativeLaneRange) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::vector>& entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDistanceBackward(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDistanceForward(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreeSpace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToOppositeLanes(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDistanceBackward() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDistanceForward() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreeSpace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOppositeLanes() const override; + + OPENSCENARIOLIB_EXP bool IsDistanceBackwardParameterized() override; + OPENSCENARIOLIB_EXP bool IsDistanceForwardParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreeSpaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsOppositeLanesParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetDistanceBackward() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistanceBackward() const override; + OPENSCENARIOLIB_EXP virtual void ResetDistanceForward() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDistanceForward() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreeSpace() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOppositeLanes() const override; + OPENSCENARIOLIB_EXP virtual void ResetRelativeLaneRange() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeLaneRange() const override; + OPENSCENARIOLIB_EXP virtual void ResetEntityRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeDistanceCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeDistanceCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeDistanceConditionImpl: public BaseImpl, public IRelativeDistanceConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetRelativeDistanceType = false; + RelativeDistanceType _relativeDistanceType {}; + bool _isSetRoutingAlgorithm = false; + RoutingAlgorithm _routingAlgorithm {RoutingAlgorithm::RoutingAlgorithmEnum::UNDEFINED}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeDistanceConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP RelativeDistanceType GetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP RoutingAlgorithm GetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) override; + + OPENSCENARIOLIB_EXP void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRelativeDistanceType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoutingAlgorithm(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRelativeDistanceType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoutingAlgorithm() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsRelativeDistanceTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoutingAlgorithmParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoutingAlgorithm() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeLanePosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeLanePosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeLanePositionImpl: public BaseImpl, public IRelativeLanePositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDLane = false; + int _dLane {}; + bool _isSetDs = false; + double _ds {}; + bool _isSetDsLane = false; + double _dsLane {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetOffset = false; + double _offset {0}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP RelativeLanePositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP int GetDLane() const override; + OPENSCENARIOLIB_EXP double GetDs() const override; + OPENSCENARIOLIB_EXP double GetDsLane() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP double GetOffset() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetDLane(const int dLane) override; + + OPENSCENARIOLIB_EXP void SetDs(const double ds) override; + + OPENSCENARIOLIB_EXP void SetDsLane(const double dsLane) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetOffset(const double offset) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDLane(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDs(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDsLane(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDLane() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDs() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDsLane() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOffset() const override; + + OPENSCENARIOLIB_EXP bool IsDLaneParameterized() override; + OPENSCENARIOLIB_EXP bool IsDsParameterized() override; + OPENSCENARIOLIB_EXP bool IsDsLaneParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsOffsetParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDLane() const override; + OPENSCENARIOLIB_EXP virtual void ResetDs() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDs() const override; + OPENSCENARIOLIB_EXP virtual void ResetDsLane() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDsLane() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetOffset() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOffset() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeLaneRange. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeLaneRange) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeLaneRangeImpl: public BaseImpl, public IRelativeLaneRangeWriter, public std::enable_shared_from_this + { + private: + bool _isSetFrom = false; + int _from {}; + bool _isSetTo = false; + int _to {}; + + public: + + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP RelativeLaneRangeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP int GetFrom() const override; + OPENSCENARIOLIB_EXP int GetTo() const override; + + + OPENSCENARIOLIB_EXP void SetFrom(const int from) override; + + OPENSCENARIOLIB_EXP void SetTo(const int to) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToFrom(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTo(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFrom() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTo() const override; + + OPENSCENARIOLIB_EXP bool IsFromParameterized() override; + OPENSCENARIOLIB_EXP bool IsToParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetFrom() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFrom() const override; + OPENSCENARIOLIB_EXP virtual void ResetTo() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTo() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeObjectPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeObjectPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeObjectPositionImpl: public BaseImpl, public IRelativeObjectPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDx = false; + double _dx {}; + bool _isSetDy = false; + double _dy {}; + bool _isSetDz = false; + double _dz {0}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeObjectPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDx() const override; + OPENSCENARIOLIB_EXP double GetDy() const override; + OPENSCENARIOLIB_EXP double GetDz() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetDx(const double dx) override; + + OPENSCENARIOLIB_EXP void SetDy(const double dy) override; + + OPENSCENARIOLIB_EXP void SetDz(const double dz) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDx(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDy(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDz(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDx() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDy() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDz() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsDxParameterized() override; + OPENSCENARIOLIB_EXP bool IsDyParameterized() override; + OPENSCENARIOLIB_EXP bool IsDzParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDx() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDy() const override; + OPENSCENARIOLIB_EXP virtual void ResetDz() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDz() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeRoadPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeRoadPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeRoadPositionImpl: public BaseImpl, public IRelativeRoadPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDs = false; + double _ds {}; + bool _isSetDt = false; + double _dt {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeRoadPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDs() const override; + OPENSCENARIOLIB_EXP double GetDt() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetDs(const double ds) override; + + OPENSCENARIOLIB_EXP void SetDt(const double dt) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDs(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDt(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDs() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDt() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsDsParameterized() override; + OPENSCENARIOLIB_EXP bool IsDtParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDs() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDt() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeSpeedCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeSpeedCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedConditionImpl: public BaseImpl, public IRelativeSpeedConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirection = false; + DirectionalDimension _direction {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeSpeedConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DirectionalDimension GetDirection() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetDirection(const DirectionalDimension direction) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDirection(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDirection() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsDirectionParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetDirection() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirection() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeSpeedToMaster. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeSpeedToMaster) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedToMasterImpl: public BaseImpl, public IRelativeSpeedToMasterWriter, public std::enable_shared_from_this + { + private: + bool _isSetSpeedTargetValueType = false; + SpeedTargetValueType _speedTargetValueType {}; + bool _isSetValue = false; + double _value {}; + bool _isSetSteadyState = false; + std::shared_ptr _steadyState {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeSpeedToMasterImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP SpeedTargetValueType GetSpeedTargetValueType() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSteadyState() const override; + + + OPENSCENARIOLIB_EXP void SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetSteadyState(std::shared_ptr steadyState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpeedTargetValueType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpeedTargetValueType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsSpeedTargetValueTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSteadyState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedTargetValueType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual void ResetSteadyState() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSteadyState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeTargetLane. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeTargetLane) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneImpl: public BaseImpl, public IRelativeTargetLaneWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetValue = false; + int _value {}; + + public: + + virtual void ResolveIntExpression(std::string& attributeKey, int& value) override; + OPENSCENARIOLIB_EXP RelativeTargetLaneImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP int GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetValue(const int value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeTargetLaneOffset. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeTargetLaneOffset) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneOffsetImpl: public BaseImpl, public IRelativeTargetLaneOffsetWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeTargetLaneOffsetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeTargetSpeed. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeTargetSpeed) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetSpeedImpl: public BaseImpl, public IRelativeTargetSpeedWriter, public std::enable_shared_from_this + { + private: + bool _isSetContinuous = false; + bool _continuous {}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetSpeedTargetValueType = false; + SpeedTargetValueType _speedTargetValueType {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeTargetSpeedImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetContinuous() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP SpeedTargetValueType GetSpeedTargetValueType() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetContinuous(const bool continuous) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetSpeedTargetValueType(const SpeedTargetValueType speedTargetValueType) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContinuous(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpeedTargetValueType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContinuous() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpeedTargetValueType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsContinuousParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsSpeedTargetValueTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetContinuous() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedTargetValueType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRelativeWorldPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRelativeWorldPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeWorldPositionImpl: public BaseImpl, public IRelativeWorldPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDx = false; + double _dx {}; + bool _isSetDy = false; + double _dy {}; + bool _isSetDz = false; + double _dz {0}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RelativeWorldPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDx() const override; + OPENSCENARIOLIB_EXP double GetDy() const override; + OPENSCENARIOLIB_EXP double GetDz() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetDx(const double dx) override; + + OPENSCENARIOLIB_EXP void SetDy(const double dy) override; + + OPENSCENARIOLIB_EXP void SetDz(const double dz) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDx(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDy(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDz(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDx() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDy() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDz() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP bool IsDxParameterized() override; + OPENSCENARIOLIB_EXP bool IsDyParameterized() override; + OPENSCENARIOLIB_EXP bool IsDzParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDx() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDy() const override; + OPENSCENARIOLIB_EXP virtual void ResetDz() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDz() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoadCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoadCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadConditionImpl: public BaseImpl, public IRoadConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetFrictionScaleFactor = false; + double _frictionScaleFactor {}; + bool _isSetWetness = false; + Wetness _wetness {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RoadConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetFrictionScaleFactor() const override; + OPENSCENARIOLIB_EXP Wetness GetWetness() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetFrictionScaleFactor(const double frictionScaleFactor) override; + + OPENSCENARIOLIB_EXP void SetWetness(const Wetness wetness) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToFrictionScaleFactor(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWetness(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFrictionScaleFactor() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWetness() const override; + + OPENSCENARIOLIB_EXP bool IsFrictionScaleFactorParameterized() override; + OPENSCENARIOLIB_EXP bool IsWetnessParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFrictionScaleFactor() const override; + OPENSCENARIOLIB_EXP virtual void ResetWetness() override; + OPENSCENARIOLIB_EXP virtual bool IsSetWetness() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoadCursor. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoadCursor) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadCursorImpl: public BaseImpl, public IRoadCursorWriter, public std::enable_shared_from_this + { + private: + bool _isSetRoadId = false; + std::string _roadId {}; + bool _isSetS = false; + double _s {}; + bool _isSetLane = false; + std::vector> _lane {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RoadCursorImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetRoadId() const override; + OPENSCENARIOLIB_EXP double GetS() const override; + OPENSCENARIOLIB_EXP std::vector> GetLane() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterLane() const override; + OPENSCENARIOLIB_EXP int GetLaneSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLaneAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetRoadId(const std::string roadId) override; + + OPENSCENARIOLIB_EXP void SetS(const double s) override; + + OPENSCENARIOLIB_EXP void SetLane(std::vector>& lane) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoadId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoadId() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromS() const override; + + OPENSCENARIOLIB_EXP bool IsRoadIdParameterized() override; + OPENSCENARIOLIB_EXP bool IsSParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetRoadId() const override; + OPENSCENARIOLIB_EXP virtual void ResetS() override; + OPENSCENARIOLIB_EXP virtual bool IsSetS() const override; + OPENSCENARIOLIB_EXP virtual void ResetLane() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLane() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoadNetwork. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoadNetwork) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadNetworkImpl: public BaseImpl, public IRoadNetworkWriter, public std::enable_shared_from_this + { + private: + bool _isSetLogicFile = false; + std::shared_ptr _logicFile {}; + bool _isSetSceneGraphFile = false; + std::shared_ptr _sceneGraphFile {}; + bool _isSetTrafficSignals = false; + std::vector> _trafficSignals {}; + bool _isSetUsedArea = false; + std::shared_ptr _usedArea {}; + + public: + + OPENSCENARIOLIB_EXP RoadNetworkImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetLogicFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSceneGraphFile() const override; + OPENSCENARIOLIB_EXP std::vector> GetTrafficSignals() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterTrafficSignals() const override; + OPENSCENARIOLIB_EXP int GetTrafficSignalsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUsedArea() const override; + + + OPENSCENARIOLIB_EXP void SetLogicFile(std::shared_ptr logicFile) override; + + OPENSCENARIOLIB_EXP void SetSceneGraphFile(std::shared_ptr sceneGraphFile) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignals(std::vector>& trafficSignals) override; + + OPENSCENARIOLIB_EXP void SetUsedArea(std::shared_ptr usedArea) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLogicFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSceneGraphFile() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUsedArea() const override; + OPENSCENARIOLIB_EXP virtual void ResetLogicFile() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLogicFile() const override; + OPENSCENARIOLIB_EXP virtual void ResetSceneGraphFile() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSceneGraphFile() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficSignals() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignals() const override; + OPENSCENARIOLIB_EXP virtual void ResetUsedArea() override; + OPENSCENARIOLIB_EXP virtual bool IsSetUsedArea() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoadPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoadPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadPositionImpl: public BaseImpl, public IRoadPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRoadId = false; + std::string _roadId {}; + bool _isSetS = false; + double _s {}; + bool _isSetT = false; + double _t {}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RoadPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetRoadId() const override; + OPENSCENARIOLIB_EXP double GetS() const override; + OPENSCENARIOLIB_EXP double GetT() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + + + OPENSCENARIOLIB_EXP void SetRoadId(const std::string roadId) override; + + OPENSCENARIOLIB_EXP void SetS(const double s) override; + + OPENSCENARIOLIB_EXP void SetT(const double t) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoadId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToT(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoadId() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromS() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromT() const override; + + OPENSCENARIOLIB_EXP bool IsRoadIdParameterized() override; + OPENSCENARIOLIB_EXP bool IsSParameterized() override; + OPENSCENARIOLIB_EXP bool IsTParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadId() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetS() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetT() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoadRange. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoadRange) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadRangeImpl: public BaseImpl, public IRoadRangeWriter, public std::enable_shared_from_this + { + private: + bool _isSetLength = false; + double _length {}; + bool _isSetRoadCursor = false; + std::vector> _roadCursor {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP RoadRangeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetLength() const override; + OPENSCENARIOLIB_EXP std::vector> GetRoadCursor() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterRoadCursor() const override; + OPENSCENARIOLIB_EXP int GetRoadCursorSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoadCursorAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetLength(const double length) override; + + OPENSCENARIOLIB_EXP void SetRoadCursor(std::vector>& roadCursor) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToLength(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromLength() const override; + + OPENSCENARIOLIB_EXP bool IsLengthParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetLength() override; + OPENSCENARIOLIB_EXP virtual bool IsSetLength() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadCursor() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoute. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoute) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteImpl: public BaseImpl, public IRouteWriter, public std::enable_shared_from_this + { + private: + bool _isSetClosed = false; + bool _closed {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetWaypoints = false; + std::vector> _waypoints {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP RouteImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetClosed() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetWaypoints() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterWaypoints() const override; + OPENSCENARIOLIB_EXP int GetWaypointsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWaypointsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetClosed(const bool closed) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetWaypoints(std::vector>& waypoints) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToClosed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromClosed() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsClosedParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetClosed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWaypoints() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRouteCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRouteCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteCatalogLocationImpl: public BaseImpl, public IRouteCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP RouteCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoutePosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoutePosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutePositionImpl: public BaseImpl, public IRoutePositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRouteRef = false; + std::shared_ptr _routeRef {}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + bool _isSetInRoutePosition = false; + std::shared_ptr _inRoutePosition {}; + + public: + + OPENSCENARIOLIB_EXP RoutePositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRouteRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetInRoutePosition() const override; + + + OPENSCENARIOLIB_EXP void SetRouteRef(std::shared_ptr routeRef) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void SetInRoutePosition(std::shared_ptr inRoutePosition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRouteRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterInRoutePosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRouteRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetInRoutePosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRouteRef. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRouteRef) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteRefImpl: public BaseImpl, public IRouteRefWriter, public std::enable_shared_from_this + { + private: + bool _isSetRoute = false; + std::shared_ptr _route {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + + public: + + OPENSCENARIOLIB_EXP RouteRefImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRoute() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + + + OPENSCENARIOLIB_EXP void SetRoute(std::shared_ptr route) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoute() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoute() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IRoutingAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IRoutingAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutingActionImpl: public BaseImpl, public IRoutingActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAssignRouteAction = false; + std::shared_ptr _assignRouteAction {}; + bool _isSetFollowTrajectoryAction = false; + std::shared_ptr _followTrajectoryAction {}; + bool _isSetAcquirePositionAction = false; + std::shared_ptr _acquirePositionAction {}; + bool _isSetRandomRouteAction = false; + std::shared_ptr _randomRouteAction {}; + + public: + + OPENSCENARIOLIB_EXP RoutingActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetAssignRouteAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFollowTrajectoryAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAcquirePositionAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRandomRouteAction() const override; + + + OPENSCENARIOLIB_EXP void SetAssignRouteAction(std::shared_ptr assignRouteAction) override; + + OPENSCENARIOLIB_EXP void SetFollowTrajectoryAction(std::shared_ptr followTrajectoryAction) override; + + OPENSCENARIOLIB_EXP void SetAcquirePositionAction(std::shared_ptr acquirePositionAction) override; + + OPENSCENARIOLIB_EXP void SetRandomRouteAction(std::shared_ptr randomRouteAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAssignRouteAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFollowTrajectoryAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAcquirePositionAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRandomRouteAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAssignRouteAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFollowTrajectoryAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAcquirePositionAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRandomRouteAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IScenarioDefinition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IScenarioDefinition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioDefinitionImpl: public BaseImpl, public IScenarioDefinitionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetVariableDeclarations = false; + std::vector> _variableDeclarations {}; + bool _isSetMonitorDeclarations = false; + std::vector> _monitorDeclarations {}; + bool _isSetCatalogLocations = false; + std::shared_ptr _catalogLocations {}; + bool _isSetRoadNetwork = false; + std::shared_ptr _roadNetwork {}; + bool _isSetEntities = false; + std::shared_ptr _entities {}; + bool _isSetStoryboard = false; + std::shared_ptr _storyboard {}; + + public: + + OPENSCENARIOLIB_EXP ScenarioDefinitionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetVariableDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterVariableDeclarations() const override; + OPENSCENARIOLIB_EXP int GetVariableDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVariableDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetMonitorDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterMonitorDeclarations() const override; + OPENSCENARIOLIB_EXP int GetMonitorDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMonitorDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogLocations() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoadNetwork() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntities() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStoryboard() const override; + + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetVariableDeclarations(std::vector>& variableDeclarations) override; + + OPENSCENARIOLIB_EXP void SetMonitorDeclarations(std::vector>& monitorDeclarations) override; + + OPENSCENARIOLIB_EXP void SetCatalogLocations(std::shared_ptr catalogLocations) override; + + OPENSCENARIOLIB_EXP void SetRoadNetwork(std::shared_ptr roadNetwork) override; + + OPENSCENARIOLIB_EXP void SetEntities(std::shared_ptr entities) override; + + OPENSCENARIOLIB_EXP void SetStoryboard(std::shared_ptr storyboard) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogLocations() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRoadNetwork() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntities() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStoryboard() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual void ResetVariableDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableDeclarations() const override; + OPENSCENARIOLIB_EXP virtual void ResetMonitorDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMonitorDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogLocations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadNetwork() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntities() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStoryboard() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IScenarioObject. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IScenarioObject) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectImpl: public BaseImpl, public IScenarioObjectWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetEntityObject = false; + std::shared_ptr _entityObject {}; + bool _isSetObjectController = false; + std::vector> _objectController {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP ScenarioObjectImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityObject() const override; + OPENSCENARIOLIB_EXP std::vector> GetObjectController() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterObjectController() const override; + OPENSCENARIOLIB_EXP int GetObjectControllerSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetObjectControllerAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetEntityObject(std::shared_ptr entityObject) override; + + OPENSCENARIOLIB_EXP void SetObjectController(std::vector>& objectController) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityObject() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityObject() const override; + OPENSCENARIOLIB_EXP virtual void ResetObjectController() override; + OPENSCENARIOLIB_EXP virtual bool IsSetObjectController() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IScenarioObjectTemplate. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IScenarioObjectTemplate) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectTemplateImpl: public BaseImpl, public IScenarioObjectTemplateWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntitiyObject = false; + std::shared_ptr _entitiyObject {}; + bool _isSetObjectController = false; + std::vector> _objectController {}; + + public: + + OPENSCENARIOLIB_EXP ScenarioObjectTemplateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetEntitiyObject() const override; + OPENSCENARIOLIB_EXP std::vector> GetObjectController() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterObjectController() const override; + OPENSCENARIOLIB_EXP int GetObjectControllerSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetObjectControllerAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetEntitiyObject(std::shared_ptr entitiyObject) override; + + OPENSCENARIOLIB_EXP void SetObjectController(std::vector>& objectController) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntitiyObject() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntitiyObject() const override; + OPENSCENARIOLIB_EXP virtual void ResetObjectController() override; + OPENSCENARIOLIB_EXP virtual bool IsSetObjectController() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISelectedEntities. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISelectedEntities) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SelectedEntitiesImpl: public BaseImpl, public ISelectedEntitiesWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::vector> _entityRef {}; + bool _isSetByType = false; + std::vector> _byType {}; + + public: + + OPENSCENARIOLIB_EXP SelectedEntitiesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetEntityRef() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntityRef() const override; + OPENSCENARIOLIB_EXP int GetEntityRefSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRefAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetByType() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterByType() const override; + OPENSCENARIOLIB_EXP int GetByTypeSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetByTypeAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::vector>& entityRef) override; + + OPENSCENARIOLIB_EXP void SetByType(std::vector>& byType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetByType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISensorReference. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISensorReference) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceImpl: public BaseImpl, public ISensorReferenceWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP SensorReferenceImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISensorReferenceSet. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISensorReferenceSet) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceSetImpl: public BaseImpl, public ISensorReferenceSetWriter, public std::enable_shared_from_this + { + private: + bool _isSetSensorReferences = false; + std::vector> _sensorReferences {}; + + public: + + OPENSCENARIOLIB_EXP SensorReferenceSetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetSensorReferences() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterSensorReferences() const override; + OPENSCENARIOLIB_EXP int GetSensorReferencesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSensorReferencesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetSensorReferences(std::vector>& sensorReferences) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetSensorReferences() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISetMonitorAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISetMonitorAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SetMonitorActionImpl: public BaseImpl, public ISetMonitorActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetMonitorRef = false; + std::shared_ptr> _monitorRef = nullptr; + bool _isSetValue = false; + bool _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP SetMonitorActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetMonitorRef() const override; + OPENSCENARIOLIB_EXP bool GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetMonitorRef(std::shared_ptr> monitorRef) override; + + OPENSCENARIOLIB_EXP void SetValue(const bool value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMonitorRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMonitorRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsMonitorRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetMonitorRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IShape. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IShape) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ShapeImpl: public BaseImpl, public IShapeWriter, public std::enable_shared_from_this + { + private: + bool _isSetPolyline = false; + std::shared_ptr _polyline {}; + bool _isSetClothoid = false; + std::shared_ptr _clothoid {}; + bool _isSetClothoidSpline = false; + std::shared_ptr _clothoidSpline {}; + bool _isSetNurbs = false; + std::shared_ptr _nurbs {}; + + public: + + OPENSCENARIOLIB_EXP ShapeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPolyline() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetClothoid() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetClothoidSpline() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetNurbs() const override; + + + OPENSCENARIOLIB_EXP void SetPolyline(std::shared_ptr polyline) override; + + OPENSCENARIOLIB_EXP void SetClothoid(std::shared_ptr clothoid) override; + + OPENSCENARIOLIB_EXP void SetClothoidSpline(std::shared_ptr clothoidSpline) override; + + OPENSCENARIOLIB_EXP void SetNurbs(std::shared_ptr nurbs) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPolyline() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterClothoid() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterClothoidSpline() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterNurbs() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPolyline() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetClothoid() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetClothoidSpline() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetNurbs() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISimulationTimeCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISimulationTimeCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SimulationTimeConditionImpl: public BaseImpl, public ISimulationTimeConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP SimulationTimeConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISpeedAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISpeedAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionImpl: public BaseImpl, public ISpeedActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetSpeedActionDynamics = false; + std::shared_ptr _speedActionDynamics {}; + bool _isSetSpeedActionTarget = false; + std::shared_ptr _speedActionTarget {}; + + public: + + OPENSCENARIOLIB_EXP SpeedActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedActionTarget() const override; + + + OPENSCENARIOLIB_EXP void SetSpeedActionDynamics(std::shared_ptr speedActionDynamics) override; + + OPENSCENARIOLIB_EXP void SetSpeedActionTarget(std::shared_ptr speedActionTarget) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSpeedActionDynamics() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSpeedActionTarget() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedActionDynamics() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedActionTarget() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISpeedActionTarget. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISpeedActionTarget) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionTargetImpl: public BaseImpl, public ISpeedActionTargetWriter, public std::enable_shared_from_this + { + private: + bool _isSetRelativeTargetSpeed = false; + std::shared_ptr _relativeTargetSpeed {}; + bool _isSetAbsoluteTargetSpeed = false; + std::shared_ptr _absoluteTargetSpeed {}; + + public: + + OPENSCENARIOLIB_EXP SpeedActionTargetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRelativeTargetSpeed() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAbsoluteTargetSpeed() const override; + + + OPENSCENARIOLIB_EXP void SetRelativeTargetSpeed(std::shared_ptr relativeTargetSpeed) override; + + OPENSCENARIOLIB_EXP void SetAbsoluteTargetSpeed(std::shared_ptr absoluteTargetSpeed) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRelativeTargetSpeed() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAbsoluteTargetSpeed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeTargetSpeed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAbsoluteTargetSpeed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISpeedCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISpeedCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedConditionImpl: public BaseImpl, public ISpeedConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirection = false; + DirectionalDimension _direction {}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP SpeedConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DirectionalDimension GetDirection() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetDirection(const DirectionalDimension direction) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDirection(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDirection() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsDirectionParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetDirection() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirection() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISpeedProfileAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISpeedProfileAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileActionImpl: public BaseImpl, public ISpeedProfileActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetFollowingMode = false; + FollowingMode _followingMode {}; + bool _isSetDynamicConstraints = false; + std::shared_ptr _dynamicConstraints {}; + bool _isSetSpeedProfileEntry = false; + std::vector> _speedProfileEntry {}; + + public: + + OPENSCENARIOLIB_EXP SpeedProfileActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP FollowingMode GetFollowingMode() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDynamicConstraints() const override; + OPENSCENARIOLIB_EXP std::vector> GetSpeedProfileEntry() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterSpeedProfileEntry() const override; + OPENSCENARIOLIB_EXP int GetSpeedProfileEntrySize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSpeedProfileEntryAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetFollowingMode(const FollowingMode followingMode) override; + + OPENSCENARIOLIB_EXP void SetDynamicConstraints(std::shared_ptr dynamicConstraints) override; + + OPENSCENARIOLIB_EXP void SetSpeedProfileEntry(std::vector>& speedProfileEntry) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFollowingMode(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFollowingMode() const override; + + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsFollowingModeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDynamicConstraints() const override; + OPENSCENARIOLIB_EXP virtual void ResetEntityRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFollowingMode() const override; + OPENSCENARIOLIB_EXP virtual void ResetDynamicConstraints() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicConstraints() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeedProfileEntry() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISpeedProfileEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISpeedProfileEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileEntryImpl: public BaseImpl, public ISpeedProfileEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetSpeed = false; + double _speed {}; + bool _isSetTime = false; + double _time {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP SpeedProfileEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetSpeed() const override; + OPENSCENARIOLIB_EXP double GetTime() const override; + + + OPENSCENARIOLIB_EXP void SetSpeed(const double speed) override; + + OPENSCENARIOLIB_EXP void SetTime(const double time) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpeed() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTime() const override; + + OPENSCENARIOLIB_EXP bool IsSpeedParameterized() override; + OPENSCENARIOLIB_EXP bool IsTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetSpeed() const override; + OPENSCENARIOLIB_EXP virtual void ResetTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTime() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStandStillCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStandStillCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StandStillConditionImpl: public BaseImpl, public IStandStillConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDuration = false; + double _duration {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP StandStillConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDuration() const override; + + + OPENSCENARIOLIB_EXP void SetDuration(const double duration) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDuration(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDuration() const override; + + OPENSCENARIOLIB_EXP bool IsDurationParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDuration() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISteadyState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISteadyState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SteadyStateImpl: public BaseImpl, public ISteadyStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetTargetDistanceSteadyState = false; + std::shared_ptr _targetDistanceSteadyState {}; + bool _isSetTargetTimeSteadyState = false; + std::shared_ptr _targetTimeSteadyState {}; + + public: + + OPENSCENARIOLIB_EXP SteadyStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTargetDistanceSteadyState() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTargetTimeSteadyState() const override; + + + OPENSCENARIOLIB_EXP void SetTargetDistanceSteadyState(std::shared_ptr targetDistanceSteadyState) override; + + OPENSCENARIOLIB_EXP void SetTargetTimeSteadyState(std::shared_ptr targetTimeSteadyState) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTargetDistanceSteadyState() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTargetTimeSteadyState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetDistanceSteadyState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetTimeSteadyState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStochastic. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStochastic) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticImpl: public BaseImpl, public IStochasticWriter, public std::enable_shared_from_this + { + private: + bool _isSetNumberOfTestRuns = false; + uint32_t _numberOfTestRuns {}; + bool _isSetRandomSeed = false; + double _randomSeed {}; + bool _isSetStochasticDistributions = false; + std::vector> _stochasticDistributions {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP StochasticImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP uint32_t GetNumberOfTestRuns() const override; + OPENSCENARIOLIB_EXP double GetRandomSeed() const override; + OPENSCENARIOLIB_EXP std::vector> GetStochasticDistributions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterStochasticDistributions() const override; + OPENSCENARIOLIB_EXP int GetStochasticDistributionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStochasticDistributionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetNumberOfTestRuns(const uint32_t numberOfTestRuns) override; + + OPENSCENARIOLIB_EXP void SetRandomSeed(const double randomSeed) override; + + OPENSCENARIOLIB_EXP void SetStochasticDistributions(std::vector>& stochasticDistributions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToNumberOfTestRuns(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRandomSeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromNumberOfTestRuns() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRandomSeed() const override; + + OPENSCENARIOLIB_EXP bool IsNumberOfTestRunsParameterized() override; + OPENSCENARIOLIB_EXP bool IsRandomSeedParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetNumberOfTestRuns() const override; + OPENSCENARIOLIB_EXP virtual void ResetRandomSeed() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRandomSeed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStochasticDistributions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStochasticDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStochasticDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionImpl: public BaseImpl, public IStochasticDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterName = false; + std::string _parameterName {}; + bool _isSetStochasticDistributionType = false; + std::shared_ptr _stochasticDistributionType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP StochasticDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetParameterName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStochasticDistributionType() const override; + + + OPENSCENARIOLIB_EXP void SetParameterName(const std::string parameterName) override; + + OPENSCENARIOLIB_EXP void SetStochasticDistributionType(std::shared_ptr stochasticDistributionType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToParameterName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromParameterName() const override; + + OPENSCENARIOLIB_EXP bool IsParameterNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStochasticDistributionType() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStochasticDistributionType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStochasticDistributionType. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStochasticDistributionType) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionTypeImpl: public BaseImpl, public IStochasticDistributionTypeWriter, public std::enable_shared_from_this + { + private: + bool _isSetProbabilityDistributionSet = false; + std::shared_ptr _probabilityDistributionSet {}; + bool _isSetNormalDistribution = false; + std::shared_ptr _normalDistribution {}; + bool _isSetLogNormalDistribution = false; + std::shared_ptr _logNormalDistribution {}; + bool _isSetUniformDistribution = false; + std::shared_ptr _uniformDistribution {}; + bool _isSetPoissonDistribution = false; + std::shared_ptr _poissonDistribution {}; + bool _isSetHistogram = false; + std::shared_ptr _histogram {}; + bool _isSetUserDefinedDistribution = false; + std::shared_ptr _userDefinedDistribution {}; + + public: + + OPENSCENARIOLIB_EXP StochasticDistributionTypeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetProbabilityDistributionSet() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetNormalDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetLogNormalDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUniformDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPoissonDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetHistogram() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetUserDefinedDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetProbabilityDistributionSet(std::shared_ptr probabilityDistributionSet) override; + + OPENSCENARIOLIB_EXP void SetNormalDistribution(std::shared_ptr normalDistribution) override; + + OPENSCENARIOLIB_EXP void SetLogNormalDistribution(std::shared_ptr logNormalDistribution) override; + + OPENSCENARIOLIB_EXP void SetUniformDistribution(std::shared_ptr uniformDistribution) override; + + OPENSCENARIOLIB_EXP void SetPoissonDistribution(std::shared_ptr poissonDistribution) override; + + OPENSCENARIOLIB_EXP void SetHistogram(std::shared_ptr histogram) override; + + OPENSCENARIOLIB_EXP void SetUserDefinedDistribution(std::shared_ptr userDefinedDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProbabilityDistributionSet() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterNormalDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterLogNormalDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUniformDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPoissonDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterHistogram() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterUserDefinedDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetProbabilityDistributionSet() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetNormalDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetLogNormalDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUniformDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPoissonDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetHistogram() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStory. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStory) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryImpl: public BaseImpl, public IStoryWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetActs = false; + std::vector> _acts {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP StoryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::vector> GetActs() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterActs() const override; + OPENSCENARIOLIB_EXP int GetActsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetActsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetActs(std::vector>& acts) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetActs() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStoryboard. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStoryboard) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardImpl: public BaseImpl, public IStoryboardWriter, public std::enable_shared_from_this + { + private: + bool _isSetInit = false; + std::shared_ptr _init {}; + bool _isSetStories = false; + std::vector> _stories {}; + bool _isSetStopTrigger = false; + std::shared_ptr _stopTrigger {}; + + public: + + OPENSCENARIOLIB_EXP StoryboardImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetInit() const override; + OPENSCENARIOLIB_EXP std::vector> GetStories() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterStories() const override; + OPENSCENARIOLIB_EXP int GetStoriesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStoriesAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetStopTrigger() const override; + + + OPENSCENARIOLIB_EXP void SetInit(std::shared_ptr init) override; + + OPENSCENARIOLIB_EXP void SetStories(std::vector>& stories) override; + + OPENSCENARIOLIB_EXP void SetStopTrigger(std::shared_ptr stopTrigger) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterInit() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterStopTrigger() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetInit() const override; + OPENSCENARIOLIB_EXP virtual void ResetStories() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStories() const override; + OPENSCENARIOLIB_EXP virtual void ResetStopTrigger() override; + OPENSCENARIOLIB_EXP virtual bool IsSetStopTrigger() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IStoryboardElementStateCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IStoryboardElementStateCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardElementStateConditionImpl: public BaseImpl, public IStoryboardElementStateConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetState = false; + StoryboardElementState _state {}; + bool _isSetStoryboardElementRef = false; + std::shared_ptr> _storyboardElementRef = nullptr; + bool _isSetStoryboardElementType = false; + StoryboardElementType _storyboardElementType {}; + + public: + + OPENSCENARIOLIB_EXP StoryboardElementStateConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP StoryboardElementState GetState() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetStoryboardElementRef() const override; + OPENSCENARIOLIB_EXP StoryboardElementType GetStoryboardElementType() const override; + + + OPENSCENARIOLIB_EXP void SetState(const StoryboardElementState state) override; + + OPENSCENARIOLIB_EXP void SetStoryboardElementRef(std::shared_ptr> storyboardElementRef) override; + + OPENSCENARIOLIB_EXP void SetStoryboardElementType(const StoryboardElementType storyboardElementType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToStoryboardElementRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToStoryboardElementType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromStoryboardElementRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromStoryboardElementType() const override; + + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + OPENSCENARIOLIB_EXP bool IsStoryboardElementRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsStoryboardElementTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStoryboardElementRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetStoryboardElementType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISun. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISun) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SunImpl: public BaseImpl, public ISunWriter, public std::enable_shared_from_this + { + private: + bool _isSetAzimuth = false; + double _azimuth {}; + bool _isSetElevation = false; + double _elevation {}; + bool _isSetIlluminance = false; + double _illuminance {0}; + bool _isSetIntensity = false; + double _intensity {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP SunImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAzimuth() const override; + OPENSCENARIOLIB_EXP double GetElevation() const override; + OPENSCENARIOLIB_EXP double GetIlluminance() const override; + OPENSCENARIOLIB_EXP double GetIntensity() const override; + + + OPENSCENARIOLIB_EXP void SetAzimuth(const double azimuth) override; + + OPENSCENARIOLIB_EXP void SetElevation(const double elevation) override; + + OPENSCENARIOLIB_EXP void SetIlluminance(const double illuminance) override; + + OPENSCENARIOLIB_EXP void SetIntensity(const double intensity) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAzimuth(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToElevation(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToIlluminance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToIntensity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAzimuth() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromElevation() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromIlluminance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromIntensity() const override; + + OPENSCENARIOLIB_EXP bool IsAzimuthParameterized() override; + OPENSCENARIOLIB_EXP bool IsElevationParameterized() override; + OPENSCENARIOLIB_EXP bool IsIlluminanceParameterized() override; + OPENSCENARIOLIB_EXP bool IsIntensityParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetAzimuth() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetElevation() const override; + OPENSCENARIOLIB_EXP virtual void ResetIlluminance() override; + OPENSCENARIOLIB_EXP virtual bool IsSetIlluminance() const override; + OPENSCENARIOLIB_EXP virtual void ResetIntensity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetIntensity() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ISynchronizeAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ISynchronizeAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SynchronizeActionImpl: public BaseImpl, public ISynchronizeActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetMasterEntityRef = false; + std::shared_ptr> _masterEntityRef = nullptr; + bool _isSetTargetTolerance = false; + double _targetTolerance {}; + bool _isSetTargetToleranceMaster = false; + double _targetToleranceMaster {}; + bool _isSetTargetPositionMaster = false; + std::shared_ptr _targetPositionMaster {}; + bool _isSetTargetPosition = false; + std::shared_ptr _targetPosition {}; + bool _isSetFinalSpeed = false; + std::shared_ptr _finalSpeed {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP SynchronizeActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetMasterEntityRef() const override; + OPENSCENARIOLIB_EXP double GetTargetTolerance() const override; + OPENSCENARIOLIB_EXP double GetTargetToleranceMaster() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTargetPositionMaster() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTargetPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFinalSpeed() const override; + + + OPENSCENARIOLIB_EXP void SetMasterEntityRef(std::shared_ptr> masterEntityRef) override; + + OPENSCENARIOLIB_EXP void SetTargetTolerance(const double targetTolerance) override; + + OPENSCENARIOLIB_EXP void SetTargetToleranceMaster(const double targetToleranceMaster) override; + + OPENSCENARIOLIB_EXP void SetTargetPositionMaster(std::shared_ptr targetPositionMaster) override; + + OPENSCENARIOLIB_EXP void SetTargetPosition(std::shared_ptr targetPosition) override; + + OPENSCENARIOLIB_EXP void SetFinalSpeed(std::shared_ptr finalSpeed) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMasterEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTargetTolerance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTargetToleranceMaster(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMasterEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTargetTolerance() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTargetToleranceMaster() const override; + + OPENSCENARIOLIB_EXP bool IsMasterEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsTargetToleranceParameterized() override; + OPENSCENARIOLIB_EXP bool IsTargetToleranceMasterParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTargetPositionMaster() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTargetPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFinalSpeed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMasterEntityRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetTargetTolerance() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetTolerance() const override; + OPENSCENARIOLIB_EXP virtual void ResetTargetToleranceMaster() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetToleranceMaster() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetPositionMaster() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTargetPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetFinalSpeed() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFinalSpeed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITargetDistanceSteadyState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITargetDistanceSteadyState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetDistanceSteadyStateImpl: public BaseImpl, public ITargetDistanceSteadyStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetDistance = false; + double _distance {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TargetDistanceSteadyStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDistance() const override; + + + OPENSCENARIOLIB_EXP void SetDistance(const double distance) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDistance(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDistance() const override; + + OPENSCENARIOLIB_EXP bool IsDistanceParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDistance() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITargetTimeSteadyState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITargetTimeSteadyState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetTimeSteadyStateImpl: public BaseImpl, public ITargetTimeSteadyStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetTime = false; + double _time {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TargetTimeSteadyStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTime() const override; + + + OPENSCENARIOLIB_EXP void SetTime(const double time) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTime() const override; + + OPENSCENARIOLIB_EXP bool IsTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetTime() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITeleportAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITeleportAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TeleportActionImpl: public BaseImpl, public ITeleportActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + OPENSCENARIOLIB_EXP TeleportActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeHeadwayCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeHeadwayCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeHeadwayConditionImpl: public BaseImpl, public ITimeHeadwayConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAlongRoute = false; + bool _alongRoute {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetEntityRef = false; + std::shared_ptr> _entityRef = nullptr; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetRelativeDistanceType = false; + RelativeDistanceType _relativeDistanceType {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + bool _isSetRoutingAlgorithm = false; + RoutingAlgorithm _routingAlgorithm {}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TimeHeadwayConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetAlongRoute() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetEntityRef() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP RelativeDistanceType GetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP RoutingAlgorithm GetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetAlongRoute(const bool alongRoute) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr> entityRef) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) override; + + OPENSCENARIOLIB_EXP void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAlongRoute(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToEntityRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRelativeDistanceType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoutingAlgorithm(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAlongRoute() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromEntityRef() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRelativeDistanceType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoutingAlgorithm() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsAlongRouteParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsEntityRefParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsRelativeDistanceTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoutingAlgorithmParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetAlongRoute() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAlongRoute() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual void ResetRelativeDistanceType() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoutingAlgorithm() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeOfDay. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeOfDay) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayImpl: public BaseImpl, public ITimeOfDayWriter, public std::enable_shared_from_this + { + private: + bool _isSetAnimation = false; + bool _animation {}; + bool _isSetDateTime = false; + DateTime _dateTime {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) override; + OPENSCENARIOLIB_EXP TimeOfDayImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetAnimation() const override; + OPENSCENARIOLIB_EXP DateTime GetDateTime() const override; + + + OPENSCENARIOLIB_EXP void SetAnimation(const bool animation) override; + + OPENSCENARIOLIB_EXP void SetDateTime(const DateTime dateTime) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAnimation(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDateTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAnimation() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDateTime() const override; + + OPENSCENARIOLIB_EXP bool IsAnimationParameterized() override; + OPENSCENARIOLIB_EXP bool IsDateTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetAnimation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDateTime() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeOfDayCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeOfDayCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayConditionImpl: public BaseImpl, public ITimeOfDayConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetDateTime = false; + DateTime _dateTime {}; + bool _isSetRule = false; + Rule _rule {}; + + public: + + virtual void ResolveDateTimeExpression(std::string& attributeKey, DateTime& value) override; + OPENSCENARIOLIB_EXP TimeOfDayConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DateTime GetDateTime() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + + + OPENSCENARIOLIB_EXP void SetDateTime(const DateTime dateTime) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDateTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDateTime() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP bool IsDateTimeParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDateTime() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeReference. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeReference) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeReferenceImpl: public BaseImpl, public ITimeReferenceWriter, public std::enable_shared_from_this + { + private: + bool _isSetNone = false; + std::shared_ptr _none {}; + bool _isSetTiming = false; + std::shared_ptr _timing {}; + + public: + + OPENSCENARIOLIB_EXP TimeReferenceImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetNone() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTiming() const override; + + + OPENSCENARIOLIB_EXP void SetNone(std::shared_ptr none) override; + + OPENSCENARIOLIB_EXP void SetTiming(std::shared_ptr timing) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterNone() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTiming() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetNone() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTiming() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeToCollisionCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeToCollisionCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionImpl: public BaseImpl, public ITimeToCollisionConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetAlongRoute = false; + bool _alongRoute {}; + bool _isSetCoordinateSystem = false; + CoordinateSystem _coordinateSystem {CoordinateSystem::CoordinateSystemEnum::ENTITY}; + bool _isSetFreespace = false; + bool _freespace {}; + bool _isSetRelativeDistanceType = false; + RelativeDistanceType _relativeDistanceType {RelativeDistanceType::RelativeDistanceTypeEnum::EUCLIDIAN_DISTANCE}; + bool _isSetRoutingAlgorithm = false; + RoutingAlgorithm _routingAlgorithm {}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + double _value {}; + bool _isSetTimeToCollisionConditionTarget = false; + std::shared_ptr _timeToCollisionConditionTarget {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TimeToCollisionConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetAlongRoute() const override; + OPENSCENARIOLIB_EXP CoordinateSystem GetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP bool GetFreespace() const override; + OPENSCENARIOLIB_EXP RelativeDistanceType GetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP RoutingAlgorithm GetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTimeToCollisionConditionTarget() const override; + + + OPENSCENARIOLIB_EXP void SetAlongRoute(const bool alongRoute) override; + + OPENSCENARIOLIB_EXP void SetCoordinateSystem(const CoordinateSystem coordinateSystem) override; + + OPENSCENARIOLIB_EXP void SetFreespace(const bool freespace) override; + + OPENSCENARIOLIB_EXP void SetRelativeDistanceType(const RelativeDistanceType relativeDistanceType) override; + + OPENSCENARIOLIB_EXP void SetRoutingAlgorithm(const RoutingAlgorithm routingAlgorithm) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void SetTimeToCollisionConditionTarget(std::shared_ptr timeToCollisionConditionTarget) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAlongRoute(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCoordinateSystem(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFreespace(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRelativeDistanceType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRoutingAlgorithm(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAlongRoute() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCoordinateSystem() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFreespace() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRelativeDistanceType() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRoutingAlgorithm() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsAlongRouteParameterized() override; + OPENSCENARIOLIB_EXP bool IsCoordinateSystemParameterized() override; + OPENSCENARIOLIB_EXP bool IsFreespaceParameterized() override; + OPENSCENARIOLIB_EXP bool IsRelativeDistanceTypeParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoutingAlgorithmParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTimeToCollisionConditionTarget() const override; + OPENSCENARIOLIB_EXP virtual void ResetAlongRoute() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAlongRoute() const override; + OPENSCENARIOLIB_EXP virtual void ResetCoordinateSystem() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCoordinateSystem() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetFreespace() const override; + OPENSCENARIOLIB_EXP virtual void ResetRelativeDistanceType() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRelativeDistanceType() const override; + OPENSCENARIOLIB_EXP virtual void ResetRoutingAlgorithm() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoutingAlgorithm() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTimeToCollisionConditionTarget() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITimeToCollisionConditionTarget. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITimeToCollisionConditionTarget) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionTargetImpl: public BaseImpl, public ITimeToCollisionConditionTargetWriter, public std::enable_shared_from_this + { + private: + bool _isSetPosition = false; + std::shared_ptr _position {}; + bool _isSetEntityRef = false; + std::shared_ptr _entityRef {}; + + public: + + OPENSCENARIOLIB_EXP TimeToCollisionConditionTargetImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRef() const override; + + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void SetEntityRef(std::shared_ptr entityRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITiming. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITiming) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimingImpl: public BaseImpl, public ITimingWriter, public std::enable_shared_from_this + { + private: + bool _isSetDomainAbsoluteRelative = false; + ReferenceContext _domainAbsoluteRelative {}; + bool _isSetOffset = false; + double _offset {}; + bool _isSetScale = false; + double _scale {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TimingImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP ReferenceContext GetDomainAbsoluteRelative() const override; + OPENSCENARIOLIB_EXP double GetOffset() const override; + OPENSCENARIOLIB_EXP double GetScale() const override; + + + OPENSCENARIOLIB_EXP void SetDomainAbsoluteRelative(const ReferenceContext domainAbsoluteRelative) override; + + OPENSCENARIOLIB_EXP void SetOffset(const double offset) override; + + OPENSCENARIOLIB_EXP void SetScale(const double scale) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDomainAbsoluteRelative(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToScale(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDomainAbsoluteRelative() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOffset() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromScale() const override; + + OPENSCENARIOLIB_EXP bool IsDomainAbsoluteRelativeParameterized() override; + OPENSCENARIOLIB_EXP bool IsOffsetParameterized() override; + OPENSCENARIOLIB_EXP bool IsScaleParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDomainAbsoluteRelative() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetScale() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficActionImpl: public BaseImpl, public ITrafficActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrafficName = false; + std::string _trafficName {}; + bool _isSetTrafficSourceAction = false; + std::shared_ptr _trafficSourceAction {}; + bool _isSetTrafficSinkAction = false; + std::shared_ptr _trafficSinkAction {}; + bool _isSetTrafficSwarmAction = false; + std::shared_ptr _trafficSwarmAction {}; + bool _isSetTrafficAreaAction = false; + std::shared_ptr _trafficAreaAction {}; + bool _isSetTrafficStopAction = false; + std::shared_ptr _trafficStopAction {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetTrafficName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSourceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSinkAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSwarmAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficAreaAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficStopAction() const override; + + + OPENSCENARIOLIB_EXP void SetTrafficName(const std::string trafficName) override; + + OPENSCENARIOLIB_EXP void SetTrafficSourceAction(std::shared_ptr trafficSourceAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficSinkAction(std::shared_ptr trafficSinkAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficSwarmAction(std::shared_ptr trafficSwarmAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficAreaAction(std::shared_ptr trafficAreaAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficStopAction(std::shared_ptr trafficStopAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrafficName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrafficName() const override; + + OPENSCENARIOLIB_EXP bool IsTrafficNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSourceAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSinkAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSwarmAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficAreaAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficStopAction() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficName() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSourceAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSinkAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSwarmAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficAreaAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficStopAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficArea. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficArea) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaImpl: public BaseImpl, public ITrafficAreaWriter, public std::enable_shared_from_this + { + private: + bool _isSetPolygon = false; + std::shared_ptr _polygon {}; + bool _isSetRoadRange = false; + std::vector> _roadRange {}; + + public: + + OPENSCENARIOLIB_EXP TrafficAreaImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetPolygon() const override; + OPENSCENARIOLIB_EXP std::vector> GetRoadRange() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterRoadRange() const override; + OPENSCENARIOLIB_EXP int GetRoadRangeSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetRoadRangeAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetPolygon(std::shared_ptr polygon) override; + + OPENSCENARIOLIB_EXP void SetRoadRange(std::vector>& roadRange) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPolygon() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPolygon() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRoadRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficAreaAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficAreaAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaActionImpl: public BaseImpl, public ITrafficAreaActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContinuous = false; + bool _continuous {}; + bool _isSetNumberOfEntities = false; + uint32_t _numberOfEntities {}; + bool _isSetTrafficDistribution = false; + std::shared_ptr _trafficDistribution {}; + bool _isSetTrafficArea = false; + std::shared_ptr _trafficArea {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP TrafficAreaActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetContinuous() const override; + OPENSCENARIOLIB_EXP uint32_t GetNumberOfEntities() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficArea() const override; + + + OPENSCENARIOLIB_EXP void SetContinuous(const bool continuous) override; + + OPENSCENARIOLIB_EXP void SetNumberOfEntities(const uint32_t numberOfEntities) override; + + OPENSCENARIOLIB_EXP void SetTrafficDistribution(std::shared_ptr trafficDistribution) override; + + OPENSCENARIOLIB_EXP void SetTrafficArea(std::shared_ptr trafficArea) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContinuous(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToNumberOfEntities(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContinuous() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromNumberOfEntities() const override; + + OPENSCENARIOLIB_EXP bool IsContinuousParameterized() override; + OPENSCENARIOLIB_EXP bool IsNumberOfEntitiesParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficArea() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetContinuous() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetNumberOfEntities() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficArea() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficDefinition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficDefinition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDefinitionImpl: public BaseImpl, public ITrafficDefinitionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetVehicleCategoryDistribution = false; + std::shared_ptr _vehicleCategoryDistribution {}; + bool _isSetVehicleRoleDistribution = false; + std::shared_ptr _vehicleRoleDistribution {}; + bool _isSetControllerDistribution = false; + std::shared_ptr _controllerDistribution {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficDefinitionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleCategoryDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleRoleDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetControllerDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetVehicleCategoryDistribution(std::shared_ptr vehicleCategoryDistribution) override; + + OPENSCENARIOLIB_EXP void SetVehicleRoleDistribution(std::shared_ptr vehicleRoleDistribution) override; + + OPENSCENARIOLIB_EXP void SetControllerDistribution(std::shared_ptr controllerDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicleCategoryDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterVehicleRoleDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterControllerDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleCategoryDistribution() const override; + OPENSCENARIOLIB_EXP virtual void ResetVehicleRoleDistribution() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleRoleDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetControllerDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionImpl: public BaseImpl, public ITrafficDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrafficDistributionEntry = false; + std::vector> _trafficDistributionEntry {}; + + public: + + OPENSCENARIOLIB_EXP TrafficDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetTrafficDistributionEntry() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterTrafficDistributionEntry() const override; + OPENSCENARIOLIB_EXP int GetTrafficDistributionEntrySize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDistributionEntryAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetTrafficDistributionEntry(std::vector>& trafficDistributionEntry) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDistributionEntry() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficDistributionEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficDistributionEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionEntryImpl: public BaseImpl, public ITrafficDistributionEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetWeight = false; + double _weight {}; + bool _isSetEntityDistribution = false; + std::shared_ptr _entityDistribution {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrafficDistributionEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetWeight() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void SetEntityDistribution(std::shared_ptr entityDistribution) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterEntityDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityDistribution() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalActionImpl: public BaseImpl, public ITrafficSignalActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrafficSignalControllerAction = false; + std::shared_ptr _trafficSignalControllerAction {}; + bool _isSetTrafficSignalStateAction = false; + std::shared_ptr _trafficSignalStateAction {}; + + public: + + OPENSCENARIOLIB_EXP TrafficSignalActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficSignalStateAction() const override; + + + OPENSCENARIOLIB_EXP void SetTrafficSignalControllerAction(std::shared_ptr trafficSignalControllerAction) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalStateAction(std::shared_ptr trafficSignalStateAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalControllerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficSignalStateAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalControllerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalStateAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalConditionImpl: public BaseImpl, public ITrafficSignalConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetState = false; + std::string _state {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetState() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetState(const std::string state) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalController. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalController) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerImpl: public BaseImpl, public ITrafficSignalControllerWriter, public std::enable_shared_from_this + { + private: + bool _isSetDelay = false; + double _delay {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetReference = false; + std::string _reference {}; + bool _isSetPhases = false; + std::vector> _phases {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrafficSignalControllerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDelay() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetReference() const override; + OPENSCENARIOLIB_EXP std::vector> GetPhases() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPhases() const override; + OPENSCENARIOLIB_EXP int GetPhasesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPhasesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetDelay(const double delay) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetReference(const std::string reference) override; + + OPENSCENARIOLIB_EXP void SetPhases(std::vector>& phases) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDelay(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToReference(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDelay() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromReference() const override; + + OPENSCENARIOLIB_EXP bool IsDelayParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsReferenceParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetDelay() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDelay() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetReference() override; + OPENSCENARIOLIB_EXP virtual bool IsSetReference() const override; + OPENSCENARIOLIB_EXP virtual void ResetPhases() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPhases() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalControllerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalControllerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerActionImpl: public BaseImpl, public ITrafficSignalControllerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetPhase = false; + std::string _phase {}; + bool _isSetTrafficSignalControllerRef = false; + std::shared_ptr> _trafficSignalControllerRef = nullptr; + bool _isSetPhaseRef = false; + std::vector> _phaseRef {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalControllerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetPhase() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetTrafficSignalControllerRef() const override; + OPENSCENARIOLIB_EXP std::vector> GetPhaseRef() const override; + + OPENSCENARIOLIB_EXP int GetPhaseRefSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPhaseRefAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetPhase(const std::string phase) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) override; + + OPENSCENARIOLIB_EXP void SetPhaseRef(std::vector>& phaseRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToPhase(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrafficSignalControllerRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPhase() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrafficSignalControllerRef() const override; + + OPENSCENARIOLIB_EXP bool IsPhaseParameterized() override; + OPENSCENARIOLIB_EXP bool IsTrafficSignalControllerRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPhase() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalControllerRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetPhaseRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPhaseRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalControllerCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalControllerCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerConditionImpl: public BaseImpl, public ITrafficSignalControllerConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetPhase = false; + std::string _phase {}; + bool _isSetTrafficSignalControllerRef = false; + std::shared_ptr> _trafficSignalControllerRef = nullptr; + bool _isSetPhaseRef = false; + std::vector> _phaseRef {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalControllerConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetPhase() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetTrafficSignalControllerRef() const override; + OPENSCENARIOLIB_EXP std::vector> GetPhaseRef() const override; + + OPENSCENARIOLIB_EXP int GetPhaseRefSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPhaseRefAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetPhase(const std::string phase) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalControllerRef(std::shared_ptr> trafficSignalControllerRef) override; + + OPENSCENARIOLIB_EXP void SetPhaseRef(std::vector>& phaseRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToPhase(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrafficSignalControllerRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromPhase() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrafficSignalControllerRef() const override; + + OPENSCENARIOLIB_EXP bool IsPhaseParameterized() override; + OPENSCENARIOLIB_EXP bool IsTrafficSignalControllerRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPhase() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalControllerRef() const override; + OPENSCENARIOLIB_EXP virtual void ResetPhaseRef() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPhaseRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalGroupState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalGroupState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalGroupStateImpl: public BaseImpl, public ITrafficSignalGroupStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetState = false; + std::string _state {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalGroupStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetState() const override; + + + OPENSCENARIOLIB_EXP void SetState(const std::string state) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalState. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalState) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateImpl: public BaseImpl, public ITrafficSignalStateWriter, public std::enable_shared_from_this + { + private: + bool _isSetState = false; + std::string _state {}; + bool _isSetTrafficSignalId = false; + std::string _trafficSignalId {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalStateImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetState() const override; + OPENSCENARIOLIB_EXP std::string GetTrafficSignalId() const override; + + + OPENSCENARIOLIB_EXP void SetState(const std::string state) override; + + OPENSCENARIOLIB_EXP void SetTrafficSignalId(const std::string trafficSignalId) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTrafficSignalId(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTrafficSignalId() const override; + + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + OPENSCENARIOLIB_EXP bool IsTrafficSignalIdParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficSignalId() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSignalStateAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSignalStateAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateActionImpl: public BaseImpl, public ITrafficSignalStateActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetState = false; + std::string _state {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrafficSignalStateActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetState() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetState(const std::string state) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromState() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsStateParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetState() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSinkAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSinkAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSinkActionImpl: public BaseImpl, public ITrafficSinkActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRadius = false; + double _radius {}; + bool _isSetRate = false; + double _rate {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + bool _isSetTrafficDefinition = false; + std::shared_ptr _trafficDefinition {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrafficSinkActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetRadius() const override; + OPENSCENARIOLIB_EXP double GetRate() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDefinition() const override; + + + OPENSCENARIOLIB_EXP void SetRadius(const double radius) override; + + OPENSCENARIOLIB_EXP void SetRate(const double rate) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void SetTrafficDefinition(std::shared_ptr trafficDefinition) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRadius(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRadius() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRate() const override; + + OPENSCENARIOLIB_EXP bool IsRadiusParameterized() override; + OPENSCENARIOLIB_EXP bool IsRateParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDefinition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRadius() const override; + OPENSCENARIOLIB_EXP virtual void ResetRate() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRate() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficDefinition() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDefinition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSourceAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSourceAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSourceActionImpl: public BaseImpl, public ITrafficSourceActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRadius = false; + double _radius {}; + bool _isSetRate = false; + double _rate {}; + bool _isSetSpeed = false; + double _speed {}; + bool _isSetVelocity = false; + double _velocity {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + bool _isSetTrafficDefinition = false; + std::shared_ptr _trafficDefinition {}; + bool _isSetTrafficDistribution = false; + std::shared_ptr _trafficDistribution {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrafficSourceActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetRadius() const override; + OPENSCENARIOLIB_EXP double GetRate() const override; + OPENSCENARIOLIB_EXP double GetSpeed() const override; + OPENSCENARIOLIB_EXP double GetVelocity() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetRadius(const double radius) override; + + OPENSCENARIOLIB_EXP void SetRate(const double rate) override; + + OPENSCENARIOLIB_EXP void SetSpeed(const double speed) override; + + OPENSCENARIOLIB_EXP void SetVelocity(const double velocity) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void SetTrafficDefinition(std::shared_ptr trafficDefinition) override; + + OPENSCENARIOLIB_EXP void SetTrafficDistribution(std::shared_ptr trafficDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRadius(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRate(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVelocity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRadius() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRate() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpeed() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVelocity() const override; + + OPENSCENARIOLIB_EXP bool IsRadiusParameterized() override; + OPENSCENARIOLIB_EXP bool IsRateParameterized() override; + OPENSCENARIOLIB_EXP bool IsSpeedParameterized() override; + OPENSCENARIOLIB_EXP bool IsVelocityParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRadius() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRate() const override; + OPENSCENARIOLIB_EXP virtual void ResetSpeed() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeed() const override; + OPENSCENARIOLIB_EXP virtual void ResetVelocity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVelocity() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficDefinition() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDefinition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficDistribution() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficStopAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficStopAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficStopActionImpl: public BaseImpl, public ITrafficStopActionWriter, public std::enable_shared_from_this + { + private: + + public: + + OPENSCENARIOLIB_EXP TrafficStopActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrafficSwarmAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrafficSwarmAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSwarmActionImpl: public BaseImpl, public ITrafficSwarmActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetInnerRadius = false; + double _innerRadius {}; + bool _isSetNumberOfVehicles = false; + uint32_t _numberOfVehicles {}; + bool _isSetOffset = false; + double _offset {}; + bool _isSetSemiMajorAxis = false; + double _semiMajorAxis {}; + bool _isSetSemiMinorAxis = false; + double _semiMinorAxis {}; + bool _isSetVelocity = false; + double _velocity {}; + bool _isSetCentralObject = false; + std::shared_ptr _centralObject {}; + bool _isSetTrafficDefinition = false; + std::shared_ptr _trafficDefinition {}; + bool _isSetTrafficDistribution = false; + std::shared_ptr _trafficDistribution {}; + bool _isSetInitialSpeedRange = false; + std::shared_ptr _initialSpeedRange {}; + bool _isSetDirectionOfTravelDistribution = false; + std::shared_ptr _directionOfTravelDistribution {}; + + public: + + virtual void ResolveUnsignedIntExpression(std::string& attributeKey, unsigned int& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrafficSwarmActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetInnerRadius() const override; + OPENSCENARIOLIB_EXP uint32_t GetNumberOfVehicles() const override; + OPENSCENARIOLIB_EXP double GetOffset() const override; + OPENSCENARIOLIB_EXP double GetSemiMajorAxis() const override; + OPENSCENARIOLIB_EXP double GetSemiMinorAxis() const override; + OPENSCENARIOLIB_EXP double GetVelocity() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCentralObject() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrafficDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetInitialSpeedRange() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectionOfTravelDistribution() const override; + + + OPENSCENARIOLIB_EXP void SetInnerRadius(const double innerRadius) override; + + OPENSCENARIOLIB_EXP void SetNumberOfVehicles(const uint32_t numberOfVehicles) override; + + OPENSCENARIOLIB_EXP void SetOffset(const double offset) override; + + OPENSCENARIOLIB_EXP void SetSemiMajorAxis(const double semiMajorAxis) override; + + OPENSCENARIOLIB_EXP void SetSemiMinorAxis(const double semiMinorAxis) override; + + OPENSCENARIOLIB_EXP void SetVelocity(const double velocity) override; + + OPENSCENARIOLIB_EXP void SetCentralObject(std::shared_ptr centralObject) override; + + OPENSCENARIOLIB_EXP void SetTrafficDefinition(std::shared_ptr trafficDefinition) override; + + OPENSCENARIOLIB_EXP void SetTrafficDistribution(std::shared_ptr trafficDistribution) override; + + OPENSCENARIOLIB_EXP void SetInitialSpeedRange(std::shared_ptr initialSpeedRange) override; + + OPENSCENARIOLIB_EXP void SetDirectionOfTravelDistribution(std::shared_ptr directionOfTravelDistribution) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToInnerRadius(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToNumberOfVehicles(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToOffset(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSemiMajorAxis(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSemiMinorAxis(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVelocity(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromInnerRadius() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromNumberOfVehicles() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromOffset() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSemiMajorAxis() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSemiMinorAxis() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVelocity() const override; + + OPENSCENARIOLIB_EXP bool IsInnerRadiusParameterized() override; + OPENSCENARIOLIB_EXP bool IsNumberOfVehiclesParameterized() override; + OPENSCENARIOLIB_EXP bool IsOffsetParameterized() override; + OPENSCENARIOLIB_EXP bool IsSemiMajorAxisParameterized() override; + OPENSCENARIOLIB_EXP bool IsSemiMinorAxisParameterized() override; + OPENSCENARIOLIB_EXP bool IsVelocityParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCentralObject() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDefinition() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrafficDistribution() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterInitialSpeedRange() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectionOfTravelDistribution() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetInnerRadius() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetNumberOfVehicles() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetOffset() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSemiMajorAxis() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSemiMinorAxis() const override; + OPENSCENARIOLIB_EXP virtual void ResetVelocity() override; + OPENSCENARIOLIB_EXP virtual bool IsSetVelocity() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCentralObject() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficDefinition() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDefinition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrafficDistribution() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrafficDistribution() const override; + OPENSCENARIOLIB_EXP virtual void ResetInitialSpeedRange() override; + OPENSCENARIOLIB_EXP virtual bool IsSetInitialSpeedRange() const override; + OPENSCENARIOLIB_EXP virtual void ResetDirectionOfTravelDistribution() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectionOfTravelDistribution() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrailer. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrailer) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerImpl: public BaseImpl, public ITrailerWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrailer = false; + std::shared_ptr _trailer {}; + bool _isSetTrailerRef = false; + std::shared_ptr _trailerRef {}; + + public: + + OPENSCENARIOLIB_EXP TrailerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailer() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailerRef() const override; + + + OPENSCENARIOLIB_EXP void SetTrailer(std::shared_ptr trailer) override; + + OPENSCENARIOLIB_EXP void SetTrailerRef(std::shared_ptr trailerRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailer() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailerRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailer() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailerRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrailerAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrailerAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerActionImpl: public BaseImpl, public ITrailerActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetConnectTrailerAction = false; + std::shared_ptr _connectTrailerAction {}; + bool _isSetDisconnectTrailerAction = false; + std::shared_ptr _disconnectTrailerAction {}; + + public: + + OPENSCENARIOLIB_EXP TrailerActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetConnectTrailerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDisconnectTrailerAction() const override; + + + OPENSCENARIOLIB_EXP void SetConnectTrailerAction(std::shared_ptr connectTrailerAction) override; + + OPENSCENARIOLIB_EXP void SetDisconnectTrailerAction(std::shared_ptr disconnectTrailerAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterConnectTrailerAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDisconnectTrailerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetConnectTrailerAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDisconnectTrailerAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrailerCoupler. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrailerCoupler) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerCouplerImpl: public BaseImpl, public ITrailerCouplerWriter, public std::enable_shared_from_this + { + private: + bool _isSetDx = false; + double _dx {}; + bool _isSetDz = false; + double _dz {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrailerCouplerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDx() const override; + OPENSCENARIOLIB_EXP double GetDz() const override; + + + OPENSCENARIOLIB_EXP void SetDx(const double dx) override; + + OPENSCENARIOLIB_EXP void SetDz(const double dz) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDx(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDz(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDx() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDz() const override; + + OPENSCENARIOLIB_EXP bool IsDxParameterized() override; + OPENSCENARIOLIB_EXP bool IsDzParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDx() const override; + OPENSCENARIOLIB_EXP virtual void ResetDz() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDz() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrailerHitch. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrailerHitch) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerHitchImpl: public BaseImpl, public ITrailerHitchWriter, public std::enable_shared_from_this + { + private: + bool _isSetDx = false; + double _dx {}; + bool _isSetDz = false; + double _dz {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrailerHitchImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDx() const override; + OPENSCENARIOLIB_EXP double GetDz() const override; + + + OPENSCENARIOLIB_EXP void SetDx(const double dx) override; + + OPENSCENARIOLIB_EXP void SetDz(const double dz) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDx(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDz(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDx() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDz() const override; + + OPENSCENARIOLIB_EXP bool IsDxParameterized() override; + OPENSCENARIOLIB_EXP bool IsDzParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDx() const override; + OPENSCENARIOLIB_EXP virtual void ResetDz() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDz() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrajectory. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrajectory) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryImpl: public BaseImpl, public ITrajectoryWriter, public std::enable_shared_from_this + { + private: + bool _isSetClosed = false; + bool _closed {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetShape = false; + std::shared_ptr _shape {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP TrajectoryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetClosed() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetShape() const override; + + + OPENSCENARIOLIB_EXP void SetClosed(const bool closed) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetShape(std::shared_ptr shape) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToClosed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromClosed() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP bool IsClosedParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterShape() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetClosed() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetShape() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrajectoryCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrajectoryCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryCatalogLocationImpl: public BaseImpl, public ITrajectoryCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP TrajectoryCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrajectoryFollowingMode. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrajectoryFollowingMode) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryFollowingModeImpl: public BaseImpl, public ITrajectoryFollowingModeWriter, public std::enable_shared_from_this + { + private: + bool _isSetFollowingMode = false; + FollowingMode _followingMode {}; + + public: + + OPENSCENARIOLIB_EXP TrajectoryFollowingModeImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP FollowingMode GetFollowingMode() const override; + + + OPENSCENARIOLIB_EXP void SetFollowingMode(const FollowingMode followingMode) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToFollowingMode(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFollowingMode() const override; + + OPENSCENARIOLIB_EXP bool IsFollowingModeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetFollowingMode() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrajectoryPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrajectoryPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryPositionImpl: public BaseImpl, public ITrajectoryPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetS = false; + double _s {}; + bool _isSetT = false; + double _t {0}; + bool _isSetOrientation = false; + std::shared_ptr _orientation {}; + bool _isSetTrajectoryRef = false; + std::shared_ptr _trajectoryRef {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TrajectoryPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetS() const override; + OPENSCENARIOLIB_EXP double GetT() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetOrientation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectoryRef() const override; + + + OPENSCENARIOLIB_EXP void SetS(const double s) override; + + OPENSCENARIOLIB_EXP void SetT(const double t) override; + + OPENSCENARIOLIB_EXP void SetOrientation(std::shared_ptr orientation) override; + + OPENSCENARIOLIB_EXP void SetTrajectoryRef(std::shared_ptr trajectoryRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToS(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToT(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromS() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromT() const override; + + OPENSCENARIOLIB_EXP bool IsSParameterized() override; + OPENSCENARIOLIB_EXP bool IsTParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterOrientation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectoryRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetS() const override; + OPENSCENARIOLIB_EXP virtual void ResetT() override; + OPENSCENARIOLIB_EXP virtual bool IsSetT() const override; + OPENSCENARIOLIB_EXP virtual void ResetOrientation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetOrientation() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectoryRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrajectoryRef. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrajectoryRef) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryRefImpl: public BaseImpl, public ITrajectoryRefWriter, public std::enable_shared_from_this + { + private: + bool _isSetTrajectory = false; + std::shared_ptr _trajectory {}; + bool _isSetCatalogReference = false; + std::shared_ptr _catalogReference {}; + + public: + + OPENSCENARIOLIB_EXP TrajectoryRefImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetTrajectory() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetCatalogReference() const override; + + + OPENSCENARIOLIB_EXP void SetTrajectory(std::shared_ptr trajectory) override; + + OPENSCENARIOLIB_EXP void SetCatalogReference(std::shared_ptr catalogReference) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrajectory() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCatalogReference() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrajectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCatalogReference() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITransitionDynamics. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITransitionDynamics) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TransitionDynamicsImpl: public BaseImpl, public ITransitionDynamicsWriter, public std::enable_shared_from_this + { + private: + bool _isSetDynamicsDimension = false; + DynamicsDimension _dynamicsDimension {}; + bool _isSetDynamicsShape = false; + DynamicsShape _dynamicsShape {}; + bool _isSetFollowingMode = false; + FollowingMode _followingMode {FollowingMode::FollowingModeEnum::POSITION}; + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TransitionDynamicsImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP DynamicsDimension GetDynamicsDimension() const override; + OPENSCENARIOLIB_EXP DynamicsShape GetDynamicsShape() const override; + OPENSCENARIOLIB_EXP FollowingMode GetFollowingMode() const override; + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetDynamicsDimension(const DynamicsDimension dynamicsDimension) override; + + OPENSCENARIOLIB_EXP void SetDynamicsShape(const DynamicsShape dynamicsShape) override; + + OPENSCENARIOLIB_EXP void SetFollowingMode(const FollowingMode followingMode) override; + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDynamicsDimension(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToDynamicsShape(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFollowingMode(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDynamicsDimension() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDynamicsShape() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFollowingMode() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsDynamicsDimensionParameterized() override; + OPENSCENARIOLIB_EXP bool IsDynamicsShapeParameterized() override; + OPENSCENARIOLIB_EXP bool IsFollowingModeParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicsDimension() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDynamicsShape() const override; + OPENSCENARIOLIB_EXP virtual void ResetFollowingMode() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFollowingMode() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITraveledDistanceCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITraveledDistanceCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TraveledDistanceConditionImpl: public BaseImpl, public ITraveledDistanceConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP TraveledDistanceConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITrigger. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITrigger) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggerImpl: public BaseImpl, public ITriggerWriter, public std::enable_shared_from_this + { + private: + bool _isSetConditionGroups = false; + std::vector> _conditionGroups {}; + + public: + + OPENSCENARIOLIB_EXP TriggerImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetConditionGroups() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterConditionGroups() const override; + OPENSCENARIOLIB_EXP int GetConditionGroupsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetConditionGroupsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetConditionGroups(std::vector>& conditionGroups) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual void ResetConditionGroups() override; + OPENSCENARIOLIB_EXP virtual bool IsSetConditionGroups() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements ITriggeringEntities. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of ITriggeringEntities) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggeringEntitiesImpl: public BaseImpl, public ITriggeringEntitiesWriter, public std::enable_shared_from_this + { + private: + bool _isSetTriggeringEntitiesRule = false; + TriggeringEntitiesRule _triggeringEntitiesRule {}; + bool _isSetEntityRefs = false; + std::vector> _entityRefs {}; + + public: + + OPENSCENARIOLIB_EXP TriggeringEntitiesImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP TriggeringEntitiesRule GetTriggeringEntitiesRule() const override; + OPENSCENARIOLIB_EXP std::vector> GetEntityRefs() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterEntityRefs() const override; + OPENSCENARIOLIB_EXP int GetEntityRefsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetEntityRefsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetTriggeringEntitiesRule(const TriggeringEntitiesRule triggeringEntitiesRule) override; + + OPENSCENARIOLIB_EXP void SetEntityRefs(std::vector>& entityRefs) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTriggeringEntitiesRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTriggeringEntitiesRule() const override; + + OPENSCENARIOLIB_EXP bool IsTriggeringEntitiesRuleParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetTriggeringEntitiesRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetEntityRefs() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUniformDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUniformDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UniformDistributionImpl: public BaseImpl, public IUniformDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRange = false; + std::shared_ptr _range {}; + + public: + + OPENSCENARIOLIB_EXP UniformDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRange() const override; + + + OPENSCENARIOLIB_EXP void SetRange(std::shared_ptr range) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRange() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRange() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUsedArea. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUsedArea) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UsedAreaImpl: public BaseImpl, public IUsedAreaWriter, public std::enable_shared_from_this + { + private: + bool _isSetPositions = false; + std::vector> _positions {}; + + public: + + OPENSCENARIOLIB_EXP UsedAreaImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetPositions() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterPositions() const override; + OPENSCENARIOLIB_EXP int GetPositionsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPositionsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetPositions(std::vector>& positions) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetPositions() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedActionImpl: public BaseImpl, public IUserDefinedActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetCustomCommandAction = false; + std::shared_ptr _customCommandAction {}; + + public: + + OPENSCENARIOLIB_EXP UserDefinedActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetCustomCommandAction() const override; + + + OPENSCENARIOLIB_EXP void SetCustomCommandAction(std::shared_ptr customCommandAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterCustomCommandAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetCustomCommandAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedAnimation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedAnimation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedAnimationImpl: public BaseImpl, public IUserDefinedAnimationWriter, public std::enable_shared_from_this + { + private: + bool _isSetUserDefinedAnimationType = false; + std::string _userDefinedAnimationType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP UserDefinedAnimationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetUserDefinedAnimationType() const override; + + + OPENSCENARIOLIB_EXP void SetUserDefinedAnimationType(const std::string userDefinedAnimationType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToUserDefinedAnimationType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromUserDefinedAnimationType() const override; + + OPENSCENARIOLIB_EXP bool IsUserDefinedAnimationTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedAnimationType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedComponent. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedComponent) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedComponentImpl: public BaseImpl, public IUserDefinedComponentWriter, public std::enable_shared_from_this + { + private: + bool _isSetUserDefinedComponentType = false; + std::string _userDefinedComponentType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP UserDefinedComponentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetUserDefinedComponentType() const override; + + + OPENSCENARIOLIB_EXP void SetUserDefinedComponentType(const std::string userDefinedComponentType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToUserDefinedComponentType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromUserDefinedComponentType() const override; + + OPENSCENARIOLIB_EXP bool IsUserDefinedComponentTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedComponentType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedDistributionImpl: public BaseImpl, public IUserDefinedDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetContent = false; + std::string _content {}; + bool _isSetType = false; + std::string _type {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP UserDefinedDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetContent() const override; + OPENSCENARIOLIB_EXP std::string GetType() const override; + + + OPENSCENARIOLIB_EXP void SetContent(const std::string content) override; + + OPENSCENARIOLIB_EXP void SetType(const std::string type) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToContent(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromContent() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromType() const override; + + OPENSCENARIOLIB_EXP bool IsContentParameterized() override; + OPENSCENARIOLIB_EXP bool IsTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetContent() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedLight. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedLight) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedLightImpl: public BaseImpl, public IUserDefinedLightWriter, public std::enable_shared_from_this + { + private: + bool _isSetUserDefinedLightType = false; + std::string _userDefinedLightType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP UserDefinedLightImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetUserDefinedLightType() const override; + + + OPENSCENARIOLIB_EXP void SetUserDefinedLightType(const std::string userDefinedLightType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToUserDefinedLightType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromUserDefinedLightType() const override; + + OPENSCENARIOLIB_EXP bool IsUserDefinedLightTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetUserDefinedLightType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IUserDefinedValueCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IUserDefinedValueCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedValueConditionImpl: public BaseImpl, public IUserDefinedValueConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP UserDefinedValueConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IValueConstraint. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IValueConstraint) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintImpl: public BaseImpl, public IValueConstraintWriter, public std::enable_shared_from_this + { + private: + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + + OPENSCENARIOLIB_EXP ValueConstraintImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IValueConstraintGroup. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IValueConstraintGroup) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintGroupImpl: public BaseImpl, public IValueConstraintGroupWriter, public std::enable_shared_from_this + { + private: + bool _isSetConstraints = false; + std::vector> _constraints {}; + + public: + + OPENSCENARIOLIB_EXP ValueConstraintGroupImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetConstraints() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterConstraints() const override; + OPENSCENARIOLIB_EXP int GetConstraintsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetConstraintsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetConstraints(std::vector>& constraints) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetConstraints() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IValueSetDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IValueSetDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueSetDistributionImpl: public BaseImpl, public IValueSetDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetParameterValueSets = false; + std::vector> _parameterValueSets {}; + + public: + + OPENSCENARIOLIB_EXP ValueSetDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetParameterValueSets() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterValueSets() const override; + OPENSCENARIOLIB_EXP int GetParameterValueSetsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterValueSetsAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetParameterValueSets(std::vector>& parameterValueSets) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetParameterValueSets() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableActionImpl: public BaseImpl, public IVariableActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetVariableRef = false; + std::shared_ptr> _variableRef = nullptr; + bool _isSetSetAction = false; + std::shared_ptr _setAction {}; + bool _isSetModifyAction = false; + std::shared_ptr _modifyAction {}; + + public: + + OPENSCENARIOLIB_EXP VariableActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr> GetVariableRef() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetModifyAction() const override; + + + OPENSCENARIOLIB_EXP void SetVariableRef(std::shared_ptr> variableRef) override; + + OPENSCENARIOLIB_EXP void SetSetAction(std::shared_ptr setAction) override; + + OPENSCENARIOLIB_EXP void SetModifyAction(std::shared_ptr modifyAction) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToVariableRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVariableRef() const override; + + OPENSCENARIOLIB_EXP bool IsVariableRefParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSetAction() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterModifyAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableRef() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSetAction() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetModifyAction() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableAddValueRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableAddValueRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableAddValueRuleImpl: public BaseImpl, public IVariableAddValueRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VariableAddValueRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableCondition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableCondition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableConditionImpl: public BaseImpl, public IVariableConditionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRule = false; + Rule _rule {}; + bool _isSetValue = false; + std::string _value {}; + bool _isSetVariableRef = false; + std::shared_ptr> _variableRef = nullptr; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + OPENSCENARIOLIB_EXP VariableConditionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP Rule GetRule() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr> GetVariableRef() const override; + + + OPENSCENARIOLIB_EXP void SetRule(const Rule rule) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void SetVariableRef(std::shared_ptr> variableRef) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRule(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVariableRef(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRule() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVariableRef() const override; + + OPENSCENARIOLIB_EXP bool IsRuleParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + OPENSCENARIOLIB_EXP bool IsVariableRefParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableRef() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableDeclaration. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableDeclaration) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableDeclarationImpl: public BaseImpl, public IVariableDeclarationWriter, public std::enable_shared_from_this + { + private: + bool _isSetName = false; + std::string _name {}; + bool _isSetValue = false; + std::string _value {}; + bool _isSetVariableType = false; + ParameterType _variableType {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + + OPENSCENARIOLIB_EXP VariableDeclarationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP std::string GetValue() const override; + OPENSCENARIOLIB_EXP ParameterType GetVariableType() const override; + + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void SetVariableType(const ParameterType variableType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVariableType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVariableType() const override; + + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + OPENSCENARIOLIB_EXP bool IsVariableTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVariableType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableModifyAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableModifyAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyActionImpl: public BaseImpl, public IVariableModifyActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetRule = false; + std::shared_ptr _rule {}; + + public: + + OPENSCENARIOLIB_EXP VariableModifyActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetRule() const override; + + + OPENSCENARIOLIB_EXP void SetRule(std::shared_ptr rule) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterRule() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRule() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableModifyRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableModifyRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyRuleImpl: public BaseImpl, public IVariableModifyRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetAddValue = false; + std::shared_ptr _addValue {}; + bool _isSetMultiplyByValue = false; + std::shared_ptr _multiplyByValue {}; + + public: + + OPENSCENARIOLIB_EXP VariableModifyRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetAddValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetMultiplyByValue() const override; + + + OPENSCENARIOLIB_EXP void SetAddValue(std::shared_ptr addValue) override; + + OPENSCENARIOLIB_EXP void SetMultiplyByValue(std::shared_ptr multiplyByValue) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAddValue() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterMultiplyByValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAddValue() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetMultiplyByValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableMultiplyByValueRule. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableMultiplyByValueRule) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableMultiplyByValueRuleImpl: public BaseImpl, public IVariableMultiplyByValueRuleWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + double _value {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VariableMultiplyByValueRuleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const double value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVariableSetAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVariableSetAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableSetActionImpl: public BaseImpl, public IVariableSetActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetValue = false; + std::string _value {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + + OPENSCENARIOLIB_EXP VariableSetActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::string GetValue() const override; + + + OPENSCENARIOLIB_EXP void SetValue(const std::string value) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToValue(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromValue() const override; + + OPENSCENARIOLIB_EXP bool IsValueParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetValue() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicle. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicle) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleImpl: public BaseImpl, public IVehicleWriter, public std::enable_shared_from_this + { + private: + bool _isSetMass = false; + double _mass {}; + bool _isSetModel3d = false; + std::string _model3d {}; + bool _isSetName = false; + std::string _name {}; + bool _isSetRole = false; + Role _role {Role::RoleEnum::NONE}; + bool _isSetVehicleCategory = false; + VehicleCategory _vehicleCategory {}; + bool _isSetParameterDeclarations = false; + std::vector> _parameterDeclarations {}; + bool _isSetBoundingBox = false; + std::shared_ptr _boundingBox {}; + bool _isSetPerformance = false; + std::shared_ptr _performance {}; + bool _isSetAxles = false; + std::shared_ptr _axles {}; + bool _isSetProperties = false; + std::shared_ptr _properties {}; + bool _isSetTrailerHitch = false; + std::shared_ptr _trailerHitch {}; + bool _isSetTrailerCoupler = false; + std::shared_ptr _trailerCoupler {}; + bool _isSetTrailer = false; + std::shared_ptr _trailer {}; + + public: + + virtual void ResolveStringExpression(std::string& attributeKey, std::string& value) override; + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VehicleImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetMass() const override; + OPENSCENARIOLIB_EXP std::string GetModel3d() const override; + OPENSCENARIOLIB_EXP std::string GetName() const override; + OPENSCENARIOLIB_EXP Role GetRole() const override; + OPENSCENARIOLIB_EXP VehicleCategory GetVehicleCategory() const override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDeclarations() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterParameterDeclarations() const override; + OPENSCENARIOLIB_EXP int GetParameterDeclarationsSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetParameterDeclarationsAtIndex(unsigned int index) const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPerformance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetAxles() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetProperties() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailerHitch() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailerCoupler() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetTrailer() const override; + + + OPENSCENARIOLIB_EXP void SetMass(const double mass) override; + + OPENSCENARIOLIB_EXP void SetModel3d(const std::string model3d) override; + + OPENSCENARIOLIB_EXP void SetName(const std::string name) override; + + OPENSCENARIOLIB_EXP void SetRole(const Role role) override; + + OPENSCENARIOLIB_EXP void SetVehicleCategory(const VehicleCategory vehicleCategory) override; + + OPENSCENARIOLIB_EXP void SetParameterDeclarations(std::vector>& parameterDeclarations) override; + + OPENSCENARIOLIB_EXP void SetBoundingBox(std::shared_ptr boundingBox) override; + + OPENSCENARIOLIB_EXP void SetPerformance(std::shared_ptr performance) override; + + OPENSCENARIOLIB_EXP void SetAxles(std::shared_ptr axles) override; + + OPENSCENARIOLIB_EXP void SetProperties(std::shared_ptr properties) override; + + OPENSCENARIOLIB_EXP void SetTrailerHitch(std::shared_ptr trailerHitch) override; + + OPENSCENARIOLIB_EXP void SetTrailerCoupler(std::shared_ptr trailerCoupler) override; + + OPENSCENARIOLIB_EXP void SetTrailer(std::shared_ptr trailer) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToMass(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToModel3d(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToName(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToRole(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToVehicleCategory(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromMass() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromModel3d() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromName() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRole() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVehicleCategory() const override; + + OPENSCENARIOLIB_EXP bool IsMassParameterized() override; + OPENSCENARIOLIB_EXP bool IsModel3dParameterized() override; + OPENSCENARIOLIB_EXP bool IsNameParameterized() override; + OPENSCENARIOLIB_EXP bool IsRoleParameterized() override; + OPENSCENARIOLIB_EXP bool IsVehicleCategoryParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterBoundingBox() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPerformance() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterAxles() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterProperties() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailerHitch() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailerCoupler() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterTrailer() const override; + OPENSCENARIOLIB_EXP virtual void ResetMass() override; + OPENSCENARIOLIB_EXP virtual bool IsSetMass() const override; + OPENSCENARIOLIB_EXP virtual void ResetModel3d() override; + OPENSCENARIOLIB_EXP virtual bool IsSetModel3d() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetName() const override; + OPENSCENARIOLIB_EXP virtual void ResetRole() override; + OPENSCENARIOLIB_EXP virtual bool IsSetRole() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleCategory() const override; + OPENSCENARIOLIB_EXP virtual void ResetParameterDeclarations() override; + OPENSCENARIOLIB_EXP virtual bool IsSetParameterDeclarations() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetBoundingBox() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPerformance() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetAxles() const override; + OPENSCENARIOLIB_EXP virtual void ResetProperties() override; + OPENSCENARIOLIB_EXP virtual bool IsSetProperties() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrailerHitch() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailerHitch() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrailerCoupler() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailerCoupler() const override; + OPENSCENARIOLIB_EXP virtual void ResetTrailer() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTrailer() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleCatalogLocation. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleCatalogLocation) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCatalogLocationImpl: public BaseImpl, public IVehicleCatalogLocationWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirectory = false; + std::shared_ptr _directory {}; + + public: + + OPENSCENARIOLIB_EXP VehicleCatalogLocationImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetDirectory() const override; + + + OPENSCENARIOLIB_EXP void SetDirectory(std::shared_ptr directory) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDirectory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetDirectory() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleCategoryDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleCategoryDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionImpl: public BaseImpl, public IVehicleCategoryDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleCategoryDistributionEntries = false; + std::vector> _vehicleCategoryDistributionEntries {}; + + public: + + OPENSCENARIOLIB_EXP VehicleCategoryDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetVehicleCategoryDistributionEntries() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterVehicleCategoryDistributionEntries() const override; + OPENSCENARIOLIB_EXP int GetVehicleCategoryDistributionEntriesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleCategoryDistributionEntriesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetVehicleCategoryDistributionEntries(std::vector>& vehicleCategoryDistributionEntries) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleCategoryDistributionEntries() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleCategoryDistributionEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleCategoryDistributionEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionEntryImpl: public BaseImpl, public IVehicleCategoryDistributionEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetCategory = false; + VehicleCategory _category {}; + bool _isSetWeight = false; + double _weight {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VehicleCategoryDistributionEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP VehicleCategory GetCategory() const override; + OPENSCENARIOLIB_EXP double GetWeight() const override; + + + OPENSCENARIOLIB_EXP void SetCategory(const VehicleCategory category) override; + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToCategory(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCategory() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsCategoryParameterized() override; + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetCategory() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleComponent. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleComponent) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleComponentImpl: public BaseImpl, public IVehicleComponentWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleComponentType = false; + VehicleComponentType _vehicleComponentType {}; + + public: + + OPENSCENARIOLIB_EXP VehicleComponentImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP VehicleComponentType GetVehicleComponentType() const override; + + + OPENSCENARIOLIB_EXP void SetVehicleComponentType(const VehicleComponentType vehicleComponentType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToVehicleComponentType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVehicleComponentType() const override; + + OPENSCENARIOLIB_EXP bool IsVehicleComponentTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleComponentType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleLight. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleLight) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleLightImpl: public BaseImpl, public IVehicleLightWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleLightType = false; + VehicleLightType _vehicleLightType {}; + + public: + + OPENSCENARIOLIB_EXP VehicleLightImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP VehicleLightType GetVehicleLightType() const override; + + + OPENSCENARIOLIB_EXP void SetVehicleLightType(const VehicleLightType vehicleLightType) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToVehicleLightType(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromVehicleLightType() const override; + + OPENSCENARIOLIB_EXP bool IsVehicleLightTypeParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleLightType() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleRoleDistribution. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleRoleDistribution) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionImpl: public BaseImpl, public IVehicleRoleDistributionWriter, public std::enable_shared_from_this + { + private: + bool _isSetVehicleRoleDistributionEntries = false; + std::vector> _vehicleRoleDistributionEntries {}; + + public: + + OPENSCENARIOLIB_EXP VehicleRoleDistributionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP std::vector> GetVehicleRoleDistributionEntries() const override; + + OPENSCENARIOLIB_EXP std::vector> GetWriterVehicleRoleDistributionEntries() const override; + OPENSCENARIOLIB_EXP int GetVehicleRoleDistributionEntriesSize() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetVehicleRoleDistributionEntriesAtIndex(unsigned int index) const override; + + + OPENSCENARIOLIB_EXP void SetVehicleRoleDistributionEntries(std::vector>& vehicleRoleDistributionEntries) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + // children + OPENSCENARIOLIB_EXP virtual bool IsSetVehicleRoleDistributionEntries() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVehicleRoleDistributionEntry. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVehicleRoleDistributionEntry) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionEntryImpl: public BaseImpl, public IVehicleRoleDistributionEntryWriter, public std::enable_shared_from_this + { + private: + bool _isSetRole = false; + Role _role {}; + bool _isSetWeight = false; + double _weight {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VehicleRoleDistributionEntryImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP Role GetRole() const override; + OPENSCENARIOLIB_EXP double GetWeight() const override; + + + OPENSCENARIOLIB_EXP void SetRole(const Role role) override; + + OPENSCENARIOLIB_EXP void SetWeight(const double weight) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRole(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToWeight(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRole() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromWeight() const override; + + OPENSCENARIOLIB_EXP bool IsRoleParameterized() override; + OPENSCENARIOLIB_EXP bool IsWeightParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetRole() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetWeight() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVertex. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVertex) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VertexImpl: public BaseImpl, public IVertexWriter, public std::enable_shared_from_this + { + private: + bool _isSetTime = false; + double _time {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP VertexImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetTime() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetTime(const double time) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToTime(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTime() const override; + + OPENSCENARIOLIB_EXP bool IsTimeParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual void ResetTime() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTime() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IVisibilityAction. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IVisibilityAction) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VisibilityActionImpl: public BaseImpl, public IVisibilityActionWriter, public std::enable_shared_from_this + { + private: + bool _isSetGraphics = false; + bool _graphics {}; + bool _isSetSensors = false; + bool _sensors {}; + bool _isSetTraffic = false; + bool _traffic {}; + bool _isSetSensorReferenceSet = false; + std::shared_ptr _sensorReferenceSet {}; + + public: + + virtual void ResolveBooleanExpression(std::string& attributeKey, bool& value) override; + OPENSCENARIOLIB_EXP VisibilityActionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP bool GetGraphics() const override; + OPENSCENARIOLIB_EXP bool GetSensors() const override; + OPENSCENARIOLIB_EXP bool GetTraffic() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSensorReferenceSet() const override; + + + OPENSCENARIOLIB_EXP void SetGraphics(const bool graphics) override; + + OPENSCENARIOLIB_EXP void SetSensors(const bool sensors) override; + + OPENSCENARIOLIB_EXP void SetTraffic(const bool traffic) override; + + OPENSCENARIOLIB_EXP void SetSensorReferenceSet(std::shared_ptr sensorReferenceSet) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToGraphics(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSensors(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTraffic(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromGraphics() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSensors() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTraffic() const override; + + OPENSCENARIOLIB_EXP bool IsGraphicsParameterized() override; + OPENSCENARIOLIB_EXP bool IsSensorsParameterized() override; + OPENSCENARIOLIB_EXP bool IsTrafficParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSensorReferenceSet() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetGraphics() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSensors() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetTraffic() const override; + OPENSCENARIOLIB_EXP virtual void ResetSensorReferenceSet() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSensorReferenceSet() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IWaypoint. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IWaypoint) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WaypointImpl: public BaseImpl, public IWaypointWriter, public std::enable_shared_from_this + { + private: + bool _isSetRouteStrategy = false; + RouteStrategy _routeStrategy {}; + bool _isSetPosition = false; + std::shared_ptr _position {}; + + public: + + OPENSCENARIOLIB_EXP WaypointImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP RouteStrategy GetRouteStrategy() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPosition() const override; + + + OPENSCENARIOLIB_EXP void SetRouteStrategy(const RouteStrategy routeStrategy) override; + + OPENSCENARIOLIB_EXP void SetPosition(std::shared_ptr position) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToRouteStrategy(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromRouteStrategy() const override; + + OPENSCENARIOLIB_EXP bool IsRouteStrategyParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPosition() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetRouteStrategy() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetPosition() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IWeather. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IWeather) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WeatherImpl: public BaseImpl, public IWeatherWriter, public std::enable_shared_from_this + { + private: + bool _isSetAtmosphericPressure = false; + double _atmosphericPressure {}; + bool _isSetCloudState = false; + CloudState _cloudState {}; + bool _isSetFractionalCloudCover = false; + FractionalCloudCover _fractionalCloudCover {}; + bool _isSetTemperature = false; + double _temperature {}; + bool _isSetSun = false; + std::shared_ptr _sun {}; + bool _isSetFog = false; + std::shared_ptr _fog {}; + bool _isSetPrecipitation = false; + std::shared_ptr _precipitation {}; + bool _isSetWind = false; + std::shared_ptr _wind {}; + bool _isSetDomeImage = false; + std::shared_ptr _domeImage {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP WeatherImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetAtmosphericPressure() const override; + OPENSCENARIOLIB_EXP CloudState GetCloudState() const override; + OPENSCENARIOLIB_EXP FractionalCloudCover GetFractionalCloudCover() const override; + OPENSCENARIOLIB_EXP double GetTemperature() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetSun() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetFog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetPrecipitation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWind() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetDomeImage() const override; + + + OPENSCENARIOLIB_EXP void SetAtmosphericPressure(const double atmosphericPressure) override; + + OPENSCENARIOLIB_EXP void SetCloudState(const CloudState cloudState) override; + + OPENSCENARIOLIB_EXP void SetFractionalCloudCover(const FractionalCloudCover fractionalCloudCover) override; + + OPENSCENARIOLIB_EXP void SetTemperature(const double temperature) override; + + OPENSCENARIOLIB_EXP void SetSun(std::shared_ptr sun) override; + + OPENSCENARIOLIB_EXP void SetFog(std::shared_ptr fog) override; + + OPENSCENARIOLIB_EXP void SetPrecipitation(std::shared_ptr precipitation) override; + + OPENSCENARIOLIB_EXP void SetWind(std::shared_ptr wind) override; + + OPENSCENARIOLIB_EXP void SetDomeImage(std::shared_ptr domeImage) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToAtmosphericPressure(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToCloudState(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToFractionalCloudCover(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToTemperature(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromAtmosphericPressure() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromCloudState() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromFractionalCloudCover() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromTemperature() const override; + + OPENSCENARIOLIB_EXP bool IsAtmosphericPressureParameterized() override; + OPENSCENARIOLIB_EXP bool IsCloudStateParameterized() override; + OPENSCENARIOLIB_EXP bool IsFractionalCloudCoverParameterized() override; + OPENSCENARIOLIB_EXP bool IsTemperatureParameterized() override; + // children + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterSun() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterFog() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterPrecipitation() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterWind() const override; + OPENSCENARIOLIB_EXP std::shared_ptr GetWriterDomeImage() const override; + OPENSCENARIOLIB_EXP virtual void ResetAtmosphericPressure() override; + OPENSCENARIOLIB_EXP virtual bool IsSetAtmosphericPressure() const override; + OPENSCENARIOLIB_EXP virtual void ResetCloudState() override; + OPENSCENARIOLIB_EXP virtual bool IsSetCloudState() const override; + OPENSCENARIOLIB_EXP virtual void ResetFractionalCloudCover() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFractionalCloudCover() const override; + OPENSCENARIOLIB_EXP virtual void ResetTemperature() override; + OPENSCENARIOLIB_EXP virtual bool IsSetTemperature() const override; + OPENSCENARIOLIB_EXP virtual void ResetSun() override; + OPENSCENARIOLIB_EXP virtual bool IsSetSun() const override; + OPENSCENARIOLIB_EXP virtual void ResetFog() override; + OPENSCENARIOLIB_EXP virtual bool IsSetFog() const override; + OPENSCENARIOLIB_EXP virtual void ResetPrecipitation() override; + OPENSCENARIOLIB_EXP virtual bool IsSetPrecipitation() const override; + OPENSCENARIOLIB_EXP virtual void ResetWind() override; + OPENSCENARIOLIB_EXP virtual bool IsSetWind() const override; + OPENSCENARIOLIB_EXP virtual void ResetDomeImage() override; + OPENSCENARIOLIB_EXP virtual bool IsSetDomeImage() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IWind. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IWind) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WindImpl: public BaseImpl, public IWindWriter, public std::enable_shared_from_this + { + private: + bool _isSetDirection = false; + double _direction {}; + bool _isSetSpeed = false; + double _speed {}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP WindImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetDirection() const override; + OPENSCENARIOLIB_EXP double GetSpeed() const override; + + + OPENSCENARIOLIB_EXP void SetDirection(const double direction) override; + + OPENSCENARIOLIB_EXP void SetSpeed(const double speed) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToDirection(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToSpeed(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromDirection() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromSpeed() const override; + + OPENSCENARIOLIB_EXP bool IsDirectionParameterized() override; + OPENSCENARIOLIB_EXP bool IsSpeedParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual bool IsSetDirection() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetSpeed() const override; + }; + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + *

+ * Value class that implements IWorldPosition. With setter methods to fill the properties. + *

    + *
  • getter methods for properties (implemented methods of IWorldPosition) + *
  • setter methods for properties + *
  • getChildren method to collect all children + *
  • clone function to make a deep copy + *
  • overrides from BaseImpl + *
+ * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WorldPositionImpl: public BaseImpl, public IWorldPositionWriter, public std::enable_shared_from_this + { + private: + bool _isSetH = false; + double _h {0}; + bool _isSetP = false; + double _p {0}; + bool _isSetR = false; + double _r {0}; + bool _isSetX = false; + double _x {}; + bool _isSetY = false; + double _y {}; + bool _isSetZ = false; + double _z {0}; + + public: + + virtual void ResolveDoubleExpression(std::string& attributeKey, double& value) override; + OPENSCENARIOLIB_EXP WorldPositionImpl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + OPENSCENARIOLIB_EXP double GetH() const override; + OPENSCENARIOLIB_EXP double GetP() const override; + OPENSCENARIOLIB_EXP double GetR() const override; + OPENSCENARIOLIB_EXP double GetX() const override; + OPENSCENARIOLIB_EXP double GetY() const override; + OPENSCENARIOLIB_EXP double GetZ() const override; + + + OPENSCENARIOLIB_EXP void SetH(const double h) override; + + OPENSCENARIOLIB_EXP void SetP(const double p) override; + + OPENSCENARIOLIB_EXP void SetR(const double r) override; + + OPENSCENARIOLIB_EXP void SetX(const double x) override; + + OPENSCENARIOLIB_EXP void SetY(const double y) override; + + OPENSCENARIOLIB_EXP void SetZ(const double z) override; + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + + OPENSCENARIOLIB_EXP void WriteParameterToH(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToP(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToR(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToX(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToY(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP void WriteParameterToZ(std::string& parameterName) override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromH() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromP() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromR() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromX() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromY() const override; + + OPENSCENARIOLIB_EXP std::string GetParameterFromZ() const override; + + OPENSCENARIOLIB_EXP bool IsHParameterized() override; + OPENSCENARIOLIB_EXP bool IsPParameterized() override; + OPENSCENARIOLIB_EXP bool IsRParameterized() override; + OPENSCENARIOLIB_EXP bool IsXParameterized() override; + OPENSCENARIOLIB_EXP bool IsYParameterized() override; + OPENSCENARIOLIB_EXP bool IsZParameterized() override; + // children + OPENSCENARIOLIB_EXP virtual void ResetH() override; + OPENSCENARIOLIB_EXP virtual bool IsSetH() const override; + OPENSCENARIOLIB_EXP virtual void ResetP() override; + OPENSCENARIOLIB_EXP virtual bool IsSetP() const override; + OPENSCENARIOLIB_EXP virtual void ResetR() override; + OPENSCENARIOLIB_EXP virtual bool IsSetR() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetX() const override; + OPENSCENARIOLIB_EXP virtual bool IsSetY() const override; + OPENSCENARIOLIB_EXP virtual void ResetZ() override; + OPENSCENARIOLIB_EXP virtual bool IsSetZ() const override; + }; + + + } +} + diff --git a/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.cpp b/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.cpp new file mode 100644 index 00000000..6a29c64a --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.cpp @@ -0,0 +1,1506 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "OpenScenarioWriterFactoryImplV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * An interface with a factory method for each OpenSCENARIO class + * + * @author RA Consulting OpenSCENARIO generation facility + */ + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAbsoluteSpeedWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAbsoluteTargetLaneWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAbsoluteTargetLaneOffsetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAbsoluteTargetSpeedWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAccelerationConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAcquirePositionActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateActWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateActivateControllerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateActorsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAddEntityActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAngleConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAnimationActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAnimationFileWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAnimationStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAnimationTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAppearanceActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAssignControllerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAssignRouteActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAutomaticGearWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAxleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateAxlesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateBoundingBoxWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateBrakeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateBrakeInputWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateByEntityConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateByObjectTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateByTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateByValueConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCatalogWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCatalogDefinitionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCatalogLocationsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCatalogReferenceWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCenterWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCentralSwarmObjectWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateClothoidWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateClothoidSplineWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateClothoidSplineSegmentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCollisionConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateColorWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateColorCmykWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateColorRgbWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateComponentAnimationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateConditionGroupWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateConnectTrailerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControlPointWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControllerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControllerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControllerCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControllerDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateControllerDistributionEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCustomCommandActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateCustomContentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeleteEntityActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicMultiParameterDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicMultiParameterDistributionTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicParameterDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicSingleParameterDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDeterministicSingleParameterDistributionTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDimensionsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDirectionOfTravelDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDirectoryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDisconnectTrailerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDistanceConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDistributionDefinitionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDistributionRangeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDistributionSetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDistributionSetElementWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDomeImageWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateDynamicConstraintsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEndOfRoadConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntitiesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityDistributionEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityObjectWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntityRefWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEntitySelectionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEnvironmentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEnvironmentActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEnvironmentCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateEventWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateExternalObjectReferenceWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateFileWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateFileHeaderWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateFinalSpeedWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateFogWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateFollowTrajectoryActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateGearWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateGeoPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateGlobalActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateHistogramWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateHistogramBinWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateInRoutePositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateInfrastructureActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateInitWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateInitActionsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateKnotWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneChangeActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneChangeTargetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneOffsetActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneOffsetActionDynamicsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLaneOffsetTargetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLanePositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLateralActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLateralDistanceActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLicenseWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLightStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLightStateActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLightTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLogNormalDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLongitudinalActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateLongitudinalDistanceActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateManeuverWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateManeuverCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateManeuverGroupWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateManualGearWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateMiscObjectWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateMiscObjectCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateModifyRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateMonitorDeclarationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateNoneWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateNormalDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateNurbsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateObjectControllerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOffroadConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOpenScenarioWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOpenScenarioCategoryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOrientationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideBrakeActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideClutchActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideControllerValueActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideGearActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideParkingBrakeActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideSteeringWheelActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateOverrideThrottleActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterAddValueRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterAssignmentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterDeclarationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterModifyActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterMultiplyByValueRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterSetActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterValueDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterValueDistributionDefinitionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateParameterValueSetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePedestrianWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePedestrianAnimationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePedestrianCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePedestrianGestureWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePerformanceWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePhaseWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePoissonDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePolygonWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePolylineWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePositionInLaneCoordinatesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePositionInRoadCoordinatesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePositionOfCurrentEntityWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePrecipitationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePrivateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePrivateActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateProbabilityDistributionSetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateProbabilityDistributionSetElementWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePropertiesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreatePropertyWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRandomRouteActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRangeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateReachPositionConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeAngleConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeClearanceConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeDistanceConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeLanePositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeLaneRangeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeObjectPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeRoadPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeSpeedConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeSpeedToMasterWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeTargetLaneWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeTargetLaneOffsetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeTargetSpeedWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRelativeWorldPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoadConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoadCursorWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoadNetworkWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoadPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoadRangeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRouteWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRouteCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoutePositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRouteRefWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateRoutingActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateScenarioDefinitionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateScenarioObjectWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateScenarioObjectTemplateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSelectedEntitiesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSensorReferenceWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSensorReferenceSetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSetMonitorActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateShapeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSimulationTimeConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSpeedActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSpeedActionTargetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSpeedConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSpeedProfileActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSpeedProfileEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStandStillConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSteadyStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStochasticWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStochasticDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStochasticDistributionTypeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStoryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStoryboardWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateStoryboardElementStateConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSunWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateSynchronizeActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTargetDistanceSteadyStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTargetTimeSteadyStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTeleportActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeHeadwayConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeOfDayWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeOfDayConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeReferenceWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeToCollisionConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimeToCollisionConditionTargetWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTimingWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficAreaWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficAreaActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficDefinitionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficDistributionEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalControllerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalControllerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalControllerConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalGroupStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalStateWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSignalStateActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSinkActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSourceActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficStopActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrafficSwarmActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrailerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrailerActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrailerCouplerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrailerHitchWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrajectoryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrajectoryCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrajectoryFollowingModeWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrajectoryPositionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTrajectoryRefWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTransitionDynamicsWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTraveledDistanceConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTriggerWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateTriggeringEntitiesWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUniformDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUsedAreaWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedAnimationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedComponentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedLightWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateUserDefinedValueConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateValueConstraintWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateValueConstraintGroupWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateValueSetDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableAddValueRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableConditionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableDeclarationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableModifyActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableModifyRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableMultiplyByValueRuleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVariableSetActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleCatalogLocationWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleCategoryDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleCategoryDistributionEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleComponentWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleLightWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleRoleDistributionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVehicleRoleDistributionEntryWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVertexWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateVisibilityActionWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateWaypointWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateWeatherWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateWindWriter() + { + return std::make_shared(); + } + + std::shared_ptr OpenScenarioWriterFactoryImpl::CreateWorldPositionWriter() + { + return std::make_shared(); + } + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.h b/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.h new file mode 100644 index 00000000..51284231 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.h @@ -0,0 +1,629 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "ApiClassImplV1_3.h" +#include "IOpenScenarioWriterFactoryV1_3.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * An interface with a factory method for each OpenSCENARIO class + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioWriterFactoryImpl: public IOpenScenarioWriterFactory + { + public: + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAbsoluteSpeedWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAbsoluteTargetLaneWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAbsoluteTargetLaneOffsetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAbsoluteTargetSpeedWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAccelerationConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAcquirePositionActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateActWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateActivateControllerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateActorsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAddEntityActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAngleConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAnimationActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAnimationFileWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAnimationStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAnimationTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAppearanceActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAssignControllerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAssignRouteActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAutomaticGearWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAxleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateAxlesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateBoundingBoxWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateBrakeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateBrakeInputWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateByEntityConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateByObjectTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateByTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateByValueConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCatalogWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCatalogDefinitionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCatalogLocationsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCatalogReferenceWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCenterWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCentralSwarmObjectWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateClothoidWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateClothoidSplineWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateClothoidSplineSegmentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCollisionConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateColorWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateColorCmykWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateColorRgbWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateComponentAnimationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateConditionGroupWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateConnectTrailerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControlPointWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControllerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControllerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControllerCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControllerDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateControllerDistributionEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCustomCommandActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateCustomContentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeleteEntityActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicMultiParameterDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicMultiParameterDistributionTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicParameterDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicSingleParameterDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDeterministicSingleParameterDistributionTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDimensionsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDirectionOfTravelDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDirectoryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDisconnectTrailerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDistanceConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDistributionDefinitionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDistributionRangeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDistributionSetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDistributionSetElementWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDomeImageWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateDynamicConstraintsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEndOfRoadConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntitiesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityDistributionEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityObjectWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntityRefWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEntitySelectionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEnvironmentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEnvironmentActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEnvironmentCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateEventWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateExternalObjectReferenceWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateFileWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateFileHeaderWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateFinalSpeedWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateFogWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateFollowTrajectoryActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateGearWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateGeoPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateGlobalActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateHistogramWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateHistogramBinWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateInRoutePositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateInfrastructureActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateInitWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateInitActionsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateKnotWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneChangeActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneChangeTargetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneOffsetActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneOffsetActionDynamicsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLaneOffsetTargetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLanePositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLateralActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLateralDistanceActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLicenseWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLightStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLightStateActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLightTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLogNormalDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLongitudinalActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLongitudinalDistanceActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateManeuverWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateManeuverCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateManeuverGroupWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateManualGearWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateMiscObjectWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateMiscObjectCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateModifyRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateMonitorDeclarationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateNoneWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateNormalDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateNurbsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateObjectControllerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOffroadConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOpenScenarioWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOpenScenarioCategoryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOrientationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideBrakeActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideClutchActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideControllerValueActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideGearActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideParkingBrakeActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideSteeringWheelActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateOverrideThrottleActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterAddValueRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterAssignmentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterDeclarationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterModifyActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterMultiplyByValueRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterSetActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterValueDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterValueDistributionDefinitionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateParameterValueSetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePedestrianWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePedestrianAnimationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePedestrianCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePedestrianGestureWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePerformanceWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePhaseWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePoissonDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePolygonWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePolylineWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePositionInLaneCoordinatesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePositionInRoadCoordinatesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePositionOfCurrentEntityWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePrecipitationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePrivateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePrivateActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateProbabilityDistributionSetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateProbabilityDistributionSetElementWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePropertiesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreatePropertyWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRandomRouteActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRangeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateReachPositionConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeAngleConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeClearanceConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeDistanceConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeLanePositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeLaneRangeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeObjectPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeRoadPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeSpeedConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeSpeedToMasterWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeTargetLaneWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeTargetLaneOffsetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeTargetSpeedWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRelativeWorldPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoadConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoadCursorWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoadNetworkWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoadPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoadRangeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRouteWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRouteCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoutePositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRouteRefWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateRoutingActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateScenarioDefinitionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateScenarioObjectWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateScenarioObjectTemplateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSelectedEntitiesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSensorReferenceWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSensorReferenceSetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSetMonitorActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateShapeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSimulationTimeConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSpeedActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSpeedActionTargetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSpeedConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSpeedProfileActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSpeedProfileEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStandStillConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSteadyStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStochasticWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStochasticDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStochasticDistributionTypeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStoryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStoryboardWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateStoryboardElementStateConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSunWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateSynchronizeActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTargetDistanceSteadyStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTargetTimeSteadyStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTeleportActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeHeadwayConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeOfDayWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeOfDayConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeReferenceWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeToCollisionConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimeToCollisionConditionTargetWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTimingWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficAreaWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficAreaActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficDefinitionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficDistributionEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalControllerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalControllerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalControllerConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalGroupStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalStateWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSignalStateActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSinkActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSourceActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficStopActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrafficSwarmActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrailerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrailerActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrailerCouplerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrailerHitchWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrajectoryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrajectoryCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrajectoryFollowingModeWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrajectoryPositionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTrajectoryRefWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTransitionDynamicsWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTraveledDistanceConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTriggerWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateTriggeringEntitiesWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUniformDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUsedAreaWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedAnimationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedComponentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedLightWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateUserDefinedValueConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateValueConstraintWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateValueConstraintGroupWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateValueSetDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableAddValueRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableConditionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableDeclarationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableModifyActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableModifyRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableMultiplyByValueRuleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVariableSetActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleCatalogLocationWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleCategoryDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleCategoryDistributionEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleComponentWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleLightWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleRoleDistributionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVehicleRoleDistributionEntryWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVertexWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateVisibilityActionWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateWaypointWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateWeatherWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateWindWriter() override; + + OPENSCENARIOLIB_EXP std::shared_ptr CreateWorldPositionWriter() override; + }; + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers1V1_3.cpp b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers1V1_3.cpp new file mode 100644 index 00000000..0067dce2 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers1V1_3.cpp @@ -0,0 +1,10119 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlParsersV1_3.h" +#include "NamedReferenceProxy.h" +#include "FileContentMessage.h" +#include "Position.h" +#include "Textmarker.h" +#include "ErrorLevel.h" +#include "WrappedListParser.h" +#include "CatalogReferenceParserContextV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AbsoluteSpeedXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AbsoluteSpeedXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AbsoluteSpeedXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AbsoluteSpeedXmlParser::SubElementSteadyStateParser::SubElementSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _steadyStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AbsoluteSpeedXmlParser::SubElementSteadyStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto steadyState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + steadyState->SetParent(object); + _steadyStateXmlParser->ParseElement(indexedElement, parserContext, steadyState); + + typedObject->SetSteadyState(steadyState); + + + } + + int AbsoluteSpeedXmlParser::SubElementSteadyStateParser::GetMinOccur() + { + return 0; + } + + int AbsoluteSpeedXmlParser::SubElementSteadyStateParser::GetMaxOccur() + { + return 1; + } + + bool AbsoluteSpeedXmlParser::SubElementSteadyStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE || + elementName == OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE ; + } + + std::vector AbsoluteSpeedXmlParser::SubElementSteadyStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE, + OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE + }; + } + + AbsoluteSpeedXmlParser::AbsoluteSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetLaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AbsoluteTargetLaneXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AbsoluteTargetLaneXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AbsoluteTargetLaneXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AbsoluteTargetLaneXmlParser::AbsoluteTargetLaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetLaneOffsetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AbsoluteTargetLaneOffsetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AbsoluteTargetLaneOffsetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AbsoluteTargetLaneOffsetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AbsoluteTargetLaneOffsetXmlParser::AbsoluteTargetLaneOffsetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AbsoluteTargetSpeedXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AbsoluteTargetSpeedXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AbsoluteTargetSpeedXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AbsoluteTargetSpeedXmlParser::AbsoluteTargetSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AccelerationConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AccelerationConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AccelerationConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDirection: public IAttributeParser, public XmlParserBase + { + public: + AttributeDirection(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(attributeValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + typedObject->SetDirection(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DirectionalDimension::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DirectionalDimension::GetDeprecatedVersion(kResult) +"'. " + DirectionalDimension::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AccelerationConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AccelerationConditionXmlParser::AccelerationConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AcquirePositionActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AcquirePositionActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> AcquirePositionActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AcquirePositionActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AcquirePositionActionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AcquirePositionActionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int AcquirePositionActionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int AcquirePositionActionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool AcquirePositionActionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector AcquirePositionActionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + AcquirePositionActionXmlParser::AcquirePositionActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ActXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ActXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ActXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ActXmlParser::SubElementManeuverGroupsParser::SubElementManeuverGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _maneuverGroupXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActXmlParser::SubElementManeuverGroupsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto maneuverGroups = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + maneuverGroups->SetParent(object); + _maneuverGroupXmlParser->ParseElement(indexedElement, parserContext, maneuverGroups); + auto maneuverGroupsList = typedObject->GetWriterManeuverGroups(); + maneuverGroupsList.push_back(maneuverGroups); + typedObject->SetManeuverGroups(maneuverGroupsList); + + + } + + int ActXmlParser::SubElementManeuverGroupsParser::GetMinOccur() + { + return 1; + } + + int ActXmlParser::SubElementManeuverGroupsParser::GetMaxOccur() + { + return -1; + } + + bool ActXmlParser::SubElementManeuverGroupsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MANEUVER_GROUP ; + } + + std::vector ActXmlParser::SubElementManeuverGroupsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MANEUVER_GROUP + }; + } + ActXmlParser::SubElementStartTriggerParser::SubElementStartTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _triggerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActXmlParser::SubElementStartTriggerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto startTrigger = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + startTrigger->SetParent(object); + _triggerXmlParser->ParseElement(indexedElement, parserContext, startTrigger); + + typedObject->SetStartTrigger(startTrigger); + + + } + + int ActXmlParser::SubElementStartTriggerParser::GetMinOccur() + { + return 0; + } + + int ActXmlParser::SubElementStartTriggerParser::GetMaxOccur() + { + return 1; + } + + bool ActXmlParser::SubElementStartTriggerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__START_TRIGGER ; + } + + std::vector ActXmlParser::SubElementStartTriggerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__START_TRIGGER + }; + } + ActXmlParser::SubElementStopTriggerParser::SubElementStopTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _triggerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActXmlParser::SubElementStopTriggerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stopTrigger = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stopTrigger->SetParent(object); + _triggerXmlParser->ParseElement(indexedElement, parserContext, stopTrigger); + + typedObject->SetStopTrigger(stopTrigger); + + + } + + int ActXmlParser::SubElementStopTriggerParser::GetMinOccur() + { + return 0; + } + + int ActXmlParser::SubElementStopTriggerParser::GetMaxOccur() + { + return 1; + } + + bool ActXmlParser::SubElementStopTriggerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STOP_TRIGGER ; + } + + std::vector ActXmlParser::SubElementStopTriggerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STOP_TRIGGER + }; + } + + ActXmlParser::ActXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ActionXmlParser::SubElementGlobalActionParser::SubElementGlobalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _globalActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActionXmlParser::SubElementGlobalActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto globalAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + globalAction->SetParent(object); + _globalActionXmlParser->ParseElement(indexedElement, parserContext, globalAction); + + typedObject->SetGlobalAction(globalAction); + + + } + + int ActionXmlParser::SubElementGlobalActionParser::GetMinOccur() + { + return 1; + } + + int ActionXmlParser::SubElementGlobalActionParser::GetMaxOccur() + { + return 1; + } + + bool ActionXmlParser::SubElementGlobalActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION ; + } + + std::vector ActionXmlParser::SubElementGlobalActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION + }; + } + ActionXmlParser::SubElementUserDefinedActionParser::SubElementUserDefinedActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActionXmlParser::SubElementUserDefinedActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedAction->SetParent(object); + _userDefinedActionXmlParser->ParseElement(indexedElement, parserContext, userDefinedAction); + + typedObject->SetUserDefinedAction(userDefinedAction); + + + } + + int ActionXmlParser::SubElementUserDefinedActionParser::GetMinOccur() + { + return 1; + } + + int ActionXmlParser::SubElementUserDefinedActionParser::GetMaxOccur() + { + return 1; + } + + bool ActionXmlParser::SubElementUserDefinedActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION ; + } + + std::vector ActionXmlParser::SubElementUserDefinedActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION + }; + } + ActionXmlParser::SubElementPrivateActionParser::SubElementPrivateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _privateActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActionXmlParser::SubElementPrivateActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto privateAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + privateAction->SetParent(object); + _privateActionXmlParser->ParseElement(indexedElement, parserContext, privateAction); + + typedObject->SetPrivateAction(privateAction); + + + } + + int ActionXmlParser::SubElementPrivateActionParser::GetMinOccur() + { + return 1; + } + + int ActionXmlParser::SubElementPrivateActionParser::GetMaxOccur() + { + return 1; + } + + bool ActionXmlParser::SubElementPrivateActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION ; + } + + std::vector ActionXmlParser::SubElementPrivateActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION + }; + } + + ActionXmlParser::ActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActivateControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ActivateControllerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ActivateControllerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAnimation: public IAttributeParser, public XmlParserBase + { + public: + AttributeAnimation(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAnimation(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeControllerRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeControllerRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetControllerRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.3'. Comment: 'Use objectControllerRef instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLateral: public IAttributeParser, public XmlParserBase + { + public: + AttributeLateral(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATERAL, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLateral(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LATERAL, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LATERAL, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LATERAL, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLighting: public IAttributeParser, public XmlParserBase + { + public: + AttributeLighting(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLighting(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LIGHTING, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLongitudinal: public IAttributeParser, public XmlParserBase + { + public: + AttributeLongitudinal(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLongitudinal(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LONGITUDINAL, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeObjectControllerRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeObjectControllerRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetObjectControllerRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OBJECT_CONTROLLER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ActivateControllerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ActivateControllerActionXmlParser::ActivateControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActorsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ActorsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ActorsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeSelectTriggeringEntities: public IAttributeParser, public XmlParserBase + { + public: + AttributeSelectTriggeringEntities(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSelectTriggeringEntities(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SELECT_TRIGGERING_ENTITIES, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ActorsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ActorsXmlParser::SubElementEntityRefsParser::SubElementEntityRefsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ActorsXmlParser::SubElementEntityRefsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRefs = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRefs->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRefs); + auto entityRefsList = typedObject->GetWriterEntityRefs(); + entityRefsList.push_back(entityRefs); + typedObject->SetEntityRefs(entityRefsList); + + + } + + int ActorsXmlParser::SubElementEntityRefsParser::GetMinOccur() + { + return 0; + } + + int ActorsXmlParser::SubElementEntityRefsParser::GetMaxOccur() + { + return -1; + } + + bool ActorsXmlParser::SubElementEntityRefsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector ActorsXmlParser::SubElementEntityRefsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + + ActorsXmlParser::ActorsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AddEntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AddEntityActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> AddEntityActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AddEntityActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AddEntityActionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AddEntityActionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int AddEntityActionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int AddEntityActionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool AddEntityActionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector AddEntityActionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + AddEntityActionXmlParser::AddEntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AngleConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AngleConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AngleConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAngle: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngle(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAngle(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeAngleTolerance: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngleTolerance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAngleTolerance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeAngleType: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngleType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = AngleType::GetFromLiteral(attributeValue); + if (kResult != AngleType::UNKNOWN) + { + typedObject->SetAngleType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (AngleType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + AngleType::GetDeprecatedVersion(kResult) +"'. " + AngleType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AngleConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AngleConditionXmlParser::AngleConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AnimationActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AnimationActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAnimationDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeAnimationDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAnimationDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANIMATION_DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLoop: public IAttributeParser, public XmlParserBase + { + public: + AttributeLoop(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOOP, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLoop(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LOOP, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LOOP, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LOOP, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AnimationActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AnimationActionXmlParser::SubElementAnimationTypeParser::SubElementAnimationTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _animationTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationActionXmlParser::SubElementAnimationTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto animationType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + animationType->SetParent(object); + _animationTypeXmlParser->ParseElement(indexedElement, parserContext, animationType); + + typedObject->SetAnimationType(animationType); + + + } + + int AnimationActionXmlParser::SubElementAnimationTypeParser::GetMinOccur() + { + return 1; + } + + int AnimationActionXmlParser::SubElementAnimationTypeParser::GetMaxOccur() + { + return 1; + } + + bool AnimationActionXmlParser::SubElementAnimationTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ANIMATION_TYPE ; + } + + std::vector AnimationActionXmlParser::SubElementAnimationTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ANIMATION_TYPE + }; + } + AnimationActionXmlParser::SubElementAnimationStateParser::SubElementAnimationStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _animationStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationActionXmlParser::SubElementAnimationStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto animationState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + animationState->SetParent(object); + _animationStateXmlParser->ParseElement(indexedElement, parserContext, animationState); + + typedObject->SetAnimationState(animationState); + + + } + + int AnimationActionXmlParser::SubElementAnimationStateParser::GetMinOccur() + { + return 0; + } + + int AnimationActionXmlParser::SubElementAnimationStateParser::GetMaxOccur() + { + return 1; + } + + bool AnimationActionXmlParser::SubElementAnimationStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ANIMATION_STATE ; + } + + std::vector AnimationActionXmlParser::SubElementAnimationStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ANIMATION_STATE + }; + } + + AnimationActionXmlParser::AnimationActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationFileImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AnimationFileXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AnimationFileXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTimeOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeTimeOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTimeOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AnimationFileXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AnimationFileXmlParser::SubElementFileParser::SubElementFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationFileXmlParser::SubElementFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto file = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + file->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, file); + + typedObject->SetFile(file); + + + } + + int AnimationFileXmlParser::SubElementFileParser::GetMinOccur() + { + return 1; + } + + int AnimationFileXmlParser::SubElementFileParser::GetMaxOccur() + { + return 1; + } + + bool AnimationFileXmlParser::SubElementFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FILE ; + } + + std::vector AnimationFileXmlParser::SubElementFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FILE + }; + } + + AnimationFileXmlParser::AnimationFileXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AnimationStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AnimationStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetState(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AnimationStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AnimationStateXmlParser::AnimationStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AnimationTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> AnimationTypeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AnimationTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AnimationTypeXmlParser::SubElementComponentAnimationParser::SubElementComponentAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _componentAnimationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationTypeXmlParser::SubElementComponentAnimationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto componentAnimation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + componentAnimation->SetParent(object); + _componentAnimationXmlParser->ParseElement(indexedElement, parserContext, componentAnimation); + + typedObject->SetComponentAnimation(componentAnimation); + + + } + + int AnimationTypeXmlParser::SubElementComponentAnimationParser::GetMinOccur() + { + return 1; + } + + int AnimationTypeXmlParser::SubElementComponentAnimationParser::GetMaxOccur() + { + return 1; + } + + bool AnimationTypeXmlParser::SubElementComponentAnimationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION ; + } + + std::vector AnimationTypeXmlParser::SubElementComponentAnimationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__COMPONENT_ANIMATION + }; + } + AnimationTypeXmlParser::SubElementPedestrianAnimationParser::SubElementPedestrianAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _pedestrianAnimationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationTypeXmlParser::SubElementPedestrianAnimationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto pedestrianAnimation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + pedestrianAnimation->SetParent(object); + _pedestrianAnimationXmlParser->ParseElement(indexedElement, parserContext, pedestrianAnimation); + + typedObject->SetPedestrianAnimation(pedestrianAnimation); + + + } + + int AnimationTypeXmlParser::SubElementPedestrianAnimationParser::GetMinOccur() + { + return 1; + } + + int AnimationTypeXmlParser::SubElementPedestrianAnimationParser::GetMaxOccur() + { + return 1; + } + + bool AnimationTypeXmlParser::SubElementPedestrianAnimationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION ; + } + + std::vector AnimationTypeXmlParser::SubElementPedestrianAnimationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PEDESTRIAN_ANIMATION + }; + } + AnimationTypeXmlParser::SubElementAnimationFileParser::SubElementAnimationFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _animationFileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationTypeXmlParser::SubElementAnimationFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto animationFile = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + animationFile->SetParent(object); + _animationFileXmlParser->ParseElement(indexedElement, parserContext, animationFile); + + typedObject->SetAnimationFile(animationFile); + + + } + + int AnimationTypeXmlParser::SubElementAnimationFileParser::GetMinOccur() + { + return 1; + } + + int AnimationTypeXmlParser::SubElementAnimationFileParser::GetMaxOccur() + { + return 1; + } + + bool AnimationTypeXmlParser::SubElementAnimationFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ANIMATION_FILE ; + } + + std::vector AnimationTypeXmlParser::SubElementAnimationFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ANIMATION_FILE + }; + } + AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::SubElementUserDefinedAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedAnimationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedAnimation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedAnimation->SetParent(object); + _userDefinedAnimationXmlParser->ParseElement(indexedElement, parserContext, userDefinedAnimation); + + typedObject->SetUserDefinedAnimation(userDefinedAnimation); + + + } + + int AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::GetMinOccur() + { + return 1; + } + + int AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::GetMaxOccur() + { + return 1; + } + + bool AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION ; + } + + std::vector AnimationTypeXmlParser::SubElementUserDefinedAnimationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_ANIMATION + }; + } + + AnimationTypeXmlParser::AnimationTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AppearanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AppearanceActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> AppearanceActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AppearanceActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AppearanceActionXmlParser::SubElementLightStateActionParser::SubElementLightStateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lightStateActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AppearanceActionXmlParser::SubElementLightStateActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lightStateAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lightStateAction->SetParent(object); + _lightStateActionXmlParser->ParseElement(indexedElement, parserContext, lightStateAction); + + typedObject->SetLightStateAction(lightStateAction); + + + } + + int AppearanceActionXmlParser::SubElementLightStateActionParser::GetMinOccur() + { + return 1; + } + + int AppearanceActionXmlParser::SubElementLightStateActionParser::GetMaxOccur() + { + return 1; + } + + bool AppearanceActionXmlParser::SubElementLightStateActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION ; + } + + std::vector AppearanceActionXmlParser::SubElementLightStateActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LIGHT_STATE_ACTION + }; + } + AppearanceActionXmlParser::SubElementAnimationActionParser::SubElementAnimationActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _animationActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AppearanceActionXmlParser::SubElementAnimationActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto animationAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + animationAction->SetParent(object); + _animationActionXmlParser->ParseElement(indexedElement, parserContext, animationAction); + + typedObject->SetAnimationAction(animationAction); + + + } + + int AppearanceActionXmlParser::SubElementAnimationActionParser::GetMinOccur() + { + return 1; + } + + int AppearanceActionXmlParser::SubElementAnimationActionParser::GetMaxOccur() + { + return 1; + } + + bool AppearanceActionXmlParser::SubElementAnimationActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION ; + } + + std::vector AppearanceActionXmlParser::SubElementAnimationActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ANIMATION_ACTION + }; + } + + AppearanceActionXmlParser::AppearanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AssignControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AssignControllerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> AssignControllerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActivateAnimation: public IAttributeParser, public XmlParserBase + { + public: + AttributeActivateAnimation(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActivateAnimation(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_ANIMATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeActivateLateral: public IAttributeParser, public XmlParserBase + { + public: + AttributeActivateLateral(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActivateLateral(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LATERAL, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeActivateLighting: public IAttributeParser, public XmlParserBase + { + public: + AttributeActivateLighting(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActivateLighting(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LIGHTING, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeActivateLongitudinal: public IAttributeParser, public XmlParserBase + { + public: + AttributeActivateLongitudinal(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActivateLongitudinal(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVATE_LONGITUDINAL, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AssignControllerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AssignControllerActionXmlParser::SubElementControllerParser::SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AssignControllerActionXmlParser::SubElementControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controller = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controller->SetParent(object); + _controllerXmlParser->ParseElement(indexedElement, parserContext, controller); + + typedObject->SetController(controller); + + + if (!_controllerXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.3'. Comment: 'Use objectController instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _controllerXmlParser->_filename)); + _controllerXmlParser->_messageLogger.LogMessage(msg); + } + } + + int AssignControllerActionXmlParser::SubElementControllerParser::GetMinOccur() + { + return 0; + } + + int AssignControllerActionXmlParser::SubElementControllerParser::GetMaxOccur() + { + return 1; + } + + bool AssignControllerActionXmlParser::SubElementControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER ; + } + + std::vector AssignControllerActionXmlParser::SubElementControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER + }; + } + AssignControllerActionXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AssignControllerActionXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + if (!_catalogReferenceXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.3'. Comment: 'Use objectController instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _catalogReferenceXmlParser->_filename)); + _catalogReferenceXmlParser->_messageLogger.LogMessage(msg); + } + } + + int AssignControllerActionXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 0; + } + + int AssignControllerActionXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool AssignControllerActionXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector AssignControllerActionXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + AssignControllerActionXmlParser::SubElementObjectControllerParser::SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _objectControllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AssignControllerActionXmlParser::SubElementObjectControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto objectController = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + objectController->SetParent(object); + _objectControllerXmlParser->ParseElement(indexedElement, parserContext, objectController); + + typedObject->SetObjectController(objectController); + + + } + + int AssignControllerActionXmlParser::SubElementObjectControllerParser::GetMinOccur() + { + return 0; + } + + int AssignControllerActionXmlParser::SubElementObjectControllerParser::GetMaxOccur() + { + return 1; + } + + bool AssignControllerActionXmlParser::SubElementObjectControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER ; + } + + std::vector AssignControllerActionXmlParser::SubElementObjectControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER + }; + } + + AssignControllerActionXmlParser::AssignControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AssignRouteActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AssignRouteActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> AssignRouteActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AssignRouteActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AssignRouteActionXmlParser::SubElementRouteParser::SubElementRouteParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AssignRouteActionXmlParser::SubElementRouteParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto route = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + route->SetParent(object); + _routeXmlParser->ParseElement(indexedElement, parserContext, route); + + typedObject->SetRoute(route); + + + } + + int AssignRouteActionXmlParser::SubElementRouteParser::GetMinOccur() + { + return 1; + } + + int AssignRouteActionXmlParser::SubElementRouteParser::GetMaxOccur() + { + return 1; + } + + bool AssignRouteActionXmlParser::SubElementRouteParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE ; + } + + std::vector AssignRouteActionXmlParser::SubElementRouteParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE + }; + } + AssignRouteActionXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AssignRouteActionXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int AssignRouteActionXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int AssignRouteActionXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool AssignRouteActionXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector AssignRouteActionXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + + AssignRouteActionXmlParser::AssignRouteActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AutomaticGearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AutomaticGearXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AutomaticGearXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeGear: public IAttributeParser, public XmlParserBase + { + public: + AttributeGear(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GEAR, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = AutomaticGearType::GetFromLiteral(attributeValue); + if (kResult != AutomaticGearType::UNKNOWN) + { + typedObject->SetGear(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (AutomaticGearType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + AutomaticGearType::GetDeprecatedVersion(kResult) +"'. " + AutomaticGearType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__GEAR, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__GEAR, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__GEAR, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AutomaticGearXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AutomaticGearXmlParser::AutomaticGearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AxleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AxleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AxleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaxSteering: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxSteering(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxSteering(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_STEERING, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePositionX: public IAttributeParser, public XmlParserBase + { + public: + AttributePositionX(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPositionX(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__POSITION_X, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePositionZ: public IAttributeParser, public XmlParserBase + { + public: + AttributePositionZ(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPositionZ(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__POSITION_Z, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTrackWidth: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrackWidth(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTrackWidth(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRACK_WIDTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWheelDiameter: public IAttributeParser, public XmlParserBase + { + public: + AttributeWheelDiameter(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWheelDiameter(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WHEEL_DIAMETER, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> AxleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + AxleXmlParser::AxleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AxlesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + AxlesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> AxlesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> AxlesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + AxlesXmlParser::SubElementFrontAxleParser::SubElementFrontAxleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _axleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AxlesXmlParser::SubElementFrontAxleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto frontAxle = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + frontAxle->SetParent(object); + _axleXmlParser->ParseElement(indexedElement, parserContext, frontAxle); + + typedObject->SetFrontAxle(frontAxle); + + + } + + int AxlesXmlParser::SubElementFrontAxleParser::GetMinOccur() + { + return 0; + } + + int AxlesXmlParser::SubElementFrontAxleParser::GetMaxOccur() + { + return 1; + } + + bool AxlesXmlParser::SubElementFrontAxleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FRONT_AXLE ; + } + + std::vector AxlesXmlParser::SubElementFrontAxleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FRONT_AXLE + }; + } + AxlesXmlParser::SubElementRearAxleParser::SubElementRearAxleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _axleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AxlesXmlParser::SubElementRearAxleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto rearAxle = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + rearAxle->SetParent(object); + _axleXmlParser->ParseElement(indexedElement, parserContext, rearAxle); + + typedObject->SetRearAxle(rearAxle); + + + } + + int AxlesXmlParser::SubElementRearAxleParser::GetMinOccur() + { + return 1; + } + + int AxlesXmlParser::SubElementRearAxleParser::GetMaxOccur() + { + return 1; + } + + bool AxlesXmlParser::SubElementRearAxleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__REAR_AXLE ; + } + + std::vector AxlesXmlParser::SubElementRearAxleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__REAR_AXLE + }; + } + AxlesXmlParser::SubElementAdditionalAxlesParser::SubElementAdditionalAxlesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _axleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void AxlesXmlParser::SubElementAdditionalAxlesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto additionalAxles = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + additionalAxles->SetParent(object); + _axleXmlParser->ParseElement(indexedElement, parserContext, additionalAxles); + auto additionalAxlesList = typedObject->GetWriterAdditionalAxles(); + additionalAxlesList.push_back(additionalAxles); + typedObject->SetAdditionalAxles(additionalAxlesList); + + + } + + int AxlesXmlParser::SubElementAdditionalAxlesParser::GetMinOccur() + { + return 0; + } + + int AxlesXmlParser::SubElementAdditionalAxlesParser::GetMaxOccur() + { + return -1; + } + + bool AxlesXmlParser::SubElementAdditionalAxlesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ADDITIONAL_AXLE ; + } + + std::vector AxlesXmlParser::SubElementAdditionalAxlesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ADDITIONAL_AXLE + }; + } + + AxlesXmlParser::AxlesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BoundingBoxImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + BoundingBoxXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> BoundingBoxXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> BoundingBoxXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + BoundingBoxXmlParser::SubElementCenterParser::SubElementCenterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _centerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void BoundingBoxXmlParser::SubElementCenterParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto center = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + center->SetParent(object); + _centerXmlParser->ParseElement(indexedElement, parserContext, center); + + typedObject->SetCenter(center); + + + } + + int BoundingBoxXmlParser::SubElementCenterParser::GetMinOccur() + { + return 1; + } + + int BoundingBoxXmlParser::SubElementCenterParser::GetMaxOccur() + { + return 1; + } + + bool BoundingBoxXmlParser::SubElementCenterParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CENTER ; + } + + std::vector BoundingBoxXmlParser::SubElementCenterParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CENTER + }; + } + BoundingBoxXmlParser::SubElementDimensionsParser::SubElementDimensionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _dimensionsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void BoundingBoxXmlParser::SubElementDimensionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto dimensions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + dimensions->SetParent(object); + _dimensionsXmlParser->ParseElement(indexedElement, parserContext, dimensions); + + typedObject->SetDimensions(dimensions); + + + } + + int BoundingBoxXmlParser::SubElementDimensionsParser::GetMinOccur() + { + return 1; + } + + int BoundingBoxXmlParser::SubElementDimensionsParser::GetMaxOccur() + { + return 1; + } + + bool BoundingBoxXmlParser::SubElementDimensionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIMENSIONS ; + } + + std::vector BoundingBoxXmlParser::SubElementDimensionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIMENSIONS + }; + } + + BoundingBoxXmlParser::BoundingBoxXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BrakeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + BrakeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> BrakeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaxRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> BrakeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + BrakeXmlParser::BrakeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BrakeInputImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + BrakeInputXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> BrakeInputXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + BrakeInputXmlParser::SubElementBrakePercentParser::SubElementBrakePercentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _brakeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void BrakeInputXmlParser::SubElementBrakePercentParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto brakePercent = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + brakePercent->SetParent(object); + _brakeXmlParser->ParseElement(indexedElement, parserContext, brakePercent); + + typedObject->SetBrakePercent(brakePercent); + + + } + + int BrakeInputXmlParser::SubElementBrakePercentParser::GetMinOccur() + { + return 1; + } + + int BrakeInputXmlParser::SubElementBrakePercentParser::GetMaxOccur() + { + return 1; + } + + bool BrakeInputXmlParser::SubElementBrakePercentParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT ; + } + + std::vector BrakeInputXmlParser::SubElementBrakePercentParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT + }; + } + BrakeInputXmlParser::SubElementBrakeForceParser::SubElementBrakeForceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _brakeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void BrakeInputXmlParser::SubElementBrakeForceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto brakeForce = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + brakeForce->SetParent(object); + _brakeXmlParser->ParseElement(indexedElement, parserContext, brakeForce); + + typedObject->SetBrakeForce(brakeForce); + + + } + + int BrakeInputXmlParser::SubElementBrakeForceParser::GetMinOccur() + { + return 1; + } + + int BrakeInputXmlParser::SubElementBrakeForceParser::GetMaxOccur() + { + return 1; + } + + bool BrakeInputXmlParser::SubElementBrakeForceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_FORCE ; + } + + std::vector BrakeInputXmlParser::SubElementBrakeForceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BRAKE_FORCE + }; + } + + BrakeInputXmlParser::BrakeInputXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByEntityConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ByEntityConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ByEntityConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ByEntityConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::SubElementTriggeringEntitiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _triggeringEntitiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto triggeringEntities = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + triggeringEntities->SetParent(object); + _triggeringEntitiesXmlParser->ParseElement(indexedElement, parserContext, triggeringEntities); + + typedObject->SetTriggeringEntities(triggeringEntities); + + + } + + int ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::GetMinOccur() + { + return 1; + } + + int ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::GetMaxOccur() + { + return 1; + } + + bool ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRIGGERING_ENTITIES ; + } + + std::vector ByEntityConditionXmlParser::SubElementTriggeringEntitiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRIGGERING_ENTITIES + }; + } + ByEntityConditionXmlParser::SubElementEntityConditionParser::SubElementEntityConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByEntityConditionXmlParser::SubElementEntityConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityCondition->SetParent(object); + _entityConditionXmlParser->ParseElement(indexedElement, parserContext, entityCondition); + + typedObject->SetEntityCondition(entityCondition); + + + } + + int ByEntityConditionXmlParser::SubElementEntityConditionParser::GetMinOccur() + { + return 1; + } + + int ByEntityConditionXmlParser::SubElementEntityConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByEntityConditionXmlParser::SubElementEntityConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_CONDITION ; + } + + std::vector ByEntityConditionXmlParser::SubElementEntityConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_CONDITION + }; + } + + ByEntityConditionXmlParser::ByEntityConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByObjectTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ByObjectTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ByObjectTypeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeType: public IAttributeParser, public XmlParserBase + { + public: + AttributeType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ObjectType::GetFromLiteral(attributeValue); + if (kResult != ObjectType::UNKNOWN) + { + typedObject->SetType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ObjectType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ObjectType::GetDeprecatedVersion(kResult) +"'. " + ObjectType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ByObjectTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ByObjectTypeXmlParser::ByObjectTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ByTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ByTypeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeObjectType: public IAttributeParser, public XmlParserBase + { + public: + AttributeObjectType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ObjectType::GetFromLiteral(attributeValue); + if (kResult != ObjectType::UNKNOWN) + { + typedObject->SetObjectType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ObjectType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ObjectType::GetDeprecatedVersion(kResult) +"'. " + ObjectType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OBJECT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ByTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ByTypeXmlParser::ByTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByValueConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ByValueConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ByValueConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ByValueConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ByValueConditionXmlParser::SubElementParameterConditionParser::SubElementParameterConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementParameterConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterCondition->SetParent(object); + _parameterConditionXmlParser->ParseElement(indexedElement, parserContext, parameterCondition); + + typedObject->SetParameterCondition(parameterCondition); + + + } + + int ByValueConditionXmlParser::SubElementParameterConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementParameterConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementParameterConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementParameterConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_CONDITION + }; + } + ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::SubElementTimeOfDayConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeOfDayConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeOfDayCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeOfDayCondition->SetParent(object); + _timeOfDayConditionXmlParser->ParseElement(indexedElement, parserContext, timeOfDayCondition); + + typedObject->SetTimeOfDayCondition(timeOfDayCondition); + + + } + + int ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementTimeOfDayConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_OF_DAY_CONDITION + }; + } + ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::SubElementSimulationTimeConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _simulationTimeConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto simulationTimeCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + simulationTimeCondition->SetParent(object); + _simulationTimeConditionXmlParser->ParseElement(indexedElement, parserContext, simulationTimeCondition); + + typedObject->SetSimulationTimeCondition(simulationTimeCondition); + + + } + + int ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementSimulationTimeConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SIMULATION_TIME_CONDITION + }; + } + ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::SubElementStoryboardElementStateConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _storyboardElementStateConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto storyboardElementStateCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + storyboardElementStateCondition->SetParent(object); + _storyboardElementStateConditionXmlParser->ParseElement(indexedElement, parserContext, storyboardElementStateCondition); + + typedObject->SetStoryboardElementStateCondition(storyboardElementStateCondition); + + + } + + int ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementStoryboardElementStateConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STORYBOARD_ELEMENT_STATE_CONDITION + }; + } + ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::SubElementUserDefinedValueConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedValueConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedValueCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedValueCondition->SetParent(object); + _userDefinedValueConditionXmlParser->ParseElement(indexedElement, parserContext, userDefinedValueCondition); + + typedObject->SetUserDefinedValueCondition(userDefinedValueCondition); + + + } + + int ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementUserDefinedValueConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_VALUE_CONDITION + }; + } + ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::SubElementTrafficSignalConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalCondition->SetParent(object); + _trafficSignalConditionXmlParser->ParseElement(indexedElement, parserContext, trafficSignalCondition); + + typedObject->SetTrafficSignalCondition(trafficSignalCondition); + + + } + + int ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementTrafficSignalConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONDITION + }; + } + ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::SubElementTrafficSignalControllerConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalControllerConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalControllerCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalControllerCondition->SetParent(object); + _trafficSignalControllerConditionXmlParser->ParseElement(indexedElement, parserContext, trafficSignalControllerCondition); + + typedObject->SetTrafficSignalControllerCondition(trafficSignalControllerCondition); + + + } + + int ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementTrafficSignalControllerConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_CONDITION + }; + } + ByValueConditionXmlParser::SubElementVariableConditionParser::SubElementVariableConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ByValueConditionXmlParser::SubElementVariableConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto variableCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + variableCondition->SetParent(object); + _variableConditionXmlParser->ParseElement(indexedElement, parserContext, variableCondition); + + typedObject->SetVariableCondition(variableCondition); + + + } + + int ByValueConditionXmlParser::SubElementVariableConditionParser::GetMinOccur() + { + return 1; + } + + int ByValueConditionXmlParser::SubElementVariableConditionParser::GetMaxOccur() + { + return 1; + } + + bool ByValueConditionXmlParser::SubElementVariableConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION ; + } + + std::vector ByValueConditionXmlParser::SubElementVariableConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VARIABLE_CONDITION + }; + } + + ByValueConditionXmlParser::ByValueConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CatalogXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> CatalogXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> CatalogXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + CatalogXmlParser::SubElementVehiclesParser::SubElementVehiclesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementVehiclesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicles = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicles->SetParent(object); + _vehicleXmlParser->ParseElement(indexedElement, parserContext, vehicles); + auto vehiclesList = typedObject->GetWriterVehicles(); + vehiclesList.push_back(vehicles); + typedObject->SetVehicles(vehiclesList); + + + } + + int CatalogXmlParser::SubElementVehiclesParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementVehiclesParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementVehiclesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE ; + } + + std::vector CatalogXmlParser::SubElementVehiclesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE + }; + } + CatalogXmlParser::SubElementControllersParser::SubElementControllersParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementControllersParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controllers = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controllers->SetParent(object); + _controllerXmlParser->ParseElement(indexedElement, parserContext, controllers); + auto controllersList = typedObject->GetWriterControllers(); + controllersList.push_back(controllers); + typedObject->SetControllers(controllersList); + + + } + + int CatalogXmlParser::SubElementControllersParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementControllersParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementControllersParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER ; + } + + std::vector CatalogXmlParser::SubElementControllersParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER + }; + } + CatalogXmlParser::SubElementPedestriansParser::SubElementPedestriansParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _pedestrianXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementPedestriansParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto pedestrians = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + pedestrians->SetParent(object); + _pedestrianXmlParser->ParseElement(indexedElement, parserContext, pedestrians); + auto pedestriansList = typedObject->GetWriterPedestrians(); + pedestriansList.push_back(pedestrians); + typedObject->SetPedestrians(pedestriansList); + + + } + + int CatalogXmlParser::SubElementPedestriansParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementPedestriansParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementPedestriansParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN ; + } + + std::vector CatalogXmlParser::SubElementPedestriansParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PEDESTRIAN + }; + } + CatalogXmlParser::SubElementMiscObjectsParser::SubElementMiscObjectsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _miscObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementMiscObjectsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto miscObjects = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + miscObjects->SetParent(object); + _miscObjectXmlParser->ParseElement(indexedElement, parserContext, miscObjects); + auto miscObjectsList = typedObject->GetWriterMiscObjects(); + miscObjectsList.push_back(miscObjects); + typedObject->SetMiscObjects(miscObjectsList); + + + } + + int CatalogXmlParser::SubElementMiscObjectsParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementMiscObjectsParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementMiscObjectsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MISC_OBJECT ; + } + + std::vector CatalogXmlParser::SubElementMiscObjectsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MISC_OBJECT + }; + } + CatalogXmlParser::SubElementEnvironmentsParser::SubElementEnvironmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _environmentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementEnvironmentsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto environments = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + environments->SetParent(object); + _environmentXmlParser->ParseElement(indexedElement, parserContext, environments); + auto environmentsList = typedObject->GetWriterEnvironments(); + environmentsList.push_back(environments); + typedObject->SetEnvironments(environmentsList); + + + } + + int CatalogXmlParser::SubElementEnvironmentsParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementEnvironmentsParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementEnvironmentsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENVIRONMENT ; + } + + std::vector CatalogXmlParser::SubElementEnvironmentsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENVIRONMENT + }; + } + CatalogXmlParser::SubElementManeuversParser::SubElementManeuversParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _maneuverXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementManeuversParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto maneuvers = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + maneuvers->SetParent(object); + _maneuverXmlParser->ParseElement(indexedElement, parserContext, maneuvers); + auto maneuversList = typedObject->GetWriterManeuvers(); + maneuversList.push_back(maneuvers); + typedObject->SetManeuvers(maneuversList); + + + } + + int CatalogXmlParser::SubElementManeuversParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementManeuversParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementManeuversParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MANEUVER ; + } + + std::vector CatalogXmlParser::SubElementManeuversParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MANEUVER + }; + } + CatalogXmlParser::SubElementTrajectoriesParser::SubElementTrajectoriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementTrajectoriesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectories = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectories->SetParent(object); + _trajectoryXmlParser->ParseElement(indexedElement, parserContext, trajectories); + auto trajectoriesList = typedObject->GetWriterTrajectories(); + trajectoriesList.push_back(trajectories); + typedObject->SetTrajectories(trajectoriesList); + + + } + + int CatalogXmlParser::SubElementTrajectoriesParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementTrajectoriesParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementTrajectoriesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY ; + } + + std::vector CatalogXmlParser::SubElementTrajectoriesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY + }; + } + CatalogXmlParser::SubElementRoutesParser::SubElementRoutesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogXmlParser::SubElementRoutesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto routes = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + routes->SetParent(object); + _routeXmlParser->ParseElement(indexedElement, parserContext, routes); + auto routesList = typedObject->GetWriterRoutes(); + routesList.push_back(routes); + typedObject->SetRoutes(routesList); + + + } + + int CatalogXmlParser::SubElementRoutesParser::GetMinOccur() + { + return 0; + } + + int CatalogXmlParser::SubElementRoutesParser::GetMaxOccur() + { + return -1; + } + + bool CatalogXmlParser::SubElementRoutesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE ; + } + + std::vector CatalogXmlParser::SubElementRoutesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE + }; + } + + CatalogXmlParser::CatalogXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CatalogDefinitionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + + std::vector> CatalogDefinitionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + CatalogDefinitionXmlParser::SubElementCatalogParser::SubElementCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogDefinitionXmlParser::SubElementCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalog->SetParent(object); + _catalogXmlParser->ParseElement(indexedElement, parserContext, catalog); + + typedObject->SetCatalog(catalog); + + + } + + int CatalogDefinitionXmlParser::SubElementCatalogParser::GetMinOccur() + { + return 1; + } + + int CatalogDefinitionXmlParser::SubElementCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogDefinitionXmlParser::SubElementCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG ; + } + + std::vector CatalogDefinitionXmlParser::SubElementCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG + }; + } + + CatalogDefinitionXmlParser::CatalogDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogLocationsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CatalogLocationsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> CatalogLocationsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> CatalogLocationsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + CatalogLocationsXmlParser::SubElementVehicleCatalogParser::SubElementVehicleCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementVehicleCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleCatalog->SetParent(object); + _vehicleCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, vehicleCatalog); + + typedObject->SetVehicleCatalog(vehicleCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementVehicleCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementVehicleCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementVehicleCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementVehicleCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementControllerCatalogParser::SubElementControllerCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementControllerCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controllerCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controllerCatalog->SetParent(object); + _controllerCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, controllerCatalog); + + typedObject->SetControllerCatalog(controllerCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementControllerCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementControllerCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementControllerCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementControllerCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::SubElementPedestrianCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _pedestrianCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto pedestrianCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + pedestrianCatalog->SetParent(object); + _pedestrianCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, pedestrianCatalog); + + typedObject->SetPedestrianCatalog(pedestrianCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementPedestrianCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PEDESTRIAN_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::SubElementMiscObjectCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _miscObjectCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto miscObjectCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + miscObjectCatalog->SetParent(object); + _miscObjectCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, miscObjectCatalog); + + typedObject->SetMiscObjectCatalog(miscObjectCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MISC_OBJECT_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementMiscObjectCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MISC_OBJECT_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::SubElementEnvironmentCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _environmentCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto environmentCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + environmentCatalog->SetParent(object); + _environmentCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, environmentCatalog); + + typedObject->SetEnvironmentCatalog(environmentCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENVIRONMENT_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementEnvironmentCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENVIRONMENT_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementManeuverCatalogParser::SubElementManeuverCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _maneuverCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementManeuverCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto maneuverCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + maneuverCatalog->SetParent(object); + _maneuverCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, maneuverCatalog); + + typedObject->SetManeuverCatalog(maneuverCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementManeuverCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementManeuverCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementManeuverCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MANEUVER_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementManeuverCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MANEUVER_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::SubElementTrajectoryCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectoryCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectoryCatalog->SetParent(object); + _trajectoryCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, trajectoryCatalog); + + typedObject->SetTrajectoryCatalog(trajectoryCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementTrajectoryCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY_CATALOG + }; + } + CatalogLocationsXmlParser::SubElementRouteCatalogParser::SubElementRouteCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routeCatalogLocationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogLocationsXmlParser::SubElementRouteCatalogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto routeCatalog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + routeCatalog->SetParent(object); + _routeCatalogLocationXmlParser->ParseElement(indexedElement, parserContext, routeCatalog); + + typedObject->SetRouteCatalog(routeCatalog); + + + } + + int CatalogLocationsXmlParser::SubElementRouteCatalogParser::GetMinOccur() + { + return 0; + } + + int CatalogLocationsXmlParser::SubElementRouteCatalogParser::GetMaxOccur() + { + return 1; + } + + bool CatalogLocationsXmlParser::SubElementRouteCatalogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE_CATALOG ; + } + + std::vector CatalogLocationsXmlParser::SubElementRouteCatalogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE_CATALOG + }; + } + + CatalogLocationsXmlParser::CatalogLocationsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CatalogReferenceXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> CatalogReferenceXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCatalogName: public IAttributeParser, public XmlParserBase + { + public: + AttributeCatalogName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCatalogName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CATALOG_NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntryName: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntryName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetEntryName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTRY_NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> CatalogReferenceXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENTS, _parserOptions) ); + return result; + } + + CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::SubElementParameterAssignmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterAssignmentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterAssignments = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterAssignments->SetParent(object); + _parameterAssignmentXmlParser->ParseElement(indexedElement, parserContext, parameterAssignments); + auto parameterAssignmentsList = typedObject->GetWriterParameterAssignments(); + parameterAssignmentsList.push_back(parameterAssignments); + typedObject->SetParameterAssignments(parameterAssignmentsList); + + + } + + int CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::GetMinOccur() + { + return 0; + } + + int CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::GetMaxOccur() + { + return -1; + } + + bool CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT; + } + + std::vector CatalogReferenceXmlParser::SubElementParameterAssignmentsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT}; + } + + CatalogReferenceXmlParser::CatalogReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CenterImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CenterXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> CenterXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeX: public IAttributeParser, public XmlParserBase + { + public: + AttributeX(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetX(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeY: public IAttributeParser, public XmlParserBase + { + public: + AttributeY(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetY(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeZ: public IAttributeParser, public XmlParserBase + { + public: + AttributeZ(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetZ(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> CenterXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + CenterXmlParser::CenterXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CentralSwarmObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CentralSwarmObjectXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> CentralSwarmObjectXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> CentralSwarmObjectXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + CentralSwarmObjectXmlParser::CentralSwarmObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ClothoidXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ClothoidXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCurvature: public IAttributeParser, public XmlParserBase + { + public: + AttributeCurvature(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCurvature(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CURVATURE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCurvatureDot: public IAttributeParser, public XmlParserBase + { + public: + AttributeCurvatureDot(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCurvatureDot(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.1'. Comment: 'Use instead curvaturePrime.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_DOT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCurvaturePrime: public IAttributeParser, public XmlParserBase + { + public: + AttributeCurvaturePrime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCurvaturePrime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_PRIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLength: public IAttributeParser, public XmlParserBase + { + public: + AttributeLength(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLength(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeStartTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeStartTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__START_TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__START_TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetStartTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__START_TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__START_TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__START_TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeStopTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeStopTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetStopTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STOP_TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ClothoidXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ClothoidXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ClothoidXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int ClothoidXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int ClothoidXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool ClothoidXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector ClothoidXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + ClothoidXmlParser::ClothoidXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidSplineImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ClothoidSplineXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ClothoidSplineXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTimeEnd: public IAttributeParser, public XmlParserBase + { + public: + AttributeTimeEnd(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_END, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_END, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTimeEnd(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_END, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_END, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME_END, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ClothoidSplineXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ClothoidSplineXmlParser::SubElementSegmentsParser::SubElementSegmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _clothoidSplineSegmentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ClothoidSplineXmlParser::SubElementSegmentsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto segments = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + segments->SetParent(object); + _clothoidSplineSegmentXmlParser->ParseElement(indexedElement, parserContext, segments); + auto segmentsList = typedObject->GetWriterSegments(); + segmentsList.push_back(segments); + typedObject->SetSegments(segmentsList); + + + } + + int ClothoidSplineXmlParser::SubElementSegmentsParser::GetMinOccur() + { + return 1; + } + + int ClothoidSplineXmlParser::SubElementSegmentsParser::GetMaxOccur() + { + return -1; + } + + bool ClothoidSplineXmlParser::SubElementSegmentsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE_SEGMENT ; + } + + std::vector ClothoidSplineXmlParser::SubElementSegmentsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE_SEGMENT + }; + } + + ClothoidSplineXmlParser::ClothoidSplineXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidSplineSegmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ClothoidSplineSegmentXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ClothoidSplineSegmentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCurvatureEnd: public IAttributeParser, public XmlParserBase + { + public: + AttributeCurvatureEnd(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCurvatureEnd(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_END, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCurvatureStart: public IAttributeParser, public XmlParserBase + { + public: + AttributeCurvatureStart(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCurvatureStart(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CURVATURE_START, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeHOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeHOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetHOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__H_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLength: public IAttributeParser, public XmlParserBase + { + public: + AttributeLength(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLength(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTimeStart: public IAttributeParser, public XmlParserBase + { + public: + AttributeTimeStart(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_START, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_START, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTimeStart(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_START, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_START, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME_START, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ClothoidSplineSegmentXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::SubElementPositionStartParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto positionStart = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + positionStart->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, positionStart); + + typedObject->SetPositionStart(positionStart); + + + } + + int ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::GetMinOccur() + { + return 0; + } + + int ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::GetMaxOccur() + { + return 1; + } + + bool ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION_START ; + } + + std::vector ClothoidSplineSegmentXmlParser::SubElementPositionStartParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION_START + }; + } + + ClothoidSplineSegmentXmlParser::ClothoidSplineSegmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CollisionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + CollisionConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> CollisionConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> CollisionConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + CollisionConditionXmlParser::SubElementEntityRefParser::SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CollisionConditionXmlParser::SubElementEntityRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRef->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRef); + + typedObject->SetEntityRef(entityRef); + + + } + + int CollisionConditionXmlParser::SubElementEntityRefParser::GetMinOccur() + { + return 1; + } + + int CollisionConditionXmlParser::SubElementEntityRefParser::GetMaxOccur() + { + return 1; + } + + bool CollisionConditionXmlParser::SubElementEntityRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector CollisionConditionXmlParser::SubElementEntityRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + CollisionConditionXmlParser::SubElementByTypeParser::SubElementByTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _byObjectTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void CollisionConditionXmlParser::SubElementByTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto byType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + byType->SetParent(object); + _byObjectTypeXmlParser->ParseElement(indexedElement, parserContext, byType); + + typedObject->SetByType(byType); + + + } + + int CollisionConditionXmlParser::SubElementByTypeParser::GetMinOccur() + { + return 1; + } + + int CollisionConditionXmlParser::SubElementByTypeParser::GetMaxOccur() + { + return 1; + } + + bool CollisionConditionXmlParser::SubElementByTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BY_TYPE ; + } + + std::vector CollisionConditionXmlParser::SubElementByTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BY_TYPE + }; + } + + CollisionConditionXmlParser::CollisionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ColorXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ColorXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeColorType: public IAttributeParser, public XmlParserBase + { + public: + AttributeColorType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ColorType::GetFromLiteral(attributeValue); + if (kResult != ColorType::UNKNOWN) + { + typedObject->SetColorType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ColorType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ColorType::GetDeprecatedVersion(kResult) +"'. " + ColorType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COLOR_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ColorXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ColorXmlParser::SubElementColorRgbParser::SubElementColorRgbParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _colorRgbXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ColorXmlParser::SubElementColorRgbParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto colorRgb = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + colorRgb->SetParent(object); + _colorRgbXmlParser->ParseElement(indexedElement, parserContext, colorRgb); + + typedObject->SetColorRgb(colorRgb); + + + } + + int ColorXmlParser::SubElementColorRgbParser::GetMinOccur() + { + return 1; + } + + int ColorXmlParser::SubElementColorRgbParser::GetMaxOccur() + { + return 1; + } + + bool ColorXmlParser::SubElementColorRgbParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__COLOR_RGB ; + } + + std::vector ColorXmlParser::SubElementColorRgbParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__COLOR_RGB + }; + } + ColorXmlParser::SubElementColorCmykParser::SubElementColorCmykParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _colorCmykXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ColorXmlParser::SubElementColorCmykParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto colorCmyk = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + colorCmyk->SetParent(object); + _colorCmykXmlParser->ParseElement(indexedElement, parserContext, colorCmyk); + + typedObject->SetColorCmyk(colorCmyk); + + + } + + int ColorXmlParser::SubElementColorCmykParser::GetMinOccur() + { + return 1; + } + + int ColorXmlParser::SubElementColorCmykParser::GetMaxOccur() + { + return 1; + } + + bool ColorXmlParser::SubElementColorCmykParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__COLOR_CMYK ; + } + + std::vector ColorXmlParser::SubElementColorCmykParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__COLOR_CMYK + }; + } + + ColorXmlParser::ColorXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorCmykImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ColorCmykXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ColorCmykXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCyan: public IAttributeParser, public XmlParserBase + { + public: + AttributeCyan(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CYAN, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CYAN, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetCyan(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CYAN, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CYAN, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CYAN, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeKey: public IAttributeParser, public XmlParserBase + { + public: + AttributeKey(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__KEY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__KEY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetKey(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__KEY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__KEY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__KEY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMagenta: public IAttributeParser, public XmlParserBase + { + public: + AttributeMagenta(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMagenta(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAGENTA, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeYellow: public IAttributeParser, public XmlParserBase + { + public: + AttributeYellow(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__YELLOW, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__YELLOW, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetYellow(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__YELLOW, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__YELLOW, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__YELLOW, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ColorCmykXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ColorCmykXmlParser::ColorCmykXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorRgbImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ColorRgbXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ColorRgbXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeBlue: public IAttributeParser, public XmlParserBase + { + public: + AttributeBlue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__BLUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__BLUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetBlue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__BLUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__BLUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__BLUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeGreen: public IAttributeParser, public XmlParserBase + { + public: + AttributeGreen(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GREEN, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GREEN, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetGreen(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__GREEN, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__GREEN, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__GREEN, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRed: public IAttributeParser, public XmlParserBase + { + public: + AttributeRed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RED, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ColorRgbXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ColorRgbXmlParser::ColorRgbXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ComponentAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ComponentAnimationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ComponentAnimationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ComponentAnimationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ComponentAnimationXmlParser::SubElementVehicleComponentParser::SubElementVehicleComponentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleComponentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ComponentAnimationXmlParser::SubElementVehicleComponentParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleComponent = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleComponent->SetParent(object); + _vehicleComponentXmlParser->ParseElement(indexedElement, parserContext, vehicleComponent); + + typedObject->SetVehicleComponent(vehicleComponent); + + + } + + int ComponentAnimationXmlParser::SubElementVehicleComponentParser::GetMinOccur() + { + return 1; + } + + int ComponentAnimationXmlParser::SubElementVehicleComponentParser::GetMaxOccur() + { + return 1; + } + + bool ComponentAnimationXmlParser::SubElementVehicleComponentParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT ; + } + + std::vector ComponentAnimationXmlParser::SubElementVehicleComponentParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_COMPONENT + }; + } + ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::SubElementUserDefinedComponentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedComponentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedComponent = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedComponent->SetParent(object); + _userDefinedComponentXmlParser->ParseElement(indexedElement, parserContext, userDefinedComponent); + + typedObject->SetUserDefinedComponent(userDefinedComponent); + + + } + + int ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::GetMinOccur() + { + return 1; + } + + int ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::GetMaxOccur() + { + return 1; + } + + bool ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT ; + } + + std::vector ComponentAnimationXmlParser::SubElementUserDefinedComponentParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_COMPONENT + }; + } + + ComponentAnimationXmlParser::ComponentAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeConditionEdge: public IAttributeParser, public XmlParserBase + { + public: + AttributeConditionEdge(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ConditionEdge::GetFromLiteral(attributeValue); + if (kResult != ConditionEdge::UNKNOWN) + { + typedObject->SetConditionEdge(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ConditionEdge::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ConditionEdge::GetDeprecatedVersion(kResult) +"'. " + ConditionEdge::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONDITION_EDGE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDelay: public IAttributeParser, public XmlParserBase + { + public: + AttributeDelay(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDelay(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ConditionXmlParser::SubElementByEntityConditionParser::SubElementByEntityConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _byEntityConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ConditionXmlParser::SubElementByEntityConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto byEntityCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + byEntityCondition->SetParent(object); + _byEntityConditionXmlParser->ParseElement(indexedElement, parserContext, byEntityCondition); + + typedObject->SetByEntityCondition(byEntityCondition); + + + } + + int ConditionXmlParser::SubElementByEntityConditionParser::GetMinOccur() + { + return 1; + } + + int ConditionXmlParser::SubElementByEntityConditionParser::GetMaxOccur() + { + return 1; + } + + bool ConditionXmlParser::SubElementByEntityConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION ; + } + + std::vector ConditionXmlParser::SubElementByEntityConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BY_ENTITY_CONDITION + }; + } + ConditionXmlParser::SubElementByValueConditionParser::SubElementByValueConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _byValueConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ConditionXmlParser::SubElementByValueConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto byValueCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + byValueCondition->SetParent(object); + _byValueConditionXmlParser->ParseElement(indexedElement, parserContext, byValueCondition); + + typedObject->SetByValueCondition(byValueCondition); + + + } + + int ConditionXmlParser::SubElementByValueConditionParser::GetMinOccur() + { + return 1; + } + + int ConditionXmlParser::SubElementByValueConditionParser::GetMaxOccur() + { + return 1; + } + + bool ConditionXmlParser::SubElementByValueConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION ; + } + + std::vector ConditionXmlParser::SubElementByValueConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BY_VALUE_CONDITION + }; + } + + ConditionXmlParser::ConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConditionGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ConditionGroupXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ConditionGroupXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ConditionGroupXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ConditionGroupXmlParser::SubElementConditionsParser::SubElementConditionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _conditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ConditionGroupXmlParser::SubElementConditionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto conditions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + conditions->SetParent(object); + _conditionXmlParser->ParseElement(indexedElement, parserContext, conditions); + auto conditionsList = typedObject->GetWriterConditions(); + conditionsList.push_back(conditions); + typedObject->SetConditions(conditionsList); + + + } + + int ConditionGroupXmlParser::SubElementConditionsParser::GetMinOccur() + { + return 1; + } + + int ConditionGroupXmlParser::SubElementConditionsParser::GetMaxOccur() + { + return -1; + } + + bool ConditionGroupXmlParser::SubElementConditionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONDITION ; + } + + std::vector ConditionGroupXmlParser::SubElementConditionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONDITION + }; + } + + ConditionGroupXmlParser::ConditionGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConnectTrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ConnectTrailerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ConnectTrailerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTrailerRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrailerRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetTrailerRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAILER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ConnectTrailerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ConnectTrailerActionXmlParser::ConnectTrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControlPointImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControlPointXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ControlPointXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ControlPointXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControlPointXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControlPointXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int ControlPointXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int ControlPointXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool ControlPointXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector ControlPointXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + ControlPointXmlParser::ControlPointXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControllerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ControllerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeControllerType: public IAttributeParser, public XmlParserBase + { + public: + AttributeControllerType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ControllerType::GetFromLiteral(attributeValue); + if (kResult != ControllerType::UNKNOWN) + { + typedObject->SetControllerType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ControllerType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ControllerType::GetDeprecatedVersion(kResult) +"'. " + ControllerType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTROLLER_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ControllerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControllerXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int ControllerXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int ControllerXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool ControllerXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector ControllerXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + ControllerXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int ControllerXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int ControllerXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool ControllerXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector ControllerXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + ControllerXmlParser::ControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControllerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ControllerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ControllerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControllerActionXmlParser::SubElementAssignControllerActionParser::SubElementAssignControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _assignControllerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerActionXmlParser::SubElementAssignControllerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto assignControllerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + assignControllerAction->SetParent(object); + _assignControllerActionXmlParser->ParseElement(indexedElement, parserContext, assignControllerAction); + + typedObject->SetAssignControllerAction(assignControllerAction); + + + } + + int ControllerActionXmlParser::SubElementAssignControllerActionParser::GetMinOccur() + { + return 1; + } + + int ControllerActionXmlParser::SubElementAssignControllerActionParser::GetMaxOccur() + { + return 1; + } + + bool ControllerActionXmlParser::SubElementAssignControllerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ASSIGN_CONTROLLER_ACTION ; + } + + std::vector ControllerActionXmlParser::SubElementAssignControllerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ASSIGN_CONTROLLER_ACTION + }; + } + ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::SubElementOverrideControllerValueActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideControllerValueActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto overrideControllerValueAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + overrideControllerValueAction->SetParent(object); + _overrideControllerValueActionXmlParser->ParseElement(indexedElement, parserContext, overrideControllerValueAction); + + typedObject->SetOverrideControllerValueAction(overrideControllerValueAction); + + + } + + int ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::GetMinOccur() + { + return 1; + } + + int ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::GetMaxOccur() + { + return 1; + } + + bool ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION ; + } + + std::vector ControllerActionXmlParser::SubElementOverrideControllerValueActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__OVERRIDE_CONTROLLER_VALUE_ACTION + }; + } + ControllerActionXmlParser::SubElementActivateControllerActionParser::SubElementActivateControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _activateControllerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerActionXmlParser::SubElementActivateControllerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto activateControllerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + activateControllerAction->SetParent(object); + _activateControllerActionXmlParser->ParseElement(indexedElement, parserContext, activateControllerAction); + + typedObject->SetActivateControllerAction(activateControllerAction); + + + } + + int ControllerActionXmlParser::SubElementActivateControllerActionParser::GetMinOccur() + { + return 1; + } + + int ControllerActionXmlParser::SubElementActivateControllerActionParser::GetMaxOccur() + { + return 1; + } + + bool ControllerActionXmlParser::SubElementActivateControllerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION ; + } + + std::vector ControllerActionXmlParser::SubElementActivateControllerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION + }; + } + + ControllerActionXmlParser::ControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControllerCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ControllerCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ControllerCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControllerCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int ControllerCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int ControllerCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool ControllerCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector ControllerCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + ControllerCatalogLocationXmlParser::ControllerCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControllerDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ControllerDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ControllerDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::SubElementControllerDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerDistributionEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controllerDistributionEntries = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controllerDistributionEntries->SetParent(object); + _controllerDistributionEntryXmlParser->ParseElement(indexedElement, parserContext, controllerDistributionEntries); + auto controllerDistributionEntriesList = typedObject->GetWriterControllerDistributionEntries(); + controllerDistributionEntriesList.push_back(controllerDistributionEntries); + typedObject->SetControllerDistributionEntries(controllerDistributionEntriesList); + + + } + + int ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::GetMinOccur() + { + return 1; + } + + int ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::GetMaxOccur() + { + return -1; + } + + bool ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY ; + } + + std::vector ControllerDistributionXmlParser::SubElementControllerDistributionEntriesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION_ENTRY + }; + } + + ControllerDistributionXmlParser::ControllerDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ControllerDistributionEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ControllerDistributionEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ControllerDistributionEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ControllerDistributionEntryXmlParser::SubElementControllerParser::SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerDistributionEntryXmlParser::SubElementControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controller = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controller->SetParent(object); + _controllerXmlParser->ParseElement(indexedElement, parserContext, controller); + + typedObject->SetController(controller); + + + } + + int ControllerDistributionEntryXmlParser::SubElementControllerParser::GetMinOccur() + { + return 1; + } + + int ControllerDistributionEntryXmlParser::SubElementControllerParser::GetMaxOccur() + { + return 1; + } + + bool ControllerDistributionEntryXmlParser::SubElementControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER ; + } + + std::vector ControllerDistributionEntryXmlParser::SubElementControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER + }; + } + ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector ControllerDistributionEntryXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + + ControllerDistributionEntryXmlParser::ControllerDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CustomCommandActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + bool CustomCommandActionXmlParser::IsContentRequired() + { + return false; + } + + std::map> CustomCommandActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeType: public IAttributeParser, public XmlParserBase + { + public: + AttributeType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetType(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + void CustomCommandActionXmlParser::SetContentProperty(const std::string content, std::shared_ptr object) + { + auto typedObject = std::static_pointer_cast(object); + typedObject->SetContent(content); + } + + CustomCommandActionXmlParser::CustomCommandActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlSimpleContentParser(messageLogger, filename, parserOptions) {} + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CustomContentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + bool CustomContentXmlParser::IsContentRequired() + { + return false; + } + + std::map> CustomContentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + void CustomContentXmlParser::SetContentProperty(const std::string content, std::shared_ptr object) + { + auto typedObject = std::static_pointer_cast(object); + typedObject->SetContent(content); + } + + CustomContentXmlParser::CustomContentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlSimpleContentParser(messageLogger, filename, parserOptions) {} + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeleteEntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeleteEntityActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DeleteEntityActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> DeleteEntityActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DeleteEntityActionXmlParser::DeleteEntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DeterministicXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> DeterministicXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::SubElementDeterministicParameterDistributionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicParameterDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministicParameterDistributions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministicParameterDistributions->SetParent(object); + _deterministicParameterDistributionXmlParser->ParseElement(indexedElement, parserContext, deterministicParameterDistributions); + auto deterministicParameterDistributionsList = typedObject->GetWriterDeterministicParameterDistributions(); + deterministicParameterDistributionsList.push_back(deterministicParameterDistributions); + typedObject->SetDeterministicParameterDistributions(deterministicParameterDistributionsList); + + + } + + int DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::GetMinOccur() + { + return 0; + } + + int DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::GetMaxOccur() + { + return -1; + } + + bool DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION || + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION ; + } + + std::vector DeterministicXmlParser::SubElementDeterministicParameterDistributionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION, + OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION + }; + } + + DeterministicXmlParser::DeterministicXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicMultiParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicMultiParameterDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DeterministicMultiParameterDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> DeterministicMultiParameterDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::SubElementDeterministicMultiParameterDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicMultiParameterDistributionTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministicMultiParameterDistributionType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministicMultiParameterDistributionType->SetParent(object); + _deterministicMultiParameterDistributionTypeXmlParser->ParseElement(indexedElement, parserContext, deterministicMultiParameterDistributionType); + + typedObject->SetDeterministicMultiParameterDistributionType(deterministicMultiParameterDistributionType); + + + } + + int DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::GetMinOccur() + { + return 1; + } + + int DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION ; + } + + std::vector DeterministicMultiParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION + }; + } + + DeterministicMultiParameterDistributionXmlParser::DeterministicMultiParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicMultiParameterDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicMultiParameterDistributionTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + + std::vector> DeterministicMultiParameterDistributionTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::SubElementValueSetDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _valueSetDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto valueSetDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + valueSetDistribution->SetParent(object); + _valueSetDistributionXmlParser->ParseElement(indexedElement, parserContext, valueSetDistribution); + + typedObject->SetValueSetDistribution(valueSetDistribution); + + + } + + int DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::GetMinOccur() + { + return 1; + } + + int DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION ; + } + + std::vector DeterministicMultiParameterDistributionTypeXmlParser::SubElementValueSetDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VALUE_SET_DISTRIBUTION + }; + } + + DeterministicMultiParameterDistributionTypeXmlParser::DeterministicMultiParameterDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicParameterDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> DeterministicParameterDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::SubElementDeterministicMultiParameterDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicMultiParameterDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministicMultiParameterDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministicMultiParameterDistribution->SetParent(object); + _deterministicMultiParameterDistributionXmlParser->ParseElement(indexedElement, parserContext, deterministicMultiParameterDistribution); + + typedObject->SetDeterministicMultiParameterDistribution(deterministicMultiParameterDistribution); + + + } + + int DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::GetMinOccur() + { + return 1; + } + + int DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION ; + } + + std::vector DeterministicParameterDistributionXmlParser::SubElementDeterministicMultiParameterDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DETERMINISTIC_MULTI_PARAMETER_DISTRIBUTION + }; + } + DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::SubElementDeterministicSingleParameterDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicSingleParameterDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministicSingleParameterDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministicSingleParameterDistribution->SetParent(object); + _deterministicSingleParameterDistributionXmlParser->ParseElement(indexedElement, parserContext, deterministicSingleParameterDistribution); + + typedObject->SetDeterministicSingleParameterDistribution(deterministicSingleParameterDistribution); + + + } + + int DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::GetMinOccur() + { + return 1; + } + + int DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION ; + } + + std::vector DeterministicParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DETERMINISTIC_SINGLE_PARAMETER_DISTRIBUTION + }; + } + + DeterministicParameterDistributionXmlParser::DeterministicParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicSingleParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicSingleParameterDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DeterministicSingleParameterDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeParameterName: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetParameterName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DeterministicSingleParameterDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::SubElementDeterministicSingleParameterDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicSingleParameterDistributionTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministicSingleParameterDistributionType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministicSingleParameterDistributionType->SetParent(object); + _deterministicSingleParameterDistributionTypeXmlParser->ParseElement(indexedElement, parserContext, deterministicSingleParameterDistributionType); + + typedObject->SetDeterministicSingleParameterDistributionType(deterministicSingleParameterDistributionType); + + + } + + int DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::GetMinOccur() + { + return 1; + } + + int DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET || + elementName == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE || + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ; + } + + std::vector DeterministicSingleParameterDistributionXmlParser::SubElementDeterministicSingleParameterDistributionTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET, + OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE, + OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION + }; + } + + DeterministicSingleParameterDistributionXmlParser::DeterministicSingleParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicSingleParameterDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DeterministicSingleParameterDistributionTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> DeterministicSingleParameterDistributionTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::SubElementDistributionSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _distributionSetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto distributionSet = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + distributionSet->SetParent(object); + _distributionSetXmlParser->ParseElement(indexedElement, parserContext, distributionSet); + + typedObject->SetDistributionSet(distributionSet); + + + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::GetMinOccur() + { + return 1; + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET ; + } + + std::vector DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionSetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DISTRIBUTION_SET + }; + } + DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::SubElementDistributionRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _distributionRangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto distributionRange = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + distributionRange->SetParent(object); + _distributionRangeXmlParser->ParseElement(indexedElement, parserContext, distributionRange); + + typedObject->SetDistributionRange(distributionRange); + + + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::GetMinOccur() + { + return 1; + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE ; + } + + std::vector DeterministicSingleParameterDistributionTypeXmlParser::SubElementDistributionRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DISTRIBUTION_RANGE + }; + } + DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::SubElementUserDefinedDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedDistribution->SetParent(object); + _userDefinedDistributionXmlParser->ParseElement(indexedElement, parserContext, userDefinedDistribution); + + typedObject->SetUserDefinedDistribution(userDefinedDistribution); + + + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetMinOccur() + { + return 1; + } + + int DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetMaxOccur() + { + return 1; + } + + bool DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ; + } + + std::vector DeterministicSingleParameterDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION + }; + } + + DeterministicSingleParameterDistributionTypeXmlParser::DeterministicSingleParameterDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DimensionsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DimensionsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DimensionsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeHeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeHeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetHeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLength: public IAttributeParser, public XmlParserBase + { + public: + AttributeLength(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLength(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWidth: public IAttributeParser, public XmlParserBase + { + public: + AttributeWidth(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WIDTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WIDTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWidth(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WIDTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WIDTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WIDTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DimensionsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DimensionsXmlParser::DimensionsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DirectionOfTravelDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DirectionOfTravelDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DirectionOfTravelDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeOpposite: public IAttributeParser, public XmlParserBase + { + public: + AttributeOpposite(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOpposite(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSame: public IAttributeParser, public XmlParserBase + { + public: + AttributeSame(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSame(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DirectionOfTravelDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DirectionOfTravelDistributionXmlParser::DirectionOfTravelDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DirectoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DirectoryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DirectoryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributePath: public IAttributeParser, public XmlParserBase + { + public: + AttributePath(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPath(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PATH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PATH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PATH, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DirectoryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DirectoryXmlParser::DirectoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DisconnectTrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DisconnectTrailerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DisconnectTrailerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> DisconnectTrailerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DisconnectTrailerActionXmlParser::DisconnectTrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DistanceConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> DistanceConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAlongRoute: public IAttributeParser, public XmlParserBase + { + public: + AttributeAlongRoute(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAlongRoute(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.1'. Comment: 'Use \"coordinateSystem\" and \"relativeDistanceType\"'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRelativeDistanceType: public IAttributeParser, public XmlParserBase + { + public: + AttributeRelativeDistanceType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(attributeValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + typedObject->SetRelativeDistanceType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RelativeDistanceType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RelativeDistanceType::GetDeprecatedVersion(kResult) +"'. " + RelativeDistanceType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRoutingAlgorithm: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoutingAlgorithm(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(attributeValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + typedObject->SetRoutingAlgorithm(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RoutingAlgorithm::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RoutingAlgorithm::GetDeprecatedVersion(kResult) +"'. " + RoutingAlgorithm::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DistanceConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DistanceConditionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DistanceConditionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int DistanceConditionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int DistanceConditionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool DistanceConditionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector DistanceConditionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + DistanceConditionXmlParser::DistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DistributionDefinitionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> DistributionDefinitionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DistributionDefinitionXmlParser::SubElementDeterministicParser::SubElementDeterministicParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deterministicXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DistributionDefinitionXmlParser::SubElementDeterministicParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deterministic = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deterministic->SetParent(object); + _deterministicXmlParser->ParseElement(indexedElement, parserContext, deterministic); + + typedObject->SetDeterministic(deterministic); + + + } + + int DistributionDefinitionXmlParser::SubElementDeterministicParser::GetMinOccur() + { + return 1; + } + + int DistributionDefinitionXmlParser::SubElementDeterministicParser::GetMaxOccur() + { + return 1; + } + + bool DistributionDefinitionXmlParser::SubElementDeterministicParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC ; + } + + std::vector DistributionDefinitionXmlParser::SubElementDeterministicParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DETERMINISTIC + }; + } + DistributionDefinitionXmlParser::SubElementStochasticParser::SubElementStochasticParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _stochasticXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DistributionDefinitionXmlParser::SubElementStochasticParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stochastic = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stochastic->SetParent(object); + _stochasticXmlParser->ParseElement(indexedElement, parserContext, stochastic); + + typedObject->SetStochastic(stochastic); + + + } + + int DistributionDefinitionXmlParser::SubElementStochasticParser::GetMinOccur() + { + return 1; + } + + int DistributionDefinitionXmlParser::SubElementStochasticParser::GetMaxOccur() + { + return 1; + } + + bool DistributionDefinitionXmlParser::SubElementStochasticParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STOCHASTIC ; + } + + std::vector DistributionDefinitionXmlParser::SubElementStochasticParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STOCHASTIC + }; + } + + DistributionDefinitionXmlParser::DistributionDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DistributionRangeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> DistributionRangeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeStepWidth: public IAttributeParser, public XmlParserBase + { + public: + AttributeStepWidth(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetStepWidth(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STEP_WIDTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DistributionRangeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DistributionRangeXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DistributionRangeXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int DistributionRangeXmlParser::SubElementRangeParser::GetMinOccur() + { + return 1; + } + + int DistributionRangeXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool DistributionRangeXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector DistributionRangeXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + DistributionRangeXmlParser::DistributionRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DistributionSetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DistributionSetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> DistributionSetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DistributionSetXmlParser::SubElementElementsParser::SubElementElementsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _distributionSetElementXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DistributionSetXmlParser::SubElementElementsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto elements = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + elements->SetParent(object); + _distributionSetElementXmlParser->ParseElement(indexedElement, parserContext, elements); + auto elementsList = typedObject->GetWriterElements(); + elementsList.push_back(elements); + typedObject->SetElements(elementsList); + + + } + + int DistributionSetXmlParser::SubElementElementsParser::GetMinOccur() + { + return 1; + } + + int DistributionSetXmlParser::SubElementElementsParser::GetMaxOccur() + { + return -1; + } + + bool DistributionSetXmlParser::SubElementElementsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ELEMENT ; + } + + std::vector DistributionSetXmlParser::SubElementElementsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ELEMENT + }; + } + + DistributionSetXmlParser::DistributionSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionSetElementImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DistributionSetElementXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> DistributionSetElementXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DistributionSetElementXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DistributionSetElementXmlParser::DistributionSetElementXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DomeImageImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DomeImageXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DomeImageXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAzimuthOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeAzimuthOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAzimuthOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DomeImageXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + DomeImageXmlParser::SubElementDomeFileParser::SubElementDomeFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void DomeImageXmlParser::SubElementDomeFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto domeFile = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + domeFile->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, domeFile); + + typedObject->SetDomeFile(domeFile); + + + } + + int DomeImageXmlParser::SubElementDomeFileParser::GetMinOccur() + { + return 1; + } + + int DomeImageXmlParser::SubElementDomeFileParser::GetMaxOccur() + { + return 1; + } + + bool DomeImageXmlParser::SubElementDomeFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DOME_FILE ; + } + + std::vector DomeImageXmlParser::SubElementDomeFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DOME_FILE + }; + } + + DomeImageXmlParser::DomeImageXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DynamicConstraintsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + DynamicConstraintsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> DynamicConstraintsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaxAcceleration: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxAcceleration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxAcceleration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxAccelerationRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxAccelerationRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxAccelerationRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxDeceleration: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxDeceleration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxDeceleration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxDecelerationRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxDecelerationRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxDecelerationRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxSpeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxSpeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxSpeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> DynamicConstraintsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + DynamicConstraintsXmlParser::DynamicConstraintsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EndOfRoadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EndOfRoadConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EndOfRoadConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EndOfRoadConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + EndOfRoadConditionXmlParser::EndOfRoadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntitiesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EntitiesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> EntitiesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntitiesXmlParser::SubElementScenarioObjectsParser::SubElementScenarioObjectsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _scenarioObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntitiesXmlParser::SubElementScenarioObjectsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto scenarioObjects = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + scenarioObjects->SetParent(object); + _scenarioObjectXmlParser->ParseElement(indexedElement, parserContext, scenarioObjects); + auto scenarioObjectsList = typedObject->GetWriterScenarioObjects(); + scenarioObjectsList.push_back(scenarioObjects); + typedObject->SetScenarioObjects(scenarioObjectsList); + + + } + + int EntitiesXmlParser::SubElementScenarioObjectsParser::GetMinOccur() + { + return 0; + } + + int EntitiesXmlParser::SubElementScenarioObjectsParser::GetMaxOccur() + { + return -1; + } + + bool EntitiesXmlParser::SubElementScenarioObjectsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT ; + } + + std::vector EntitiesXmlParser::SubElementScenarioObjectsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT + }; + } + EntitiesXmlParser::SubElementEntitySelectionsParser::SubElementEntitySelectionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entitySelectionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntitiesXmlParser::SubElementEntitySelectionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entitySelections = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entitySelections->SetParent(object); + _entitySelectionXmlParser->ParseElement(indexedElement, parserContext, entitySelections); + auto entitySelectionsList = typedObject->GetWriterEntitySelections(); + entitySelectionsList.push_back(entitySelections); + typedObject->SetEntitySelections(entitySelectionsList); + + + } + + int EntitiesXmlParser::SubElementEntitySelectionsParser::GetMinOccur() + { + return 0; + } + + int EntitiesXmlParser::SubElementEntitySelectionsParser::GetMaxOccur() + { + return -1; + } + + bool EntitiesXmlParser::SubElementEntitySelectionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_SELECTION ; + } + + std::vector EntitiesXmlParser::SubElementEntitySelectionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_SELECTION + }; + } + + EntitiesXmlParser::EntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers2V1_3.cpp b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers2V1_3.cpp new file mode 100644 index 00000000..ebcc1766 --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers2V1_3.cpp @@ -0,0 +1,11443 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlParsersV1_3.h" +#include "NamedReferenceProxy.h" +#include "FileContentMessage.h" +#include "Position.h" +#include "Textmarker.h" +#include "ErrorLevel.h" +#include "WrappedListParser.h" +#include "CatalogReferenceParserContextV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> EntityActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EntityActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntityActionXmlParser::SubElementAddEntityActionParser::SubElementAddEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _addEntityActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityActionXmlParser::SubElementAddEntityActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto addEntityAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + addEntityAction->SetParent(object); + _addEntityActionXmlParser->ParseElement(indexedElement, parserContext, addEntityAction); + + typedObject->SetAddEntityAction(addEntityAction); + + + } + + int EntityActionXmlParser::SubElementAddEntityActionParser::GetMinOccur() + { + return 1; + } + + int EntityActionXmlParser::SubElementAddEntityActionParser::GetMaxOccur() + { + return 1; + } + + bool EntityActionXmlParser::SubElementAddEntityActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION ; + } + + std::vector EntityActionXmlParser::SubElementAddEntityActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ADD_ENTITY_ACTION + }; + } + EntityActionXmlParser::SubElementDeleteEntityActionParser::SubElementDeleteEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _deleteEntityActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityActionXmlParser::SubElementDeleteEntityActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto deleteEntityAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + deleteEntityAction->SetParent(object); + _deleteEntityActionXmlParser->ParseElement(indexedElement, parserContext, deleteEntityAction); + + typedObject->SetDeleteEntityAction(deleteEntityAction); + + + } + + int EntityActionXmlParser::SubElementDeleteEntityActionParser::GetMinOccur() + { + return 1; + } + + int EntityActionXmlParser::SubElementDeleteEntityActionParser::GetMaxOccur() + { + return 1; + } + + bool EntityActionXmlParser::SubElementDeleteEntityActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION ; + } + + std::vector EntityActionXmlParser::SubElementDeleteEntityActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DELETE_ENTITY_ACTION + }; + } + + EntityActionXmlParser::EntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> EntityConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> EntityConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntityConditionXmlParser::SubElementEndOfRoadConditionParser::SubElementEndOfRoadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _endOfRoadConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementEndOfRoadConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto endOfRoadCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + endOfRoadCondition->SetParent(object); + _endOfRoadConditionXmlParser->ParseElement(indexedElement, parserContext, endOfRoadCondition); + + typedObject->SetEndOfRoadCondition(endOfRoadCondition); + + + } + + int EntityConditionXmlParser::SubElementEndOfRoadConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementEndOfRoadConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementEndOfRoadConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementEndOfRoadConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__END_OF_ROAD_CONDITION + }; + } + EntityConditionXmlParser::SubElementCollisionConditionParser::SubElementCollisionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _collisionConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementCollisionConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto collisionCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + collisionCondition->SetParent(object); + _collisionConditionXmlParser->ParseElement(indexedElement, parserContext, collisionCondition); + + typedObject->SetCollisionCondition(collisionCondition); + + + } + + int EntityConditionXmlParser::SubElementCollisionConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementCollisionConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementCollisionConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementCollisionConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__COLLISION_CONDITION + }; + } + EntityConditionXmlParser::SubElementOffroadConditionParser::SubElementOffroadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _offroadConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementOffroadConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto offroadCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + offroadCondition->SetParent(object); + _offroadConditionXmlParser->ParseElement(indexedElement, parserContext, offroadCondition); + + typedObject->SetOffroadCondition(offroadCondition); + + + } + + int EntityConditionXmlParser::SubElementOffroadConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementOffroadConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementOffroadConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementOffroadConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__OFFROAD_CONDITION + }; + } + EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::SubElementTimeHeadwayConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeHeadwayConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeHeadwayCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeHeadwayCondition->SetParent(object); + _timeHeadwayConditionXmlParser->ParseElement(indexedElement, parserContext, timeHeadwayCondition); + + typedObject->SetTimeHeadwayCondition(timeHeadwayCondition); + + + } + + int EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementTimeHeadwayConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_HEADWAY_CONDITION + }; + } + EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::SubElementTimeToCollisionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeToCollisionConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeToCollisionCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeToCollisionCondition->SetParent(object); + _timeToCollisionConditionXmlParser->ParseElement(indexedElement, parserContext, timeToCollisionCondition); + + typedObject->SetTimeToCollisionCondition(timeToCollisionCondition); + + + } + + int EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementTimeToCollisionConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION + }; + } + EntityConditionXmlParser::SubElementAccelerationConditionParser::SubElementAccelerationConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _accelerationConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementAccelerationConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto accelerationCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + accelerationCondition->SetParent(object); + _accelerationConditionXmlParser->ParseElement(indexedElement, parserContext, accelerationCondition); + + typedObject->SetAccelerationCondition(accelerationCondition); + + + } + + int EntityConditionXmlParser::SubElementAccelerationConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementAccelerationConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementAccelerationConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementAccelerationConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACCELERATION_CONDITION + }; + } + EntityConditionXmlParser::SubElementStandStillConditionParser::SubElementStandStillConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _standStillConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementStandStillConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto standStillCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + standStillCondition->SetParent(object); + _standStillConditionXmlParser->ParseElement(indexedElement, parserContext, standStillCondition); + + typedObject->SetStandStillCondition(standStillCondition); + + + } + + int EntityConditionXmlParser::SubElementStandStillConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementStandStillConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementStandStillConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementStandStillConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STAND_STILL_CONDITION + }; + } + EntityConditionXmlParser::SubElementSpeedConditionParser::SubElementSpeedConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _speedConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementSpeedConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedCondition->SetParent(object); + _speedConditionXmlParser->ParseElement(indexedElement, parserContext, speedCondition); + + typedObject->SetSpeedCondition(speedCondition); + + + } + + int EntityConditionXmlParser::SubElementSpeedConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementSpeedConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementSpeedConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementSpeedConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_CONDITION + }; + } + EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::SubElementRelativeSpeedConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeSpeedConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeSpeedCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeSpeedCondition->SetParent(object); + _relativeSpeedConditionXmlParser->ParseElement(indexedElement, parserContext, relativeSpeedCondition); + + typedObject->SetRelativeSpeedCondition(relativeSpeedCondition); + + + } + + int EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementRelativeSpeedConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_CONDITION + }; + } + EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::SubElementTraveledDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _traveledDistanceConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto traveledDistanceCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + traveledDistanceCondition->SetParent(object); + _traveledDistanceConditionXmlParser->ParseElement(indexedElement, parserContext, traveledDistanceCondition); + + typedObject->SetTraveledDistanceCondition(traveledDistanceCondition); + + + } + + int EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementTraveledDistanceConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAVELED_DISTANCE_CONDITION + }; + } + EntityConditionXmlParser::SubElementReachPositionConditionParser::SubElementReachPositionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _reachPositionConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementReachPositionConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto reachPositionCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + reachPositionCondition->SetParent(object); + _reachPositionConditionXmlParser->ParseElement(indexedElement, parserContext, reachPositionCondition); + + typedObject->SetReachPositionCondition(reachPositionCondition); + + + if (!_reachPositionConditionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.2'. Comment: 'Use DistanceCondition instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _reachPositionConditionXmlParser->_filename)); + _reachPositionConditionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int EntityConditionXmlParser::SubElementReachPositionConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementReachPositionConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementReachPositionConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementReachPositionConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__REACH_POSITION_CONDITION + }; + } + EntityConditionXmlParser::SubElementDistanceConditionParser::SubElementDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _distanceConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementDistanceConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto distanceCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + distanceCondition->SetParent(object); + _distanceConditionXmlParser->ParseElement(indexedElement, parserContext, distanceCondition); + + typedObject->SetDistanceCondition(distanceCondition); + + + } + + int EntityConditionXmlParser::SubElementDistanceConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementDistanceConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementDistanceConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementDistanceConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DISTANCE_CONDITION + }; + } + EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::SubElementRelativeDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeDistanceConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeDistanceCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeDistanceCondition->SetParent(object); + _relativeDistanceConditionXmlParser->ParseElement(indexedElement, parserContext, relativeDistanceCondition); + + typedObject->SetRelativeDistanceCondition(relativeDistanceCondition); + + + } + + int EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementRelativeDistanceConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_DISTANCE_CONDITION + }; + } + EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::SubElementRelativeClearanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeClearanceConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeClearanceCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeClearanceCondition->SetParent(object); + _relativeClearanceConditionXmlParser->ParseElement(indexedElement, parserContext, relativeClearanceCondition); + + typedObject->SetRelativeClearanceCondition(relativeClearanceCondition); + + + } + + int EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementRelativeClearanceConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_CLEARANCE_CONDITION + }; + } + EntityConditionXmlParser::SubElementAngleConditionParser::SubElementAngleConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _angleConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementAngleConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto angleCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + angleCondition->SetParent(object); + _angleConditionXmlParser->ParseElement(indexedElement, parserContext, angleCondition); + + typedObject->SetAngleCondition(angleCondition); + + + } + + int EntityConditionXmlParser::SubElementAngleConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementAngleConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementAngleConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementAngleConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ANGLE_CONDITION + }; + } + EntityConditionXmlParser::SubElementRelativeAngleConditionParser::SubElementRelativeAngleConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeAngleConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityConditionXmlParser::SubElementRelativeAngleConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeAngleCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeAngleCondition->SetParent(object); + _relativeAngleConditionXmlParser->ParseElement(indexedElement, parserContext, relativeAngleCondition); + + typedObject->SetRelativeAngleCondition(relativeAngleCondition); + + + } + + int EntityConditionXmlParser::SubElementRelativeAngleConditionParser::GetMinOccur() + { + return 1; + } + + int EntityConditionXmlParser::SubElementRelativeAngleConditionParser::GetMaxOccur() + { + return 1; + } + + bool EntityConditionXmlParser::SubElementRelativeAngleConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION ; + } + + std::vector EntityConditionXmlParser::SubElementRelativeAngleConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_ANGLE_CONDITION + }; + } + + EntityConditionXmlParser::EntityConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EntityDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> EntityDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::SubElementEntityDistributionEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityDistributionEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityDistributionEntry = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityDistributionEntry->SetParent(object); + _entityDistributionEntryXmlParser->ParseElement(indexedElement, parserContext, entityDistributionEntry); + auto entityDistributionEntryList = typedObject->GetWriterEntityDistributionEntry(); + entityDistributionEntryList.push_back(entityDistributionEntry); + typedObject->SetEntityDistributionEntry(entityDistributionEntryList); + + + } + + int EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::GetMinOccur() + { + return 1; + } + + int EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::GetMaxOccur() + { + return -1; + } + + bool EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION_ENTRY ; + } + + std::vector EntityDistributionXmlParser::SubElementEntityDistributionEntryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION_ENTRY + }; + } + + EntityDistributionXmlParser::EntityDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityDistributionEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EntityDistributionEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EntityDistributionEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::SubElementScenarioObjectTemplateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _scenarioObjectTemplateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto scenarioObjectTemplate = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + scenarioObjectTemplate->SetParent(object); + _scenarioObjectTemplateXmlParser->ParseElement(indexedElement, parserContext, scenarioObjectTemplate); + + typedObject->SetScenarioObjectTemplate(scenarioObjectTemplate); + + + } + + int EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::GetMinOccur() + { + return 1; + } + + int EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::GetMaxOccur() + { + return 1; + } + + bool EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT_TEMPLATE ; + } + + std::vector EntityDistributionEntryXmlParser::SubElementScenarioObjectTemplateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SCENARIO_OBJECT_TEMPLATE + }; + } + + EntityDistributionEntryXmlParser::EntityDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityObjectXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> EntityObjectXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntityObjectXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityObjectXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int EntityObjectXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int EntityObjectXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool EntityObjectXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector EntityObjectXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + EntityObjectXmlParser::SubElementVehicleParser::SubElementVehicleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityObjectXmlParser::SubElementVehicleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicle = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicle->SetParent(object); + _vehicleXmlParser->ParseElement(indexedElement, parserContext, vehicle); + + typedObject->SetVehicle(vehicle); + + + } + + int EntityObjectXmlParser::SubElementVehicleParser::GetMinOccur() + { + return 1; + } + + int EntityObjectXmlParser::SubElementVehicleParser::GetMaxOccur() + { + return 1; + } + + bool EntityObjectXmlParser::SubElementVehicleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE ; + } + + std::vector EntityObjectXmlParser::SubElementVehicleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE + }; + } + EntityObjectXmlParser::SubElementPedestrianParser::SubElementPedestrianParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _pedestrianXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityObjectXmlParser::SubElementPedestrianParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto pedestrian = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + pedestrian->SetParent(object); + _pedestrianXmlParser->ParseElement(indexedElement, parserContext, pedestrian); + + typedObject->SetPedestrian(pedestrian); + + + } + + int EntityObjectXmlParser::SubElementPedestrianParser::GetMinOccur() + { + return 1; + } + + int EntityObjectXmlParser::SubElementPedestrianParser::GetMaxOccur() + { + return 1; + } + + bool EntityObjectXmlParser::SubElementPedestrianParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN ; + } + + std::vector EntityObjectXmlParser::SubElementPedestrianParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PEDESTRIAN + }; + } + EntityObjectXmlParser::SubElementMiscObjectParser::SubElementMiscObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _miscObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityObjectXmlParser::SubElementMiscObjectParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto miscObject = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + miscObject->SetParent(object); + _miscObjectXmlParser->ParseElement(indexedElement, parserContext, miscObject); + + typedObject->SetMiscObject(miscObject); + + + } + + int EntityObjectXmlParser::SubElementMiscObjectParser::GetMinOccur() + { + return 1; + } + + int EntityObjectXmlParser::SubElementMiscObjectParser::GetMaxOccur() + { + return 1; + } + + bool EntityObjectXmlParser::SubElementMiscObjectParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MISC_OBJECT ; + } + + std::vector EntityObjectXmlParser::SubElementMiscObjectParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MISC_OBJECT + }; + } + EntityObjectXmlParser::SubElementExternalObjectReferenceParser::SubElementExternalObjectReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _externalObjectReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntityObjectXmlParser::SubElementExternalObjectReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto externalObjectReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + externalObjectReference->SetParent(object); + _externalObjectReferenceXmlParser->ParseElement(indexedElement, parserContext, externalObjectReference); + + typedObject->SetExternalObjectReference(externalObjectReference); + + + } + + int EntityObjectXmlParser::SubElementExternalObjectReferenceParser::GetMinOccur() + { + return 1; + } + + int EntityObjectXmlParser::SubElementExternalObjectReferenceParser::GetMaxOccur() + { + return 1; + } + + bool EntityObjectXmlParser::SubElementExternalObjectReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE ; + } + + std::vector EntityObjectXmlParser::SubElementExternalObjectReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE + }; + } + + EntityObjectXmlParser::EntityObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntityRefXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EntityRefXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EntityRefXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + EntityRefXmlParser::EntityRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntitySelectionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EntitySelectionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EntitySelectionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EntitySelectionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EntitySelectionXmlParser::SubElementMembersParser::SubElementMembersParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _selectedEntitiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EntitySelectionXmlParser::SubElementMembersParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto members = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + members->SetParent(object); + _selectedEntitiesXmlParser->ParseElement(indexedElement, parserContext, members); + + typedObject->SetMembers(members); + + + } + + int EntitySelectionXmlParser::SubElementMembersParser::GetMinOccur() + { + return 1; + } + + int EntitySelectionXmlParser::SubElementMembersParser::GetMaxOccur() + { + return 1; + } + + bool EntitySelectionXmlParser::SubElementMembersParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MEMBERS ; + } + + std::vector EntitySelectionXmlParser::SubElementMembersParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MEMBERS + }; + } + + EntitySelectionXmlParser::EntitySelectionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EnvironmentXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> EnvironmentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EnvironmentXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EnvironmentXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int EnvironmentXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int EnvironmentXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool EnvironmentXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector EnvironmentXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + EnvironmentXmlParser::SubElementTimeOfDayParser::SubElementTimeOfDayParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeOfDayXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentXmlParser::SubElementTimeOfDayParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeOfDay = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeOfDay->SetParent(object); + _timeOfDayXmlParser->ParseElement(indexedElement, parserContext, timeOfDay); + + typedObject->SetTimeOfDay(timeOfDay); + + + } + + int EnvironmentXmlParser::SubElementTimeOfDayParser::GetMinOccur() + { + return 0; + } + + int EnvironmentXmlParser::SubElementTimeOfDayParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentXmlParser::SubElementTimeOfDayParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_OF_DAY ; + } + + std::vector EnvironmentXmlParser::SubElementTimeOfDayParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_OF_DAY + }; + } + EnvironmentXmlParser::SubElementWeatherParser::SubElementWeatherParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _weatherXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentXmlParser::SubElementWeatherParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto weather = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + weather->SetParent(object); + _weatherXmlParser->ParseElement(indexedElement, parserContext, weather); + + typedObject->SetWeather(weather); + + + } + + int EnvironmentXmlParser::SubElementWeatherParser::GetMinOccur() + { + return 0; + } + + int EnvironmentXmlParser::SubElementWeatherParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentXmlParser::SubElementWeatherParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__WEATHER ; + } + + std::vector EnvironmentXmlParser::SubElementWeatherParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__WEATHER + }; + } + EnvironmentXmlParser::SubElementRoadConditionParser::SubElementRoadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _roadConditionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentXmlParser::SubElementRoadConditionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto roadCondition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + roadCondition->SetParent(object); + _roadConditionXmlParser->ParseElement(indexedElement, parserContext, roadCondition); + + typedObject->SetRoadCondition(roadCondition); + + + } + + int EnvironmentXmlParser::SubElementRoadConditionParser::GetMinOccur() + { + return 0; + } + + int EnvironmentXmlParser::SubElementRoadConditionParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentXmlParser::SubElementRoadConditionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROAD_CONDITION ; + } + + std::vector EnvironmentXmlParser::SubElementRoadConditionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROAD_CONDITION + }; + } + + EnvironmentXmlParser::EnvironmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EnvironmentActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> EnvironmentActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> EnvironmentActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EnvironmentActionXmlParser::SubElementEnvironmentParser::SubElementEnvironmentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _environmentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentActionXmlParser::SubElementEnvironmentParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto environment = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + environment->SetParent(object); + _environmentXmlParser->ParseElement(indexedElement, parserContext, environment); + + typedObject->SetEnvironment(environment); + + + } + + int EnvironmentActionXmlParser::SubElementEnvironmentParser::GetMinOccur() + { + return 1; + } + + int EnvironmentActionXmlParser::SubElementEnvironmentParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentActionXmlParser::SubElementEnvironmentParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENVIRONMENT ; + } + + std::vector EnvironmentActionXmlParser::SubElementEnvironmentParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENVIRONMENT + }; + } + EnvironmentActionXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentActionXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int EnvironmentActionXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int EnvironmentActionXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentActionXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector EnvironmentActionXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + + EnvironmentActionXmlParser::EnvironmentActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EnvironmentCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> EnvironmentCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> EnvironmentCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector EnvironmentCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + EnvironmentCatalogLocationXmlParser::EnvironmentCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EventImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + EventXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> EventXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaximumExecutionCount: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaximumExecutionCount(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaximumExecutionCount(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePriority: public IAttributeParser, public XmlParserBase + { + public: + AttributePriority(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Priority::GetFromLiteral(attributeValue); + if (kResult != Priority::UNKNOWN) + { + typedObject->SetPriority(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Priority::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Priority::GetDeprecatedVersion(kResult) +"'. " + Priority::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PRIORITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> EventXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + EventXmlParser::SubElementActionsParser::SubElementActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _actionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EventXmlParser::SubElementActionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto actions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + actions->SetParent(object); + _actionXmlParser->ParseElement(indexedElement, parserContext, actions); + auto actionsList = typedObject->GetWriterActions(); + actionsList.push_back(actions); + typedObject->SetActions(actionsList); + + + } + + int EventXmlParser::SubElementActionsParser::GetMinOccur() + { + return 1; + } + + int EventXmlParser::SubElementActionsParser::GetMaxOccur() + { + return -1; + } + + bool EventXmlParser::SubElementActionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACTION ; + } + + std::vector EventXmlParser::SubElementActionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACTION + }; + } + EventXmlParser::SubElementStartTriggerParser::SubElementStartTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _triggerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void EventXmlParser::SubElementStartTriggerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto startTrigger = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + startTrigger->SetParent(object); + _triggerXmlParser->ParseElement(indexedElement, parserContext, startTrigger); + + typedObject->SetStartTrigger(startTrigger); + + + } + + int EventXmlParser::SubElementStartTriggerParser::GetMinOccur() + { + return 0; + } + + int EventXmlParser::SubElementStartTriggerParser::GetMaxOccur() + { + return 1; + } + + bool EventXmlParser::SubElementStartTriggerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__START_TRIGGER ; + } + + std::vector EventXmlParser::SubElementStartTriggerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__START_TRIGGER + }; + } + + EventXmlParser::EventXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ExternalObjectReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ExternalObjectReferenceXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ExternalObjectReferenceXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ExternalObjectReferenceXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ExternalObjectReferenceXmlParser::ExternalObjectReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FileImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + FileXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> FileXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeFilepath: public IAttributeParser, public XmlParserBase + { + public: + AttributeFilepath(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFilepath(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FILEPATH, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> FileXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + FileXmlParser::FileXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FileHeaderImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + FileHeaderXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> FileHeaderXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAuthor: public IAttributeParser, public XmlParserBase + { + public: + AttributeAuthor(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAuthor(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__AUTHOR, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDate: public IAttributeParser, public XmlParserBase + { + public: + AttributeDate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDate(ParseDateTime(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDescription: public IAttributeParser, public XmlParserBase + { + public: + AttributeDescription(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDescription(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DESCRIPTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRevMajor: public IAttributeParser, public XmlParserBase + { + public: + AttributeRevMajor(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedShort + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRevMajor(ParseUnsignedShort(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRevMinor: public IAttributeParser, public XmlParserBase + { + public: + AttributeRevMinor(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedShort + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRevMinor(ParseUnsignedShort(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> FileHeaderXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + FileHeaderXmlParser::SubElementLicenseParser::SubElementLicenseParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _licenseXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FileHeaderXmlParser::SubElementLicenseParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto license = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + license->SetParent(object); + _licenseXmlParser->ParseElement(indexedElement, parserContext, license); + + typedObject->SetLicense(license); + + + } + + int FileHeaderXmlParser::SubElementLicenseParser::GetMinOccur() + { + return 0; + } + + int FileHeaderXmlParser::SubElementLicenseParser::GetMaxOccur() + { + return 1; + } + + bool FileHeaderXmlParser::SubElementLicenseParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LICENSE ; + } + + std::vector FileHeaderXmlParser::SubElementLicenseParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LICENSE + }; + } + FileHeaderXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FileHeaderXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int FileHeaderXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int FileHeaderXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool FileHeaderXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector FileHeaderXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + FileHeaderXmlParser::FileHeaderXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FinalSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + FinalSpeedXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> FinalSpeedXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> FinalSpeedXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::SubElementAbsoluteSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _absoluteSpeedXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto absoluteSpeed = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + absoluteSpeed->SetParent(object); + _absoluteSpeedXmlParser->ParseElement(indexedElement, parserContext, absoluteSpeed); + + typedObject->SetAbsoluteSpeed(absoluteSpeed); + + + } + + int FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::GetMinOccur() + { + return 1; + } + + int FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::GetMaxOccur() + { + return 1; + } + + bool FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED ; + } + + std::vector FinalSpeedXmlParser::SubElementAbsoluteSpeedParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ABSOLUTE_SPEED + }; + } + FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::SubElementRelativeSpeedToMasterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeSpeedToMasterXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeSpeedToMaster = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeSpeedToMaster->SetParent(object); + _relativeSpeedToMasterXmlParser->ParseElement(indexedElement, parserContext, relativeSpeedToMaster); + + typedObject->SetRelativeSpeedToMaster(relativeSpeedToMaster); + + + } + + int FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::GetMinOccur() + { + return 1; + } + + int FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::GetMaxOccur() + { + return 1; + } + + bool FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER ; + } + + std::vector FinalSpeedXmlParser::SubElementRelativeSpeedToMasterParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_SPEED_TO_MASTER + }; + } + + FinalSpeedXmlParser::FinalSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FogImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + FogXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> FogXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeVisualRange: public IAttributeParser, public XmlParserBase + { + public: + AttributeVisualRange(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVisualRange(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VISUAL_RANGE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> FogXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + FogXmlParser::SubElementBoundingBoxParser::SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _boundingBoxXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FogXmlParser::SubElementBoundingBoxParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto boundingBox = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + boundingBox->SetParent(object); + _boundingBoxXmlParser->ParseElement(indexedElement, parserContext, boundingBox); + + typedObject->SetBoundingBox(boundingBox); + + + } + + int FogXmlParser::SubElementBoundingBoxParser::GetMinOccur() + { + return 0; + } + + int FogXmlParser::SubElementBoundingBoxParser::GetMaxOccur() + { + return 1; + } + + bool FogXmlParser::SubElementBoundingBoxParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX ; + } + + std::vector FogXmlParser::SubElementBoundingBoxParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BOUNDING_BOX + }; + } + + FogXmlParser::FogXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FollowTrajectoryActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + FollowTrajectoryActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> FollowTrajectoryActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeInitialDistanceOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeInitialDistanceOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetInitialDistanceOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__INITIAL_DISTANCE_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> FollowTrajectoryActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::SubElementTrajectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectory->SetParent(object); + _trajectoryXmlParser->ParseElement(indexedElement, parserContext, trajectory); + + typedObject->SetTrajectory(trajectory); + + + if (!_trajectoryXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.1'. Comment: 'Use trajectoryRef instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _trajectoryXmlParser->_filename)); + _trajectoryXmlParser->_messageLogger.LogMessage(msg); + } + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::GetMinOccur() + { + return 0; + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::GetMaxOccur() + { + return 1; + } + + bool FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY ; + } + + std::vector FollowTrajectoryActionXmlParser::SubElementTrajectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY + }; + } + FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + if (!_catalogReferenceXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.1'. Comment: 'Use trajectoryRef instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _catalogReferenceXmlParser->_filename)); + _catalogReferenceXmlParser->_messageLogger.LogMessage(msg); + } + } + + int FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 0; + } + + int FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector FollowTrajectoryActionXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::SubElementTimeReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeReference->SetParent(object); + _timeReferenceXmlParser->ParseElement(indexedElement, parserContext, timeReference); + + typedObject->SetTimeReference(timeReference); + + + } + + int FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::GetMinOccur() + { + return 1; + } + + int FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::GetMaxOccur() + { + return 1; + } + + bool FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_REFERENCE ; + } + + std::vector FollowTrajectoryActionXmlParser::SubElementTimeReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_REFERENCE + }; + } + FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::SubElementTrajectoryFollowingModeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryFollowingModeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectoryFollowingMode = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectoryFollowingMode->SetParent(object); + _trajectoryFollowingModeXmlParser->ParseElement(indexedElement, parserContext, trajectoryFollowingMode); + + typedObject->SetTrajectoryFollowingMode(trajectoryFollowingMode); + + + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::GetMinOccur() + { + return 1; + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::GetMaxOccur() + { + return 1; + } + + bool FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY_FOLLOWING_MODE ; + } + + std::vector FollowTrajectoryActionXmlParser::SubElementTrajectoryFollowingModeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY_FOLLOWING_MODE + }; + } + FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::SubElementTrajectoryRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectoryRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectoryRef->SetParent(object); + _trajectoryRefXmlParser->ParseElement(indexedElement, parserContext, trajectoryRef); + + typedObject->SetTrajectoryRef(trajectoryRef); + + + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::GetMinOccur() + { + return 0; + } + + int FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::GetMaxOccur() + { + return 1; + } + + bool FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF ; + } + + std::vector FollowTrajectoryActionXmlParser::SubElementTrajectoryRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF + }; + } + + FollowTrajectoryActionXmlParser::FollowTrajectoryActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + GearXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> GearXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> GearXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + GearXmlParser::SubElementManualGearParser::SubElementManualGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _manualGearXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GearXmlParser::SubElementManualGearParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto manualGear = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + manualGear->SetParent(object); + _manualGearXmlParser->ParseElement(indexedElement, parserContext, manualGear); + + typedObject->SetManualGear(manualGear); + + + } + + int GearXmlParser::SubElementManualGearParser::GetMinOccur() + { + return 1; + } + + int GearXmlParser::SubElementManualGearParser::GetMaxOccur() + { + return 1; + } + + bool GearXmlParser::SubElementManualGearParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MANUAL_GEAR ; + } + + std::vector GearXmlParser::SubElementManualGearParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MANUAL_GEAR + }; + } + GearXmlParser::SubElementAutomaticGearParser::SubElementAutomaticGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _automaticGearXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GearXmlParser::SubElementAutomaticGearParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto automaticGear = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + automaticGear->SetParent(object); + _automaticGearXmlParser->ParseElement(indexedElement, parserContext, automaticGear); + + typedObject->SetAutomaticGear(automaticGear); + + + } + + int GearXmlParser::SubElementAutomaticGearParser::GetMinOccur() + { + return 1; + } + + int GearXmlParser::SubElementAutomaticGearParser::GetMaxOccur() + { + return 1; + } + + bool GearXmlParser::SubElementAutomaticGearParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR ; + } + + std::vector GearXmlParser::SubElementAutomaticGearParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__AUTOMATIC_GEAR + }; + } + + GearXmlParser::GearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GeoPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + GeoPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> GeoPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAltitude: public IAttributeParser, public XmlParserBase + { + public: + AttributeAltitude(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAltitude(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ALTITUDE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeHeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeHeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetHeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use altitude instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__HEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLatitude: public IAttributeParser, public XmlParserBase + { + public: + AttributeLatitude(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLatitude(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use latitudeDeg instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LATITUDE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLatitudeDeg: public IAttributeParser, public XmlParserBase + { + public: + AttributeLatitudeDeg(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLatitudeDeg(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LATITUDE_DEG, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLongitude: public IAttributeParser, public XmlParserBase + { + public: + AttributeLongitude(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLongitude(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use longitudeDeg instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLongitudeDeg: public IAttributeParser, public XmlParserBase + { + public: + AttributeLongitudeDeg(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLongitudeDeg(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LONGITUDE_DEG, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVerticalRoadSelection: public IAttributeParser, public XmlParserBase + { + public: + AttributeVerticalRoadSelection(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVerticalRoadSelection(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VERTICAL_ROAD_SELECTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> GeoPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + GeoPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GeoPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int GeoPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int GeoPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool GeoPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector GeoPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + GeoPositionXmlParser::GeoPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GlobalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + GlobalActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> GlobalActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> GlobalActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + GlobalActionXmlParser::SubElementEnvironmentActionParser::SubElementEnvironmentActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _environmentActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementEnvironmentActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto environmentAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + environmentAction->SetParent(object); + _environmentActionXmlParser->ParseElement(indexedElement, parserContext, environmentAction); + + typedObject->SetEnvironmentAction(environmentAction); + + + } + + int GlobalActionXmlParser::SubElementEnvironmentActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementEnvironmentActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementEnvironmentActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementEnvironmentActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENVIRONMENT_ACTION + }; + } + GlobalActionXmlParser::SubElementEntityActionParser::SubElementEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementEntityActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityAction->SetParent(object); + _entityActionXmlParser->ParseElement(indexedElement, parserContext, entityAction); + + typedObject->SetEntityAction(entityAction); + + + } + + int GlobalActionXmlParser::SubElementEntityActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementEntityActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementEntityActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementEntityActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_ACTION + }; + } + GlobalActionXmlParser::SubElementInfrastructureActionParser::SubElementInfrastructureActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _infrastructureActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementInfrastructureActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto infrastructureAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + infrastructureAction->SetParent(object); + _infrastructureActionXmlParser->ParseElement(indexedElement, parserContext, infrastructureAction); + + typedObject->SetInfrastructureAction(infrastructureAction); + + + } + + int GlobalActionXmlParser::SubElementInfrastructureActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementInfrastructureActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementInfrastructureActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementInfrastructureActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__INFRASTRUCTURE_ACTION + }; + } + GlobalActionXmlParser::SubElementSetMonitorActionParser::SubElementSetMonitorActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _setMonitorActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementSetMonitorActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto setMonitorAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + setMonitorAction->SetParent(object); + _setMonitorActionXmlParser->ParseElement(indexedElement, parserContext, setMonitorAction); + + typedObject->SetSetMonitorAction(setMonitorAction); + + + } + + int GlobalActionXmlParser::SubElementSetMonitorActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementSetMonitorActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementSetMonitorActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementSetMonitorActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SET_MONITOR_ACTION + }; + } + GlobalActionXmlParser::SubElementParameterActionParser::SubElementParameterActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementParameterActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterAction->SetParent(object); + _parameterActionXmlParser->ParseElement(indexedElement, parserContext, parameterAction); + + typedObject->SetParameterAction(parameterAction); + + + if (!_parameterActionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.2'. Comment: 'Use variableAction'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _parameterActionXmlParser->_filename)); + _parameterActionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int GlobalActionXmlParser::SubElementParameterActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementParameterActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementParameterActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementParameterActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_ACTION + }; + } + GlobalActionXmlParser::SubElementTrafficActionParser::SubElementTrafficActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementTrafficActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficAction->SetParent(object); + _trafficActionXmlParser->ParseElement(indexedElement, parserContext, trafficAction); + + typedObject->SetTrafficAction(trafficAction); + + + } + + int GlobalActionXmlParser::SubElementTrafficActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementTrafficActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementTrafficActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementTrafficActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_ACTION + }; + } + GlobalActionXmlParser::SubElementVariableActionParser::SubElementVariableActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void GlobalActionXmlParser::SubElementVariableActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto variableAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + variableAction->SetParent(object); + _variableActionXmlParser->ParseElement(indexedElement, parserContext, variableAction); + + typedObject->SetVariableAction(variableAction); + + + } + + int GlobalActionXmlParser::SubElementVariableActionParser::GetMinOccur() + { + return 1; + } + + int GlobalActionXmlParser::SubElementVariableActionParser::GetMaxOccur() + { + return 1; + } + + bool GlobalActionXmlParser::SubElementVariableActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION ; + } + + std::vector GlobalActionXmlParser::SubElementVariableActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VARIABLE_ACTION + }; + } + + GlobalActionXmlParser::GlobalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a HistogramImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + HistogramXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> HistogramXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> HistogramXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + HistogramXmlParser::SubElementBinsParser::SubElementBinsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _histogramBinXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void HistogramXmlParser::SubElementBinsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto bins = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + bins->SetParent(object); + _histogramBinXmlParser->ParseElement(indexedElement, parserContext, bins); + auto binsList = typedObject->GetWriterBins(); + binsList.push_back(bins); + typedObject->SetBins(binsList); + + + } + + int HistogramXmlParser::SubElementBinsParser::GetMinOccur() + { + return 1; + } + + int HistogramXmlParser::SubElementBinsParser::GetMaxOccur() + { + return -1; + } + + bool HistogramXmlParser::SubElementBinsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BIN ; + } + + std::vector HistogramXmlParser::SubElementBinsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BIN + }; + } + + HistogramXmlParser::HistogramXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a HistogramBinImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + HistogramBinXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> HistogramBinXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> HistogramBinXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + HistogramBinXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void HistogramBinXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int HistogramBinXmlParser::SubElementRangeParser::GetMinOccur() + { + return 1; + } + + int HistogramBinXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool HistogramBinXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector HistogramBinXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + HistogramBinXmlParser::HistogramBinXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InRoutePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + InRoutePositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> InRoutePositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> InRoutePositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + InRoutePositionXmlParser::SubElementFromCurrentEntityParser::SubElementFromCurrentEntityParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionOfCurrentEntityXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InRoutePositionXmlParser::SubElementFromCurrentEntityParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto fromCurrentEntity = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + fromCurrentEntity->SetParent(object); + _positionOfCurrentEntityXmlParser->ParseElement(indexedElement, parserContext, fromCurrentEntity); + + typedObject->SetFromCurrentEntity(fromCurrentEntity); + + + } + + int InRoutePositionXmlParser::SubElementFromCurrentEntityParser::GetMinOccur() + { + return 1; + } + + int InRoutePositionXmlParser::SubElementFromCurrentEntityParser::GetMaxOccur() + { + return 1; + } + + bool InRoutePositionXmlParser::SubElementFromCurrentEntityParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY ; + } + + std::vector InRoutePositionXmlParser::SubElementFromCurrentEntityParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FROM_CURRENT_ENTITY + }; + } + InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::SubElementFromRoadCoordinatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionInRoadCoordinatesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto fromRoadCoordinates = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + fromRoadCoordinates->SetParent(object); + _positionInRoadCoordinatesXmlParser->ParseElement(indexedElement, parserContext, fromRoadCoordinates); + + typedObject->SetFromRoadCoordinates(fromRoadCoordinates); + + + } + + int InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::GetMinOccur() + { + return 1; + } + + int InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::GetMaxOccur() + { + return 1; + } + + bool InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES ; + } + + std::vector InRoutePositionXmlParser::SubElementFromRoadCoordinatesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FROM_ROAD_COORDINATES + }; + } + InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::SubElementFromLaneCoordinatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionInLaneCoordinatesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto fromLaneCoordinates = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + fromLaneCoordinates->SetParent(object); + _positionInLaneCoordinatesXmlParser->ParseElement(indexedElement, parserContext, fromLaneCoordinates); + + typedObject->SetFromLaneCoordinates(fromLaneCoordinates); + + + } + + int InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::GetMinOccur() + { + return 1; + } + + int InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::GetMaxOccur() + { + return 1; + } + + bool InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES ; + } + + std::vector InRoutePositionXmlParser::SubElementFromLaneCoordinatesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FROM_LANE_COORDINATES + }; + } + + InRoutePositionXmlParser::InRoutePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InfrastructureActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + InfrastructureActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> InfrastructureActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> InfrastructureActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::SubElementTrafficSignalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalAction->SetParent(object); + _trafficSignalActionXmlParser->ParseElement(indexedElement, parserContext, trafficSignalAction); + + typedObject->SetTrafficSignalAction(trafficSignalAction); + + + } + + int InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::GetMinOccur() + { + return 1; + } + + int InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::GetMaxOccur() + { + return 1; + } + + bool InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_ACTION ; + } + + std::vector InfrastructureActionXmlParser::SubElementTrafficSignalActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_ACTION + }; + } + + InfrastructureActionXmlParser::InfrastructureActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InitImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + InitXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> InitXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> InitXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + InitXmlParser::SubElementActionsParser::SubElementActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _initActionsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InitXmlParser::SubElementActionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto actions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + actions->SetParent(object); + _initActionsXmlParser->ParseElement(indexedElement, parserContext, actions); + + typedObject->SetActions(actions); + + + } + + int InitXmlParser::SubElementActionsParser::GetMinOccur() + { + return 1; + } + + int InitXmlParser::SubElementActionsParser::GetMaxOccur() + { + return 1; + } + + bool InitXmlParser::SubElementActionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACTIONS ; + } + + std::vector InitXmlParser::SubElementActionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACTIONS + }; + } + + InitXmlParser::InitXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InitActionsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + InitActionsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> InitActionsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> InitActionsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + InitActionsXmlParser::SubElementGlobalActionsParser::SubElementGlobalActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _globalActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InitActionsXmlParser::SubElementGlobalActionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto globalActions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + globalActions->SetParent(object); + _globalActionXmlParser->ParseElement(indexedElement, parserContext, globalActions); + auto globalActionsList = typedObject->GetWriterGlobalActions(); + globalActionsList.push_back(globalActions); + typedObject->SetGlobalActions(globalActionsList); + + + } + + int InitActionsXmlParser::SubElementGlobalActionsParser::GetMinOccur() + { + return 0; + } + + int InitActionsXmlParser::SubElementGlobalActionsParser::GetMaxOccur() + { + return -1; + } + + bool InitActionsXmlParser::SubElementGlobalActionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION ; + } + + std::vector InitActionsXmlParser::SubElementGlobalActionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__GLOBAL_ACTION + }; + } + InitActionsXmlParser::SubElementUserDefinedActionsParser::SubElementUserDefinedActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InitActionsXmlParser::SubElementUserDefinedActionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedActions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedActions->SetParent(object); + _userDefinedActionXmlParser->ParseElement(indexedElement, parserContext, userDefinedActions); + auto userDefinedActionsList = typedObject->GetWriterUserDefinedActions(); + userDefinedActionsList.push_back(userDefinedActions); + typedObject->SetUserDefinedActions(userDefinedActionsList); + + + } + + int InitActionsXmlParser::SubElementUserDefinedActionsParser::GetMinOccur() + { + return 0; + } + + int InitActionsXmlParser::SubElementUserDefinedActionsParser::GetMaxOccur() + { + return -1; + } + + bool InitActionsXmlParser::SubElementUserDefinedActionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION ; + } + + std::vector InitActionsXmlParser::SubElementUserDefinedActionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_ACTION + }; + } + InitActionsXmlParser::SubElementPrivatesParser::SubElementPrivatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _privateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void InitActionsXmlParser::SubElementPrivatesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto privates = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + privates->SetParent(object); + _privateXmlParser->ParseElement(indexedElement, parserContext, privates); + auto privatesList = typedObject->GetWriterPrivates(); + privatesList.push_back(privates); + typedObject->SetPrivates(privatesList); + + + } + + int InitActionsXmlParser::SubElementPrivatesParser::GetMinOccur() + { + return 0; + } + + int InitActionsXmlParser::SubElementPrivatesParser::GetMaxOccur() + { + return -1; + } + + bool InitActionsXmlParser::SubElementPrivatesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PRIVATE ; + } + + std::vector InitActionsXmlParser::SubElementPrivatesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PRIVATE + }; + } + + InitActionsXmlParser::InitActionsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a KnotImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + KnotXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> KnotXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> KnotXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + KnotXmlParser::KnotXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LaneXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeId: public IAttributeParser, public XmlParserBase + { + public: + AttributeId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetId(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LaneXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + LaneXmlParser::LaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneChangeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneChangeActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LaneChangeActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTargetLaneOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeTargetLaneOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTargetLaneOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TARGET_LANE_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LaneChangeActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::SubElementLaneChangeActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _transitionDynamicsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneChangeActionDynamics = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneChangeActionDynamics->SetParent(object); + _transitionDynamicsXmlParser->ParseElement(indexedElement, parserContext, laneChangeActionDynamics); + + typedObject->SetLaneChangeActionDynamics(laneChangeActionDynamics); + + + } + + int LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::GetMinOccur() + { + return 1; + } + + int LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::GetMaxOccur() + { + return 1; + } + + bool LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION_DYNAMICS ; + } + + std::vector LaneChangeActionXmlParser::SubElementLaneChangeActionDynamicsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION_DYNAMICS + }; + } + LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::SubElementLaneChangeTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneChangeTargetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneChangeTarget = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneChangeTarget->SetParent(object); + _laneChangeTargetXmlParser->ParseElement(indexedElement, parserContext, laneChangeTarget); + + typedObject->SetLaneChangeTarget(laneChangeTarget); + + + } + + int LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::GetMinOccur() + { + return 1; + } + + int LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::GetMaxOccur() + { + return 1; + } + + bool LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_TARGET ; + } + + std::vector LaneChangeActionXmlParser::SubElementLaneChangeTargetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_CHANGE_TARGET + }; + } + + LaneChangeActionXmlParser::LaneChangeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneChangeTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneChangeTargetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> LaneChangeTargetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> LaneChangeTargetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::SubElementRelativeTargetLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeTargetLaneXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeTargetLane = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeTargetLane->SetParent(object); + _relativeTargetLaneXmlParser->ParseElement(indexedElement, parserContext, relativeTargetLane); + + typedObject->SetRelativeTargetLane(relativeTargetLane); + + + } + + int LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::GetMinOccur() + { + return 1; + } + + int LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::GetMaxOccur() + { + return 1; + } + + bool LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE ; + } + + std::vector LaneChangeTargetXmlParser::SubElementRelativeTargetLaneParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE + }; + } + LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::SubElementAbsoluteTargetLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _absoluteTargetLaneXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto absoluteTargetLane = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + absoluteTargetLane->SetParent(object); + _absoluteTargetLaneXmlParser->ParseElement(indexedElement, parserContext, absoluteTargetLane); + + typedObject->SetAbsoluteTargetLane(absoluteTargetLane); + + + } + + int LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::GetMinOccur() + { + return 1; + } + + int LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::GetMaxOccur() + { + return 1; + } + + bool LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE ; + } + + std::vector LaneChangeTargetXmlParser::SubElementAbsoluteTargetLaneParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE + }; + } + + LaneChangeTargetXmlParser::LaneChangeTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneOffsetActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LaneOffsetActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeContinuous: public IAttributeParser, public XmlParserBase + { + public: + AttributeContinuous(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetContinuous(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LaneOffsetActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::SubElementLaneOffsetActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneOffsetActionDynamicsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneOffsetActionDynamics = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneOffsetActionDynamics->SetParent(object); + _laneOffsetActionDynamicsXmlParser->ParseElement(indexedElement, parserContext, laneOffsetActionDynamics); + + typedObject->SetLaneOffsetActionDynamics(laneOffsetActionDynamics); + + + } + + int LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::GetMinOccur() + { + return 1; + } + + int LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::GetMaxOccur() + { + return 1; + } + + bool LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION_DYNAMICS ; + } + + std::vector LaneOffsetActionXmlParser::SubElementLaneOffsetActionDynamicsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION_DYNAMICS + }; + } + LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::SubElementLaneOffsetTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneOffsetTargetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneOffsetTarget = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneOffsetTarget->SetParent(object); + _laneOffsetTargetXmlParser->ParseElement(indexedElement, parserContext, laneOffsetTarget); + + typedObject->SetLaneOffsetTarget(laneOffsetTarget); + + + } + + int LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::GetMinOccur() + { + return 1; + } + + int LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::GetMaxOccur() + { + return 1; + } + + bool LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_TARGET ; + } + + std::vector LaneOffsetActionXmlParser::SubElementLaneOffsetTargetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_OFFSET_TARGET + }; + } + + LaneOffsetActionXmlParser::LaneOffsetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetActionDynamicsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneOffsetActionDynamicsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> LaneOffsetActionDynamicsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDynamicsShape: public IAttributeParser, public XmlParserBase + { + public: + AttributeDynamicsShape(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DynamicsShape::GetFromLiteral(attributeValue); + if (kResult != DynamicsShape::UNKNOWN) + { + typedObject->SetDynamicsShape(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DynamicsShape::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DynamicsShape::GetDeprecatedVersion(kResult) +"'. " + DynamicsShape::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxLateralAcc: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxLateralAcc(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxLateralAcc(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_LATERAL_ACC, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LaneOffsetActionDynamicsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + LaneOffsetActionDynamicsXmlParser::LaneOffsetActionDynamicsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LaneOffsetTargetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> LaneOffsetTargetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> LaneOffsetTargetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::SubElementRelativeTargetLaneOffsetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeTargetLaneOffsetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeTargetLaneOffset = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeTargetLaneOffset->SetParent(object); + _relativeTargetLaneOffsetXmlParser->ParseElement(indexedElement, parserContext, relativeTargetLaneOffset); + + typedObject->SetRelativeTargetLaneOffset(relativeTargetLaneOffset); + + + } + + int LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::GetMinOccur() + { + return 1; + } + + int LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::GetMaxOccur() + { + return 1; + } + + bool LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET ; + } + + std::vector LaneOffsetTargetXmlParser::SubElementRelativeTargetLaneOffsetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_LANE_OFFSET + }; + } + LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::SubElementAbsoluteTargetLaneOffsetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _absoluteTargetLaneOffsetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto absoluteTargetLaneOffset = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + absoluteTargetLaneOffset->SetParent(object); + _absoluteTargetLaneOffsetXmlParser->ParseElement(indexedElement, parserContext, absoluteTargetLaneOffset); + + typedObject->SetAbsoluteTargetLaneOffset(absoluteTargetLaneOffset); + + + } + + int LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::GetMinOccur() + { + return 1; + } + + int LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::GetMaxOccur() + { + return 1; + } + + bool LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET ; + } + + std::vector LaneOffsetTargetXmlParser::SubElementAbsoluteTargetLaneOffsetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_LANE_OFFSET + }; + } + + LaneOffsetTargetXmlParser::LaneOffsetTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LanePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LanePositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LanePositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeLaneId: public IAttributeParser, public XmlParserBase + { + public: + AttributeLaneId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLaneId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRoadId: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoadId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRoadId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeS: public IAttributeParser, public XmlParserBase + { + public: + AttributeS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LanePositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LanePositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LanePositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int LanePositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int LanePositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool LanePositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector LanePositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + LanePositionXmlParser::LanePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LateralActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LateralActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> LateralActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> LateralActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LateralActionXmlParser::SubElementLaneChangeActionParser::SubElementLaneChangeActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneChangeActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LateralActionXmlParser::SubElementLaneChangeActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneChangeAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneChangeAction->SetParent(object); + _laneChangeActionXmlParser->ParseElement(indexedElement, parserContext, laneChangeAction); + + typedObject->SetLaneChangeAction(laneChangeAction); + + + } + + int LateralActionXmlParser::SubElementLaneChangeActionParser::GetMinOccur() + { + return 1; + } + + int LateralActionXmlParser::SubElementLaneChangeActionParser::GetMaxOccur() + { + return 1; + } + + bool LateralActionXmlParser::SubElementLaneChangeActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION ; + } + + std::vector LateralActionXmlParser::SubElementLaneChangeActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_CHANGE_ACTION + }; + } + LateralActionXmlParser::SubElementLaneOffsetActionParser::SubElementLaneOffsetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneOffsetActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LateralActionXmlParser::SubElementLaneOffsetActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto laneOffsetAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + laneOffsetAction->SetParent(object); + _laneOffsetActionXmlParser->ParseElement(indexedElement, parserContext, laneOffsetAction); + + typedObject->SetLaneOffsetAction(laneOffsetAction); + + + } + + int LateralActionXmlParser::SubElementLaneOffsetActionParser::GetMinOccur() + { + return 1; + } + + int LateralActionXmlParser::SubElementLaneOffsetActionParser::GetMaxOccur() + { + return 1; + } + + bool LateralActionXmlParser::SubElementLaneOffsetActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION ; + } + + std::vector LateralActionXmlParser::SubElementLaneOffsetActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_OFFSET_ACTION + }; + } + LateralActionXmlParser::SubElementLateralDistanceActionParser::SubElementLateralDistanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lateralDistanceActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LateralActionXmlParser::SubElementLateralDistanceActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lateralDistanceAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lateralDistanceAction->SetParent(object); + _lateralDistanceActionXmlParser->ParseElement(indexedElement, parserContext, lateralDistanceAction); + + typedObject->SetLateralDistanceAction(lateralDistanceAction); + + + } + + int LateralActionXmlParser::SubElementLateralDistanceActionParser::GetMinOccur() + { + return 1; + } + + int LateralActionXmlParser::SubElementLateralDistanceActionParser::GetMaxOccur() + { + return 1; + } + + bool LateralActionXmlParser::SubElementLateralDistanceActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION ; + } + + std::vector LateralActionXmlParser::SubElementLateralDistanceActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LATERAL_DISTANCE_ACTION + }; + } + + LateralActionXmlParser::LateralActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LateralDistanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LateralDistanceActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LateralDistanceActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeContinuous: public IAttributeParser, public XmlParserBase + { + public: + AttributeContinuous(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetContinuous(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDisplacement: public IAttributeParser, public XmlParserBase + { + public: + AttributeDisplacement(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = LateralDisplacement::GetFromLiteral(attributeValue); + if (kResult != LateralDisplacement::UNKNOWN) + { + typedObject->SetDisplacement(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (LateralDisplacement::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + LateralDisplacement::GetDeprecatedVersion(kResult) +"'. " + LateralDisplacement::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDistance: public IAttributeParser, public XmlParserBase + { + public: + AttributeDistance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDistance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LateralDistanceActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _dynamicConstraintsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto dynamicConstraints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + dynamicConstraints->SetParent(object); + _dynamicConstraintsXmlParser->ParseElement(indexedElement, parserContext, dynamicConstraints); + + typedObject->SetDynamicConstraints(dynamicConstraints); + + + } + + int LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetMinOccur() + { + return 0; + } + + int LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetMaxOccur() + { + return 1; + } + + bool LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS ; + } + + std::vector LateralDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS + }; + } + + LateralDistanceActionXmlParser::LateralDistanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LicenseImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + bool LicenseXmlParser::IsContentRequired() + { + return false; + } + + std::map> LicenseXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeResource: public IAttributeParser, public XmlParserBase + { + public: + AttributeResource(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetResource(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RESOURCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSpdxId: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpdxId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSpdxId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPDX_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + void LicenseXmlParser::SetContentProperty(const std::string content, std::shared_ptr object) + { + auto typedObject = std::static_pointer_cast(object); + typedObject->SetText(content); + } + + LicenseXmlParser::LicenseXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) : + /* to check: XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + }*/ + XmlSimpleContentParser(messageLogger, filename, parserOptions) {} + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LightStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> LightStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeFlashingOffDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeFlashingOffDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFlashingOffDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FLASHING_OFF_DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFlashingOnDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeFlashingOnDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFlashingOnDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FLASHING_ON_DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLuminousIntensity: public IAttributeParser, public XmlParserBase + { + public: + AttributeLuminousIntensity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLuminousIntensity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LUMINOUS_INTENSITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMode: public IAttributeParser, public XmlParserBase + { + public: + AttributeMode(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = LightMode::GetFromLiteral(attributeValue); + if (kResult != LightMode::UNKNOWN) + { + typedObject->SetMode(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (LightMode::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + LightMode::GetDeprecatedVersion(kResult) +"'. " + LightMode::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MODE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MODE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MODE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LightStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LightStateXmlParser::SubElementColorParser::SubElementColorParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _colorXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LightStateXmlParser::SubElementColorParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto color = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + color->SetParent(object); + _colorXmlParser->ParseElement(indexedElement, parserContext, color); + + typedObject->SetColor(color); + + + } + + int LightStateXmlParser::SubElementColorParser::GetMinOccur() + { + return 0; + } + + int LightStateXmlParser::SubElementColorParser::GetMaxOccur() + { + return 1; + } + + bool LightStateXmlParser::SubElementColorParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__COLOR ; + } + + std::vector LightStateXmlParser::SubElementColorParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__COLOR + }; + } + + LightStateXmlParser::LightStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightStateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LightStateActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> LightStateActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTransitionTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeTransitionTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTransitionTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRANSITION_TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LightStateActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LightStateActionXmlParser::SubElementLightTypeParser::SubElementLightTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lightTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LightStateActionXmlParser::SubElementLightTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lightType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lightType->SetParent(object); + _lightTypeXmlParser->ParseElement(indexedElement, parserContext, lightType); + + typedObject->SetLightType(lightType); + + + } + + int LightStateActionXmlParser::SubElementLightTypeParser::GetMinOccur() + { + return 1; + } + + int LightStateActionXmlParser::SubElementLightTypeParser::GetMaxOccur() + { + return 1; + } + + bool LightStateActionXmlParser::SubElementLightTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LIGHT_TYPE ; + } + + std::vector LightStateActionXmlParser::SubElementLightTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LIGHT_TYPE + }; + } + LightStateActionXmlParser::SubElementLightStateParser::SubElementLightStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lightStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LightStateActionXmlParser::SubElementLightStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lightState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lightState->SetParent(object); + _lightStateXmlParser->ParseElement(indexedElement, parserContext, lightState); + + typedObject->SetLightState(lightState); + + + } + + int LightStateActionXmlParser::SubElementLightStateParser::GetMinOccur() + { + return 1; + } + + int LightStateActionXmlParser::SubElementLightStateParser::GetMaxOccur() + { + return 1; + } + + bool LightStateActionXmlParser::SubElementLightStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LIGHT_STATE ; + } + + std::vector LightStateActionXmlParser::SubElementLightStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LIGHT_STATE + }; + } + + LightStateActionXmlParser::LightStateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LightTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> LightTypeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> LightTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LightTypeXmlParser::SubElementVehicleLightParser::SubElementVehicleLightParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleLightXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LightTypeXmlParser::SubElementVehicleLightParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleLight = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleLight->SetParent(object); + _vehicleLightXmlParser->ParseElement(indexedElement, parserContext, vehicleLight); + + typedObject->SetVehicleLight(vehicleLight); + + + } + + int LightTypeXmlParser::SubElementVehicleLightParser::GetMinOccur() + { + return 1; + } + + int LightTypeXmlParser::SubElementVehicleLightParser::GetMaxOccur() + { + return 1; + } + + bool LightTypeXmlParser::SubElementVehicleLightParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT ; + } + + std::vector LightTypeXmlParser::SubElementVehicleLightParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_LIGHT + }; + } + LightTypeXmlParser::SubElementUserDefinedLightParser::SubElementUserDefinedLightParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedLightXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LightTypeXmlParser::SubElementUserDefinedLightParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedLight = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedLight->SetParent(object); + _userDefinedLightXmlParser->ParseElement(indexedElement, parserContext, userDefinedLight); + + typedObject->SetUserDefinedLight(userDefinedLight); + + + } + + int LightTypeXmlParser::SubElementUserDefinedLightParser::GetMinOccur() + { + return 1; + } + + int LightTypeXmlParser::SubElementUserDefinedLightParser::GetMaxOccur() + { + return 1; + } + + bool LightTypeXmlParser::SubElementUserDefinedLightParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT ; + } + + std::vector LightTypeXmlParser::SubElementUserDefinedLightParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_LIGHT + }; + } + + LightTypeXmlParser::LightTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LogNormalDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LogNormalDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> LogNormalDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeExpectedValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeExpectedValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetExpectedValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVariance: public IAttributeParser, public XmlParserBase + { + public: + AttributeVariance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVariance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LogNormalDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LogNormalDistributionXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LogNormalDistributionXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int LogNormalDistributionXmlParser::SubElementRangeParser::GetMinOccur() + { + return 0; + } + + int LogNormalDistributionXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool LogNormalDistributionXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector LogNormalDistributionXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + LogNormalDistributionXmlParser::LogNormalDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LongitudinalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LongitudinalActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> LongitudinalActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> LongitudinalActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LongitudinalActionXmlParser::SubElementSpeedActionParser::SubElementSpeedActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _speedActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LongitudinalActionXmlParser::SubElementSpeedActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedAction->SetParent(object); + _speedActionXmlParser->ParseElement(indexedElement, parserContext, speedAction); + + typedObject->SetSpeedAction(speedAction); + + + } + + int LongitudinalActionXmlParser::SubElementSpeedActionParser::GetMinOccur() + { + return 1; + } + + int LongitudinalActionXmlParser::SubElementSpeedActionParser::GetMaxOccur() + { + return 1; + } + + bool LongitudinalActionXmlParser::SubElementSpeedActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_ACTION ; + } + + std::vector LongitudinalActionXmlParser::SubElementSpeedActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_ACTION + }; + } + LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::SubElementLongitudinalDistanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _longitudinalDistanceActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto longitudinalDistanceAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + longitudinalDistanceAction->SetParent(object); + _longitudinalDistanceActionXmlParser->ParseElement(indexedElement, parserContext, longitudinalDistanceAction); + + typedObject->SetLongitudinalDistanceAction(longitudinalDistanceAction); + + + } + + int LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::GetMinOccur() + { + return 1; + } + + int LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::GetMaxOccur() + { + return 1; + } + + bool LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION ; + } + + std::vector LongitudinalActionXmlParser::SubElementLongitudinalDistanceActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LONGITUDINAL_DISTANCE_ACTION + }; + } + LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::SubElementSpeedProfileActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _speedProfileActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedProfileAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedProfileAction->SetParent(object); + _speedProfileActionXmlParser->ParseElement(indexedElement, parserContext, speedProfileAction); + + typedObject->SetSpeedProfileAction(speedProfileAction); + + + } + + int LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::GetMinOccur() + { + return 1; + } + + int LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::GetMaxOccur() + { + return 1; + } + + bool LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION ; + } + + std::vector LongitudinalActionXmlParser::SubElementSpeedProfileActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ACTION + }; + } + + LongitudinalActionXmlParser::LongitudinalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LongitudinalDistanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + LongitudinalDistanceActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> LongitudinalDistanceActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeContinuous: public IAttributeParser, public XmlParserBase + { + public: + AttributeContinuous(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetContinuous(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDisplacement: public IAttributeParser, public XmlParserBase + { + public: + AttributeDisplacement(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = LongitudinalDisplacement::GetFromLiteral(attributeValue); + if (kResult != LongitudinalDisplacement::UNKNOWN) + { + typedObject->SetDisplacement(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (LongitudinalDisplacement::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + LongitudinalDisplacement::GetDeprecatedVersion(kResult) +"'. " + LongitudinalDisplacement::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISPLACEMENT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDistance: public IAttributeParser, public XmlParserBase + { + public: + AttributeDistance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDistance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTimeGap: public IAttributeParser, public XmlParserBase + { + public: + AttributeTimeGap(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTimeGap(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME_GAP, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> LongitudinalDistanceActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _dynamicConstraintsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto dynamicConstraints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + dynamicConstraints->SetParent(object); + _dynamicConstraintsXmlParser->ParseElement(indexedElement, parserContext, dynamicConstraints); + + typedObject->SetDynamicConstraints(dynamicConstraints); + + + } + + int LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetMinOccur() + { + return 0; + } + + int LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetMaxOccur() + { + return 1; + } + + bool LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS ; + } + + std::vector LongitudinalDistanceActionXmlParser::SubElementDynamicConstraintsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS + }; + } + + LongitudinalDistanceActionXmlParser::LongitudinalDistanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ManeuverXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ManeuverXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ManeuverXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ManeuverXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int ManeuverXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int ManeuverXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool ManeuverXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector ManeuverXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + ManeuverXmlParser::SubElementEventsParser::SubElementEventsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _eventXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverXmlParser::SubElementEventsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto events = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + events->SetParent(object); + _eventXmlParser->ParseElement(indexedElement, parserContext, events); + auto eventsList = typedObject->GetWriterEvents(); + eventsList.push_back(events); + typedObject->SetEvents(eventsList); + + + } + + int ManeuverXmlParser::SubElementEventsParser::GetMinOccur() + { + return 1; + } + + int ManeuverXmlParser::SubElementEventsParser::GetMaxOccur() + { + return -1; + } + + bool ManeuverXmlParser::SubElementEventsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__EVENT ; + } + + std::vector ManeuverXmlParser::SubElementEventsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__EVENT + }; + } + + ManeuverXmlParser::ManeuverXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ManeuverCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ManeuverCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ManeuverCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector ManeuverCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + ManeuverCatalogLocationXmlParser::ManeuverCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ManeuverGroupXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ManeuverGroupXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaximumExecutionCount: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaximumExecutionCount(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaximumExecutionCount(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAXIMUM_EXECUTION_COUNT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ManeuverGroupXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ManeuverGroupXmlParser::SubElementActorsParser::SubElementActorsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _actorsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverGroupXmlParser::SubElementActorsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto actors = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + actors->SetParent(object); + _actorsXmlParser->ParseElement(indexedElement, parserContext, actors); + + typedObject->SetActors(actors); + + + } + + int ManeuverGroupXmlParser::SubElementActorsParser::GetMinOccur() + { + return 1; + } + + int ManeuverGroupXmlParser::SubElementActorsParser::GetMaxOccur() + { + return 1; + } + + bool ManeuverGroupXmlParser::SubElementActorsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACTORS ; + } + + std::vector ManeuverGroupXmlParser::SubElementActorsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACTORS + }; + } + ManeuverGroupXmlParser::SubElementCatalogReferencesParser::SubElementCatalogReferencesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverGroupXmlParser::SubElementCatalogReferencesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReferences = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReferences->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReferences); + auto catalogReferencesList = typedObject->GetWriterCatalogReferences(); + catalogReferencesList.push_back(catalogReferences); + typedObject->SetCatalogReferences(catalogReferencesList); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReferences)); + + + } + + int ManeuverGroupXmlParser::SubElementCatalogReferencesParser::GetMinOccur() + { + return 0; + } + + int ManeuverGroupXmlParser::SubElementCatalogReferencesParser::GetMaxOccur() + { + return -1; + } + + bool ManeuverGroupXmlParser::SubElementCatalogReferencesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector ManeuverGroupXmlParser::SubElementCatalogReferencesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + ManeuverGroupXmlParser::SubElementManeuversParser::SubElementManeuversParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _maneuverXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ManeuverGroupXmlParser::SubElementManeuversParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto maneuvers = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + maneuvers->SetParent(object); + _maneuverXmlParser->ParseElement(indexedElement, parserContext, maneuvers); + auto maneuversList = typedObject->GetWriterManeuvers(); + maneuversList.push_back(maneuvers); + typedObject->SetManeuvers(maneuversList); + + + } + + int ManeuverGroupXmlParser::SubElementManeuversParser::GetMinOccur() + { + return 0; + } + + int ManeuverGroupXmlParser::SubElementManeuversParser::GetMaxOccur() + { + return -1; + } + + bool ManeuverGroupXmlParser::SubElementManeuversParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MANEUVER ; + } + + std::vector ManeuverGroupXmlParser::SubElementManeuversParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MANEUVER + }; + } + + ManeuverGroupXmlParser::ManeuverGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManualGearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ManualGearXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ManualGearXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeNumber: public IAttributeParser, public XmlParserBase + { + public: + AttributeNumber(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetNumber(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ManualGearXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ManualGearXmlParser::ManualGearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MiscObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + MiscObjectXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> MiscObjectXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMass: public IAttributeParser, public XmlParserBase + { + public: + AttributeMass(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMass(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMiscObjectCategory: public IAttributeParser, public XmlParserBase + { + public: + AttributeMiscObjectCategory(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = MiscObjectCategory::GetFromLiteral(attributeValue); + if (kResult != MiscObjectCategory::UNKNOWN) + { + typedObject->SetMiscObjectCategory(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (MiscObjectCategory::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + MiscObjectCategory::GetDeprecatedVersion(kResult) +"'. " + MiscObjectCategory::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MISC_OBJECT_CATEGORY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeModel3d: public IAttributeParser, public XmlParserBase + { + public: + AttributeModel3d(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetModel3d(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> MiscObjectXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + MiscObjectXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void MiscObjectXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int MiscObjectXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int MiscObjectXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool MiscObjectXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector MiscObjectXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + MiscObjectXmlParser::SubElementBoundingBoxParser::SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _boundingBoxXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void MiscObjectXmlParser::SubElementBoundingBoxParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto boundingBox = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + boundingBox->SetParent(object); + _boundingBoxXmlParser->ParseElement(indexedElement, parserContext, boundingBox); + + typedObject->SetBoundingBox(boundingBox); + + + } + + int MiscObjectXmlParser::SubElementBoundingBoxParser::GetMinOccur() + { + return 1; + } + + int MiscObjectXmlParser::SubElementBoundingBoxParser::GetMaxOccur() + { + return 1; + } + + bool MiscObjectXmlParser::SubElementBoundingBoxParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX ; + } + + std::vector MiscObjectXmlParser::SubElementBoundingBoxParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BOUNDING_BOX + }; + } + MiscObjectXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void MiscObjectXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int MiscObjectXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int MiscObjectXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool MiscObjectXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector MiscObjectXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + MiscObjectXmlParser::MiscObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MiscObjectCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + MiscObjectCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> MiscObjectCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> MiscObjectCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector MiscObjectCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + MiscObjectCatalogLocationXmlParser::MiscObjectCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ModifyRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ModifyRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ModifyRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ModifyRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ModifyRuleXmlParser::SubElementAddValueParser::SubElementAddValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterAddValueRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ModifyRuleXmlParser::SubElementAddValueParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto addValue = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + addValue->SetParent(object); + _parameterAddValueRuleXmlParser->ParseElement(indexedElement, parserContext, addValue); + + typedObject->SetAddValue(addValue); + + + } + + int ModifyRuleXmlParser::SubElementAddValueParser::GetMinOccur() + { + return 1; + } + + int ModifyRuleXmlParser::SubElementAddValueParser::GetMaxOccur() + { + return 1; + } + + bool ModifyRuleXmlParser::SubElementAddValueParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ADD_VALUE ; + } + + std::vector ModifyRuleXmlParser::SubElementAddValueParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ADD_VALUE + }; + } + ModifyRuleXmlParser::SubElementMultiplyByValueParser::SubElementMultiplyByValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterMultiplyByValueRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ModifyRuleXmlParser::SubElementMultiplyByValueParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto multiplyByValue = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + multiplyByValue->SetParent(object); + _parameterMultiplyByValueRuleXmlParser->ParseElement(indexedElement, parserContext, multiplyByValue); + + typedObject->SetMultiplyByValue(multiplyByValue); + + + } + + int ModifyRuleXmlParser::SubElementMultiplyByValueParser::GetMinOccur() + { + return 1; + } + + int ModifyRuleXmlParser::SubElementMultiplyByValueParser::GetMaxOccur() + { + return 1; + } + + bool ModifyRuleXmlParser::SubElementMultiplyByValueParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE ; + } + + std::vector ModifyRuleXmlParser::SubElementMultiplyByValueParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE + }; + } + + ModifyRuleXmlParser::ModifyRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MonitorDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + MonitorDeclarationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> MonitorDeclarationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> MonitorDeclarationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + MonitorDeclarationXmlParser::MonitorDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NoneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + NoneXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> NoneXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> NoneXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + NoneXmlParser::NoneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NormalDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + NormalDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> NormalDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeExpectedValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeExpectedValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetExpectedValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVariance: public IAttributeParser, public XmlParserBase + { + public: + AttributeVariance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVariance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VARIANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> NormalDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + NormalDistributionXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void NormalDistributionXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int NormalDistributionXmlParser::SubElementRangeParser::GetMinOccur() + { + return 0; + } + + int NormalDistributionXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool NormalDistributionXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector NormalDistributionXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + NormalDistributionXmlParser::NormalDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NurbsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + NurbsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> NurbsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeOrder: public IAttributeParser, public XmlParserBase + { + public: + AttributeOrder(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ORDER, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ORDER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOrder(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ORDER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ORDER, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ORDER, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> NurbsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + NurbsXmlParser::SubElementControlPointsParser::SubElementControlPointsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controlPointXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void NurbsXmlParser::SubElementControlPointsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controlPoints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controlPoints->SetParent(object); + _controlPointXmlParser->ParseElement(indexedElement, parserContext, controlPoints); + auto controlPointsList = typedObject->GetWriterControlPoints(); + controlPointsList.push_back(controlPoints); + typedObject->SetControlPoints(controlPointsList); + + + } + + int NurbsXmlParser::SubElementControlPointsParser::GetMinOccur() + { + return 2; + } + + int NurbsXmlParser::SubElementControlPointsParser::GetMaxOccur() + { + return -1; + } + + bool NurbsXmlParser::SubElementControlPointsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROL_POINT ; + } + + std::vector NurbsXmlParser::SubElementControlPointsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROL_POINT + }; + } + NurbsXmlParser::SubElementKnotsParser::SubElementKnotsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _knotXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void NurbsXmlParser::SubElementKnotsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto knots = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + knots->SetParent(object); + _knotXmlParser->ParseElement(indexedElement, parserContext, knots); + auto knotsList = typedObject->GetWriterKnots(); + knotsList.push_back(knots); + typedObject->SetKnots(knotsList); + + + } + + int NurbsXmlParser::SubElementKnotsParser::GetMinOccur() + { + return 2; + } + + int NurbsXmlParser::SubElementKnotsParser::GetMaxOccur() + { + return -1; + } + + bool NurbsXmlParser::SubElementKnotsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__KNOT ; + } + + std::vector NurbsXmlParser::SubElementKnotsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__KNOT + }; + } + + NurbsXmlParser::NurbsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ObjectControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ObjectControllerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ObjectControllerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ObjectControllerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ObjectControllerXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ObjectControllerXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int ObjectControllerXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int ObjectControllerXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool ObjectControllerXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector ObjectControllerXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + ObjectControllerXmlParser::SubElementControllerParser::SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ObjectControllerXmlParser::SubElementControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controller = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controller->SetParent(object); + _controllerXmlParser->ParseElement(indexedElement, parserContext, controller); + + typedObject->SetController(controller); + + + } + + int ObjectControllerXmlParser::SubElementControllerParser::GetMinOccur() + { + return 1; + } + + int ObjectControllerXmlParser::SubElementControllerParser::GetMaxOccur() + { + return 1; + } + + bool ObjectControllerXmlParser::SubElementControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER ; + } + + std::vector ObjectControllerXmlParser::SubElementControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER + }; + } + + ObjectControllerXmlParser::ObjectControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OffroadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OffroadConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OffroadConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OffroadConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + OffroadConditionXmlParser::OffroadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OpenScenarioImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OpenScenarioXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OpenScenarioXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> OpenScenarioXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OpenScenarioXmlParser::SubElementFileHeaderParser::SubElementFileHeaderParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileHeaderXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OpenScenarioXmlParser::SubElementFileHeaderParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto fileHeader = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + fileHeader->SetParent(object); + _fileHeaderXmlParser->ParseElement(indexedElement, parserContext, fileHeader); + + typedObject->SetFileHeader(fileHeader); + + + } + + int OpenScenarioXmlParser::SubElementFileHeaderParser::GetMinOccur() + { + return 1; + } + + int OpenScenarioXmlParser::SubElementFileHeaderParser::GetMaxOccur() + { + return 1; + } + + bool OpenScenarioXmlParser::SubElementFileHeaderParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FILE_HEADER ; + } + + std::vector OpenScenarioXmlParser::SubElementFileHeaderParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FILE_HEADER + }; + } + OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::SubElementOpenScenarioCategoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _openScenarioCategoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto openScenarioCategory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + openScenarioCategory->SetParent(object); + _openScenarioCategoryXmlParser->ParseElement(indexedElement, parserContext, openScenarioCategory); + + typedObject->SetOpenScenarioCategory(openScenarioCategory); + + + } + + int OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::GetMinOccur() + { + return 1; + } + + int OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::GetMaxOccur() + { + return 1; + } + + bool OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS || + elementName == OSC_CONSTANTS::ELEMENT__CATALOG || + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION ; + } + + std::vector OpenScenarioXmlParser::SubElementOpenScenarioCategoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS, + OSC_CONSTANTS::ELEMENT__CATALOG, + OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION + }; + } + + OpenScenarioXmlParser::OpenScenarioXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OpenScenarioCategoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OpenScenarioCategoryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> OpenScenarioCategoryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::SubElementScenarioDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _scenarioDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto scenarioDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + scenarioDefinition->SetParent(object); + _scenarioDefinitionXmlParser->ParseElement(indexedElement, parserContext, scenarioDefinition); + + typedObject->SetScenarioDefinition(scenarioDefinition); + + + } + + int OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::GetMinOccur() + { + return 1; + } + + int OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS || + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS ; + } + + std::vector OpenScenarioCategoryXmlParser::SubElementScenarioDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS, + OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS + }; + } + OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::SubElementCatalogDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogDefinition->SetParent(object); + _catalogDefinitionXmlParser->ParseElement(indexedElement, parserContext, catalogDefinition); + + typedObject->SetCatalogDefinition(catalogDefinition); + + + } + + int OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::GetMinOccur() + { + return 1; + } + + int OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG ; + } + + std::vector OpenScenarioCategoryXmlParser::SubElementCatalogDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG + }; + } + OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::SubElementParameterValueDistributionDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterValueDistributionDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterValueDistributionDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterValueDistributionDefinition->SetParent(object); + _parameterValueDistributionDefinitionXmlParser->ParseElement(indexedElement, parserContext, parameterValueDistributionDefinition); + + typedObject->SetParameterValueDistributionDefinition(parameterValueDistributionDefinition); + + + } + + int OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::GetMinOccur() + { + return 1; + } + + int OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION ; + } + + std::vector OpenScenarioCategoryXmlParser::SubElementParameterValueDistributionDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION + }; + } + + OpenScenarioCategoryXmlParser::OpenScenarioCategoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OrientationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OrientationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OrientationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeH: public IAttributeParser, public XmlParserBase + { + public: + AttributeH(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetH(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeP: public IAttributeParser, public XmlParserBase + { + public: + AttributeP(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetP(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeR: public IAttributeParser, public XmlParserBase + { + public: + AttributeR(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetR(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeType: public IAttributeParser, public XmlParserBase + { + public: + AttributeType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ReferenceContext::GetFromLiteral(attributeValue); + if (kResult != ReferenceContext::UNKNOWN) + { + typedObject->SetType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ReferenceContext::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ReferenceContext::GetDeprecatedVersion(kResult) +"'. " + ReferenceContext::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OrientationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + OrientationXmlParser::OrientationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideBrakeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideBrakeActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideBrakeActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use brakeInput instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideBrakeActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OverrideBrakeActionXmlParser::SubElementBrakeInputParser::SubElementBrakeInputParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _brakeInputXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideBrakeActionXmlParser::SubElementBrakeInputParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto brakeInput = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + brakeInput->SetParent(object); + _brakeInputXmlParser->ParseElement(indexedElement, parserContext, brakeInput); + + typedObject->SetBrakeInput(brakeInput); + + + } + + int OverrideBrakeActionXmlParser::SubElementBrakeInputParser::GetMinOccur() + { + return 0; + } + + int OverrideBrakeActionXmlParser::SubElementBrakeInputParser::GetMaxOccur() + { + return 1; + } + + bool OverrideBrakeActionXmlParser::SubElementBrakeInputParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT || + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_FORCE ; + } + + std::vector OverrideBrakeActionXmlParser::SubElementBrakeInputParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT, + OSC_CONSTANTS::ELEMENT__BRAKE_FORCE + }; + } + + OverrideBrakeActionXmlParser::OverrideBrakeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideClutchActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideClutchActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideClutchActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideClutchActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + OverrideClutchActionXmlParser::OverrideClutchActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideControllerValueActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideControllerValueActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> OverrideControllerValueActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> OverrideControllerValueActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OverrideControllerValueActionXmlParser::SubElementThrottleParser::SubElementThrottleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideThrottleActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementThrottleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto throttle = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + throttle->SetParent(object); + _overrideThrottleActionXmlParser->ParseElement(indexedElement, parserContext, throttle); + + typedObject->SetThrottle(throttle); + + + } + + int OverrideControllerValueActionXmlParser::SubElementThrottleParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementThrottleParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementThrottleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__THROTTLE ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementThrottleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__THROTTLE + }; + } + OverrideControllerValueActionXmlParser::SubElementBrakeParser::SubElementBrakeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideBrakeActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementBrakeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto brake = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + brake->SetParent(object); + _overrideBrakeActionXmlParser->ParseElement(indexedElement, parserContext, brake); + + typedObject->SetBrake(brake); + + + } + + int OverrideControllerValueActionXmlParser::SubElementBrakeParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementBrakeParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementBrakeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BRAKE ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementBrakeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BRAKE + }; + } + OverrideControllerValueActionXmlParser::SubElementClutchParser::SubElementClutchParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideClutchActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementClutchParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto clutch = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + clutch->SetParent(object); + _overrideClutchActionXmlParser->ParseElement(indexedElement, parserContext, clutch); + + typedObject->SetClutch(clutch); + + + } + + int OverrideControllerValueActionXmlParser::SubElementClutchParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementClutchParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementClutchParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CLUTCH ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementClutchParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CLUTCH + }; + } + OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::SubElementParkingBrakeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideParkingBrakeActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parkingBrake = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parkingBrake->SetParent(object); + _overrideParkingBrakeActionXmlParser->ParseElement(indexedElement, parserContext, parkingBrake); + + typedObject->SetParkingBrake(parkingBrake); + + + } + + int OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARKING_BRAKE ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementParkingBrakeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARKING_BRAKE + }; + } + OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::SubElementSteeringWheelParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideSteeringWheelActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto steeringWheel = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + steeringWheel->SetParent(object); + _overrideSteeringWheelActionXmlParser->ParseElement(indexedElement, parserContext, steeringWheel); + + typedObject->SetSteeringWheel(steeringWheel); + + + } + + int OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STEERING_WHEEL ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementSteeringWheelParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STEERING_WHEEL + }; + } + OverrideControllerValueActionXmlParser::SubElementGearParser::SubElementGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _overrideGearActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideControllerValueActionXmlParser::SubElementGearParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto gear = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + gear->SetParent(object); + _overrideGearActionXmlParser->ParseElement(indexedElement, parserContext, gear); + + typedObject->SetGear(gear); + + + } + + int OverrideControllerValueActionXmlParser::SubElementGearParser::GetMinOccur() + { + return 0; + } + + int OverrideControllerValueActionXmlParser::SubElementGearParser::GetMaxOccur() + { + return 1; + } + + bool OverrideControllerValueActionXmlParser::SubElementGearParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__GEAR ; + } + + std::vector OverrideControllerValueActionXmlParser::SubElementGearParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__GEAR + }; + } + + OverrideControllerValueActionXmlParser::OverrideControllerValueActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideGearActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideGearActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideGearActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeNumber: public IAttributeParser, public XmlParserBase + { + public: + AttributeNumber(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetNumber(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use automatic gear or manual gear.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NUMBER, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideGearActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OverrideGearActionXmlParser::SubElementGearParser::SubElementGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _gearXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideGearActionXmlParser::SubElementGearParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto gear = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + gear->SetParent(object); + _gearXmlParser->ParseElement(indexedElement, parserContext, gear); + + typedObject->SetGear(gear); + + + } + + int OverrideGearActionXmlParser::SubElementGearParser::GetMinOccur() + { + return 0; + } + + int OverrideGearActionXmlParser::SubElementGearParser::GetMaxOccur() + { + return 1; + } + + bool OverrideGearActionXmlParser::SubElementGearParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__GEAR ; + } + + std::vector OverrideGearActionXmlParser::SubElementGearParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__GEAR + }; + } + + OverrideGearActionXmlParser::OverrideGearActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideParkingBrakeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideParkingBrakeActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideParkingBrakeActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use brakeInput instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideParkingBrakeActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::SubElementBrakeInputParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _brakeInputXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto brakeInput = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + brakeInput->SetParent(object); + _brakeInputXmlParser->ParseElement(indexedElement, parserContext, brakeInput); + + typedObject->SetBrakeInput(brakeInput); + + + } + + int OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::GetMinOccur() + { + return 0; + } + + int OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::GetMaxOccur() + { + return 1; + } + + bool OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT || + elementName == OSC_CONSTANTS::ELEMENT__BRAKE_FORCE ; + } + + std::vector OverrideParkingBrakeActionXmlParser::SubElementBrakeInputParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BRAKE_PERCENT, + OSC_CONSTANTS::ELEMENT__BRAKE_FORCE + }; + } + + OverrideParkingBrakeActionXmlParser::OverrideParkingBrakeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideSteeringWheelActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideSteeringWheelActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideSteeringWheelActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxTorque: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxTorque(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxTorque(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_TORQUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideSteeringWheelActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + OverrideSteeringWheelActionXmlParser::OverrideSteeringWheelActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideThrottleActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + OverrideThrottleActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> OverrideThrottleActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeActive: public IAttributeParser, public XmlParserBase + { + public: + AttributeActive(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetActive(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ACTIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> OverrideThrottleActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + OverrideThrottleActionXmlParser::OverrideThrottleActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ParameterActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeParameterRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetParameterRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterActionXmlParser::SubElementSetActionParser::SubElementSetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterSetActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterActionXmlParser::SubElementSetActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto setAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + setAction->SetParent(object); + _parameterSetActionXmlParser->ParseElement(indexedElement, parserContext, setAction); + + typedObject->SetSetAction(setAction); + + + if (!_parameterSetActionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.2'. Comment: 'Use VariableActions instead of ParameterActions'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _parameterSetActionXmlParser->_filename)); + _parameterSetActionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int ParameterActionXmlParser::SubElementSetActionParser::GetMinOccur() + { + return 1; + } + + int ParameterActionXmlParser::SubElementSetActionParser::GetMaxOccur() + { + return 1; + } + + bool ParameterActionXmlParser::SubElementSetActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SET_ACTION ; + } + + std::vector ParameterActionXmlParser::SubElementSetActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SET_ACTION + }; + } + ParameterActionXmlParser::SubElementModifyActionParser::SubElementModifyActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterModifyActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterActionXmlParser::SubElementModifyActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto modifyAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + modifyAction->SetParent(object); + _parameterModifyActionXmlParser->ParseElement(indexedElement, parserContext, modifyAction); + + typedObject->SetModifyAction(modifyAction); + + + if (!_parameterModifyActionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.2'. Comment: 'Use VariableActions instead of ParameterActions'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _parameterModifyActionXmlParser->_filename)); + _parameterModifyActionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int ParameterActionXmlParser::SubElementModifyActionParser::GetMinOccur() + { + return 1; + } + + int ParameterActionXmlParser::SubElementModifyActionParser::GetMaxOccur() + { + return 1; + } + + bool ParameterActionXmlParser::SubElementModifyActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MODIFY_ACTION ; + } + + std::vector ParameterActionXmlParser::SubElementModifyActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MODIFY_ACTION + }; + } + + ParameterActionXmlParser::ParameterActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterAddValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterAddValueRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterAddValueRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterAddValueRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ParameterAddValueRuleXmlParser::ParameterAddValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterAssignmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterAssignmentXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterAssignmentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeParameterRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + // This is a special case for ParameterDeclaration.name or ParamterAssignment.parameterRef + // Proxy + auto proxy = std::make_shared>(StripDollarSign(attributeValue)); + proxy->SetParent(typedObject); + typedObject->SetParameterRef(proxy); + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterAssignmentXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ParameterAssignmentXmlParser::ParameterAssignmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeParameterRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetParameterRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ParameterConditionXmlParser::ParameterConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterDeclarationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterDeclarationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + // This is a special case for ParameterDeclaration.name or ParamterAssignment.parameterRef + // Simple type + typedObject->SetName(ParseString(StripDollarSign(attributeValue), startMarker)); + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeParameterType: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ParameterType::GetFromLiteral(attributeValue); + if (kResult != ParameterType::UNKNOWN) + { + typedObject->SetParameterType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ParameterType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ParameterType::GetDeprecatedVersion(kResult) +"'. " + ParameterType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterDeclarationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::SubElementConstraintGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _valueConstraintGroupXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto constraintGroups = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + constraintGroups->SetParent(object); + _valueConstraintGroupXmlParser->ParseElement(indexedElement, parserContext, constraintGroups); + auto constraintGroupsList = typedObject->GetWriterConstraintGroups(); + constraintGroupsList.push_back(constraintGroups); + typedObject->SetConstraintGroups(constraintGroupsList); + + + } + + int ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::GetMinOccur() + { + return 0; + } + + int ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::GetMaxOccur() + { + return -1; + } + + bool ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONSTRAINT_GROUP ; + } + + std::vector ParameterDeclarationXmlParser::SubElementConstraintGroupsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONSTRAINT_GROUP + }; + } + + ParameterDeclarationXmlParser::ParameterDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterModifyActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterModifyActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ParameterModifyActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ParameterModifyActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterModifyActionXmlParser::SubElementRuleParser::SubElementRuleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _modifyRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterModifyActionXmlParser::SubElementRuleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto rule = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + rule->SetParent(object); + _modifyRuleXmlParser->ParseElement(indexedElement, parserContext, rule); + + typedObject->SetRule(rule); + + + } + + int ParameterModifyActionXmlParser::SubElementRuleParser::GetMinOccur() + { + return 1; + } + + int ParameterModifyActionXmlParser::SubElementRuleParser::GetMaxOccur() + { + return 1; + } + + bool ParameterModifyActionXmlParser::SubElementRuleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RULE ; + } + + std::vector ParameterModifyActionXmlParser::SubElementRuleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RULE + }; + } + + ParameterModifyActionXmlParser::ParameterModifyActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterMultiplyByValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterMultiplyByValueRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterMultiplyByValueRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterMultiplyByValueRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ParameterMultiplyByValueRuleXmlParser::ParameterMultiplyByValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterSetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterSetActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterSetActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ParameterSetActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ParameterSetActionXmlParser::ParameterSetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers3V1_3.cpp b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers3V1_3.cpp new file mode 100644 index 00000000..732f3dce --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers3V1_3.cpp @@ -0,0 +1,11598 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlParsersV1_3.h" +#include "NamedReferenceProxy.h" +#include "FileContentMessage.h" +#include "Position.h" +#include "Textmarker.h" +#include "ErrorLevel.h" +#include "WrappedListParser.h" +#include "CatalogReferenceParserContextV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterValueDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterValueDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ParameterValueDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterValueDistributionXmlParser::SubElementScenarioFileParser::SubElementScenarioFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterValueDistributionXmlParser::SubElementScenarioFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto scenarioFile = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + scenarioFile->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, scenarioFile); + + typedObject->SetScenarioFile(scenarioFile); + + + } + + int ParameterValueDistributionXmlParser::SubElementScenarioFileParser::GetMinOccur() + { + return 1; + } + + int ParameterValueDistributionXmlParser::SubElementScenarioFileParser::GetMaxOccur() + { + return 1; + } + + bool ParameterValueDistributionXmlParser::SubElementScenarioFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SCENARIO_FILE ; + } + + std::vector ParameterValueDistributionXmlParser::SubElementScenarioFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SCENARIO_FILE + }; + } + ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::SubElementDistributionDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _distributionDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto distributionDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + distributionDefinition->SetParent(object); + _distributionDefinitionXmlParser->ParseElement(indexedElement, parserContext, distributionDefinition); + + typedObject->SetDistributionDefinition(distributionDefinition); + + + } + + int ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::GetMinOccur() + { + return 1; + } + + int ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DETERMINISTIC || + elementName == OSC_CONSTANTS::ELEMENT__STOCHASTIC ; + } + + std::vector ParameterValueDistributionXmlParser::SubElementDistributionDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DETERMINISTIC, + OSC_CONSTANTS::ELEMENT__STOCHASTIC + }; + } + + ParameterValueDistributionXmlParser::ParameterValueDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueDistributionDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterValueDistributionDefinitionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + + std::vector> ParameterValueDistributionDefinitionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::SubElementParameterValueDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterValueDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterValueDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterValueDistribution->SetParent(object); + _parameterValueDistributionXmlParser->ParseElement(indexedElement, parserContext, parameterValueDistribution); + + typedObject->SetParameterValueDistribution(parameterValueDistribution); + + + } + + int ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::GetMinOccur() + { + return 1; + } + + int ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::GetMaxOccur() + { + return 1; + } + + bool ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION ; + } + + std::vector ParameterValueDistributionDefinitionXmlParser::SubElementParameterValueDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_DISTRIBUTION + }; + } + + ParameterValueDistributionDefinitionXmlParser::ParameterValueDistributionDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ParameterValueSetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ParameterValueSetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ParameterValueSetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::SubElementParameterAssignmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterAssignmentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterAssignments = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterAssignments->SetParent(object); + _parameterAssignmentXmlParser->ParseElement(indexedElement, parserContext, parameterAssignments); + auto parameterAssignmentsList = typedObject->GetWriterParameterAssignments(); + parameterAssignmentsList.push_back(parameterAssignments); + typedObject->SetParameterAssignments(parameterAssignmentsList); + + + } + + int ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::GetMinOccur() + { + return 1; + } + + int ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::GetMaxOccur() + { + return -1; + } + + bool ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT ; + } + + std::vector ParameterValueSetXmlParser::SubElementParameterAssignmentsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_ASSIGNMENT + }; + } + + ParameterValueSetXmlParser::ParameterValueSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PedestrianXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> PedestrianXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMass: public IAttributeParser, public XmlParserBase + { + public: + AttributeMass(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMass(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeModel: public IAttributeParser, public XmlParserBase + { + public: + AttributeModel(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetModel(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version 'n/a'. Comment: 'n/a'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MODEL, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeModel3d: public IAttributeParser, public XmlParserBase + { + public: + AttributeModel3d(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetModel3d(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePedestrianCategory: public IAttributeParser, public XmlParserBase + { + public: + AttributePedestrianCategory(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = PedestrianCategory::GetFromLiteral(attributeValue); + if (kResult != PedestrianCategory::UNKNOWN) + { + typedObject->SetPedestrianCategory(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (PedestrianCategory::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + PedestrianCategory::GetDeprecatedVersion(kResult) +"'. " + PedestrianCategory::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PEDESTRIAN_CATEGORY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRole: public IAttributeParser, public XmlParserBase + { + public: + AttributeRole(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Role::GetFromLiteral(attributeValue); + if (kResult != Role::UNKNOWN) + { + typedObject->SetRole(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Role::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Role::GetDeprecatedVersion(kResult) +"'. " + Role::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PedestrianXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PedestrianXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PedestrianXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int PedestrianXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int PedestrianXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool PedestrianXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector PedestrianXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + PedestrianXmlParser::SubElementBoundingBoxParser::SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _boundingBoxXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PedestrianXmlParser::SubElementBoundingBoxParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto boundingBox = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + boundingBox->SetParent(object); + _boundingBoxXmlParser->ParseElement(indexedElement, parserContext, boundingBox); + + typedObject->SetBoundingBox(boundingBox); + + + } + + int PedestrianXmlParser::SubElementBoundingBoxParser::GetMinOccur() + { + return 1; + } + + int PedestrianXmlParser::SubElementBoundingBoxParser::GetMaxOccur() + { + return 1; + } + + bool PedestrianXmlParser::SubElementBoundingBoxParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX ; + } + + std::vector PedestrianXmlParser::SubElementBoundingBoxParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BOUNDING_BOX + }; + } + PedestrianXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PedestrianXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int PedestrianXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int PedestrianXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool PedestrianXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector PedestrianXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + PedestrianXmlParser::PedestrianXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PedestrianAnimationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PedestrianAnimationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMotion: public IAttributeParser, public XmlParserBase + { + public: + AttributeMotion(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MOTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = PedestrianMotionType::GetFromLiteral(attributeValue); + if (kResult != PedestrianMotionType::UNKNOWN) + { + typedObject->SetMotion(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (PedestrianMotionType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + PedestrianMotionType::GetDeprecatedVersion(kResult) +"'. " + PedestrianMotionType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MOTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MOTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MOTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeUserDefinedPedestrianAnimation: public IAttributeParser, public XmlParserBase + { + public: + AttributeUserDefinedPedestrianAnimation(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetUserDefinedPedestrianAnimation(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_PEDESTRIAN_ANIMATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PedestrianAnimationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PedestrianAnimationXmlParser::SubElementGesturesParser::SubElementGesturesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _pedestrianGestureXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PedestrianAnimationXmlParser::SubElementGesturesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto gestures = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + gestures->SetParent(object); + _pedestrianGestureXmlParser->ParseElement(indexedElement, parserContext, gestures); + auto gesturesList = typedObject->GetWriterGestures(); + gesturesList.push_back(gestures); + typedObject->SetGestures(gesturesList); + + + } + + int PedestrianAnimationXmlParser::SubElementGesturesParser::GetMinOccur() + { + return 0; + } + + int PedestrianAnimationXmlParser::SubElementGesturesParser::GetMaxOccur() + { + return -1; + } + + bool PedestrianAnimationXmlParser::SubElementGesturesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN_GESTURE ; + } + + std::vector PedestrianAnimationXmlParser::SubElementGesturesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PEDESTRIAN_GESTURE + }; + } + + PedestrianAnimationXmlParser::PedestrianAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PedestrianCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> PedestrianCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PedestrianCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector PedestrianCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + PedestrianCatalogLocationXmlParser::PedestrianCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianGestureImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PedestrianGestureXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PedestrianGestureXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeGesture: public IAttributeParser, public XmlParserBase + { + public: + AttributeGesture(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GESTURE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = PedestrianGestureType::GetFromLiteral(attributeValue); + if (kResult != PedestrianGestureType::UNKNOWN) + { + typedObject->SetGesture(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (PedestrianGestureType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + PedestrianGestureType::GetDeprecatedVersion(kResult) +"'. " + PedestrianGestureType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__GESTURE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__GESTURE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__GESTURE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PedestrianGestureXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PedestrianGestureXmlParser::PedestrianGestureXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PerformanceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PerformanceXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PerformanceXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMaxAcceleration: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxAcceleration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxAcceleration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxAccelerationRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxAccelerationRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxAccelerationRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_ACCELERATION_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxDeceleration: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxDeceleration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxDeceleration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxDecelerationRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxDecelerationRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxDecelerationRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_DECELERATION_RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeMaxSpeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeMaxSpeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMaxSpeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MAX_SPEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PerformanceXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PerformanceXmlParser::PerformanceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PhaseImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PhaseXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PhaseXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PhaseXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PhaseXmlParser::SubElementTrafficSignalStatesParser::SubElementTrafficSignalStatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PhaseXmlParser::SubElementTrafficSignalStatesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalStates = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalStates->SetParent(object); + _trafficSignalStateXmlParser->ParseElement(indexedElement, parserContext, trafficSignalStates); + auto trafficSignalStatesList = typedObject->GetWriterTrafficSignalStates(); + trafficSignalStatesList.push_back(trafficSignalStates); + typedObject->SetTrafficSignalStates(trafficSignalStatesList); + + + } + + int PhaseXmlParser::SubElementTrafficSignalStatesParser::GetMinOccur() + { + return 0; + } + + int PhaseXmlParser::SubElementTrafficSignalStatesParser::GetMaxOccur() + { + return -1; + } + + bool PhaseXmlParser::SubElementTrafficSignalStatesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE ; + } + + std::vector PhaseXmlParser::SubElementTrafficSignalStatesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE + }; + } + PhaseXmlParser::SubElementTrafficSignalGroupStateParser::SubElementTrafficSignalGroupStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalGroupStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PhaseXmlParser::SubElementTrafficSignalGroupStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalGroupState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalGroupState->SetParent(object); + _trafficSignalGroupStateXmlParser->ParseElement(indexedElement, parserContext, trafficSignalGroupState); + + typedObject->SetTrafficSignalGroupState(trafficSignalGroupState); + + + } + + int PhaseXmlParser::SubElementTrafficSignalGroupStateParser::GetMinOccur() + { + return 0; + } + + int PhaseXmlParser::SubElementTrafficSignalGroupStateParser::GetMaxOccur() + { + return 1; + } + + bool PhaseXmlParser::SubElementTrafficSignalGroupStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_GROUP_STATE ; + } + + std::vector PhaseXmlParser::SubElementTrafficSignalGroupStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_GROUP_STATE + }; + } + + PhaseXmlParser::PhaseXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PoissonDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PoissonDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PoissonDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeExpectedValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeExpectedValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetExpectedValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__EXPECTED_VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PoissonDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PoissonDistributionXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PoissonDistributionXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int PoissonDistributionXmlParser::SubElementRangeParser::GetMinOccur() + { + return 0; + } + + int PoissonDistributionXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool PoissonDistributionXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector PoissonDistributionXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + PoissonDistributionXmlParser::PoissonDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PolygonImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PolygonXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PolygonXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PolygonXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PolygonXmlParser::SubElementPositionsParser::SubElementPositionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PolygonXmlParser::SubElementPositionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto positions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + positions->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, positions); + auto positionsList = typedObject->GetWriterPositions(); + positionsList.push_back(positions); + typedObject->SetPositions(positionsList); + + + } + + int PolygonXmlParser::SubElementPositionsParser::GetMinOccur() + { + return 3; + } + + int PolygonXmlParser::SubElementPositionsParser::GetMaxOccur() + { + return -1; + } + + bool PolygonXmlParser::SubElementPositionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector PolygonXmlParser::SubElementPositionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + PolygonXmlParser::PolygonXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PolylineImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PolylineXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PolylineXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PolylineXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PolylineXmlParser::SubElementVerticesParser::SubElementVerticesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vertexXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PolylineXmlParser::SubElementVerticesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vertices = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vertices->SetParent(object); + _vertexXmlParser->ParseElement(indexedElement, parserContext, vertices); + auto verticesList = typedObject->GetWriterVertices(); + verticesList.push_back(vertices); + typedObject->SetVertices(verticesList); + + + } + + int PolylineXmlParser::SubElementVerticesParser::GetMinOccur() + { + return 2; + } + + int PolylineXmlParser::SubElementVerticesParser::GetMaxOccur() + { + return -1; + } + + bool PolylineXmlParser::SubElementVerticesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VERTEX ; + } + + std::vector PolylineXmlParser::SubElementVerticesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VERTEX + }; + } + + PolylineXmlParser::PolylineXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> PositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PositionXmlParser::SubElementWorldPositionParser::SubElementWorldPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _worldPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementWorldPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto worldPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + worldPosition->SetParent(object); + _worldPositionXmlParser->ParseElement(indexedElement, parserContext, worldPosition); + + typedObject->SetWorldPosition(worldPosition); + + + } + + int PositionXmlParser::SubElementWorldPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementWorldPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementWorldPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__WORLD_POSITION ; + } + + std::vector PositionXmlParser::SubElementWorldPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__WORLD_POSITION + }; + } + PositionXmlParser::SubElementRelativeWorldPositionParser::SubElementRelativeWorldPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeWorldPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRelativeWorldPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeWorldPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeWorldPosition->SetParent(object); + _relativeWorldPositionXmlParser->ParseElement(indexedElement, parserContext, relativeWorldPosition); + + typedObject->SetRelativeWorldPosition(relativeWorldPosition); + + + } + + int PositionXmlParser::SubElementRelativeWorldPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRelativeWorldPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRelativeWorldPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION ; + } + + std::vector PositionXmlParser::SubElementRelativeWorldPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_WORLD_POSITION + }; + } + PositionXmlParser::SubElementRelativeObjectPositionParser::SubElementRelativeObjectPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeObjectPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRelativeObjectPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeObjectPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeObjectPosition->SetParent(object); + _relativeObjectPositionXmlParser->ParseElement(indexedElement, parserContext, relativeObjectPosition); + + typedObject->SetRelativeObjectPosition(relativeObjectPosition); + + + } + + int PositionXmlParser::SubElementRelativeObjectPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRelativeObjectPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRelativeObjectPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION ; + } + + std::vector PositionXmlParser::SubElementRelativeObjectPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_OBJECT_POSITION + }; + } + PositionXmlParser::SubElementRoadPositionParser::SubElementRoadPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _roadPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRoadPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto roadPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + roadPosition->SetParent(object); + _roadPositionXmlParser->ParseElement(indexedElement, parserContext, roadPosition); + + typedObject->SetRoadPosition(roadPosition); + + + } + + int PositionXmlParser::SubElementRoadPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRoadPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRoadPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROAD_POSITION ; + } + + std::vector PositionXmlParser::SubElementRoadPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROAD_POSITION + }; + } + PositionXmlParser::SubElementRelativeRoadPositionParser::SubElementRelativeRoadPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeRoadPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRelativeRoadPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeRoadPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeRoadPosition->SetParent(object); + _relativeRoadPositionXmlParser->ParseElement(indexedElement, parserContext, relativeRoadPosition); + + typedObject->SetRelativeRoadPosition(relativeRoadPosition); + + + } + + int PositionXmlParser::SubElementRelativeRoadPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRelativeRoadPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRelativeRoadPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION ; + } + + std::vector PositionXmlParser::SubElementRelativeRoadPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_ROAD_POSITION + }; + } + PositionXmlParser::SubElementLanePositionParser::SubElementLanePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lanePositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementLanePositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lanePosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lanePosition->SetParent(object); + _lanePositionXmlParser->ParseElement(indexedElement, parserContext, lanePosition); + + typedObject->SetLanePosition(lanePosition); + + + } + + int PositionXmlParser::SubElementLanePositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementLanePositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementLanePositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE_POSITION ; + } + + std::vector PositionXmlParser::SubElementLanePositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE_POSITION + }; + } + PositionXmlParser::SubElementRelativeLanePositionParser::SubElementRelativeLanePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeLanePositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRelativeLanePositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeLanePosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeLanePosition->SetParent(object); + _relativeLanePositionXmlParser->ParseElement(indexedElement, parserContext, relativeLanePosition); + + typedObject->SetRelativeLanePosition(relativeLanePosition); + + + } + + int PositionXmlParser::SubElementRelativeLanePositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRelativeLanePositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRelativeLanePositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION ; + } + + std::vector PositionXmlParser::SubElementRelativeLanePositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_POSITION + }; + } + PositionXmlParser::SubElementRoutePositionParser::SubElementRoutePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routePositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementRoutePositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto routePosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + routePosition->SetParent(object); + _routePositionXmlParser->ParseElement(indexedElement, parserContext, routePosition); + + typedObject->SetRoutePosition(routePosition); + + + } + + int PositionXmlParser::SubElementRoutePositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementRoutePositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementRoutePositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE_POSITION ; + } + + std::vector PositionXmlParser::SubElementRoutePositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE_POSITION + }; + } + PositionXmlParser::SubElementGeoPositionParser::SubElementGeoPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _geoPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementGeoPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto geoPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + geoPosition->SetParent(object); + _geoPositionXmlParser->ParseElement(indexedElement, parserContext, geoPosition); + + typedObject->SetGeoPosition(geoPosition); + + + } + + int PositionXmlParser::SubElementGeoPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementGeoPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementGeoPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__GEO_POSITION ; + } + + std::vector PositionXmlParser::SubElementGeoPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__GEO_POSITION + }; + } + PositionXmlParser::SubElementTrajectoryPositionParser::SubElementTrajectoryPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryPositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PositionXmlParser::SubElementTrajectoryPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectoryPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectoryPosition->SetParent(object); + _trajectoryPositionXmlParser->ParseElement(indexedElement, parserContext, trajectoryPosition); + + typedObject->SetTrajectoryPosition(trajectoryPosition); + + + } + + int PositionXmlParser::SubElementTrajectoryPositionParser::GetMinOccur() + { + return 1; + } + + int PositionXmlParser::SubElementTrajectoryPositionParser::GetMaxOccur() + { + return 1; + } + + bool PositionXmlParser::SubElementTrajectoryPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION ; + } + + std::vector PositionXmlParser::SubElementTrajectoryPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY_POSITION + }; + } + + PositionXmlParser::PositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionInLaneCoordinatesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PositionInLaneCoordinatesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PositionInLaneCoordinatesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeLaneId: public IAttributeParser, public XmlParserBase + { + public: + AttributeLaneId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLaneId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LANE_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeLaneOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeLaneOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLaneOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LANE_OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePathS: public IAttributeParser, public XmlParserBase + { + public: + AttributePathS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPathS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PositionInLaneCoordinatesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PositionInLaneCoordinatesXmlParser::PositionInLaneCoordinatesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionInRoadCoordinatesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PositionInRoadCoordinatesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PositionInRoadCoordinatesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributePathS: public IAttributeParser, public XmlParserBase + { + public: + AttributePathS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PATH_S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPathS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PATH_S, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeT: public IAttributeParser, public XmlParserBase + { + public: + AttributeT(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetT(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PositionInRoadCoordinatesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PositionInRoadCoordinatesXmlParser::PositionInRoadCoordinatesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionOfCurrentEntityImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PositionOfCurrentEntityXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PositionOfCurrentEntityXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PositionOfCurrentEntityXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PositionOfCurrentEntityXmlParser::PositionOfCurrentEntityXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrecipitationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PrecipitationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PrecipitationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeIntensity: public IAttributeParser, public XmlParserBase + { + public: + AttributeIntensity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetIntensity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.1'. Comment: 'Use instead precipitationIntensity.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePrecipitationIntensity: public IAttributeParser, public XmlParserBase + { + public: + AttributePrecipitationIntensity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPrecipitationIntensity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_INTENSITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributePrecipitationType: public IAttributeParser, public XmlParserBase + { + public: + AttributePrecipitationType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = PrecipitationType::GetFromLiteral(attributeValue); + if (kResult != PrecipitationType::UNKNOWN) + { + typedObject->SetPrecipitationType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (PrecipitationType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + PrecipitationType::GetDeprecatedVersion(kResult) +"'. " + PrecipitationType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PRECIPITATION_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PrecipitationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PrecipitationXmlParser::PrecipitationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrivateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PrivateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PrivateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PrivateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PrivateXmlParser::SubElementPrivateActionsParser::SubElementPrivateActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _privateActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateXmlParser::SubElementPrivateActionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto privateActions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + privateActions->SetParent(object); + _privateActionXmlParser->ParseElement(indexedElement, parserContext, privateActions); + auto privateActionsList = typedObject->GetWriterPrivateActions(); + privateActionsList.push_back(privateActions); + typedObject->SetPrivateActions(privateActionsList); + + + } + + int PrivateXmlParser::SubElementPrivateActionsParser::GetMinOccur() + { + return 1; + } + + int PrivateXmlParser::SubElementPrivateActionsParser::GetMaxOccur() + { + return -1; + } + + bool PrivateXmlParser::SubElementPrivateActionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION ; + } + + std::vector PrivateXmlParser::SubElementPrivateActionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PRIVATE_ACTION + }; + } + + PrivateXmlParser::PrivateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrivateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PrivateActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> PrivateActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PrivateActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PrivateActionXmlParser::SubElementLongitudinalActionParser::SubElementLongitudinalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _longitudinalActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementLongitudinalActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto longitudinalAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + longitudinalAction->SetParent(object); + _longitudinalActionXmlParser->ParseElement(indexedElement, parserContext, longitudinalAction); + + typedObject->SetLongitudinalAction(longitudinalAction); + + + } + + int PrivateActionXmlParser::SubElementLongitudinalActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementLongitudinalActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementLongitudinalActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementLongitudinalActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LONGITUDINAL_ACTION + }; + } + PrivateActionXmlParser::SubElementLateralActionParser::SubElementLateralActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _lateralActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementLateralActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lateralAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lateralAction->SetParent(object); + _lateralActionXmlParser->ParseElement(indexedElement, parserContext, lateralAction); + + typedObject->SetLateralAction(lateralAction); + + + } + + int PrivateActionXmlParser::SubElementLateralActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementLateralActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementLateralActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LATERAL_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementLateralActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LATERAL_ACTION + }; + } + PrivateActionXmlParser::SubElementVisibilityActionParser::SubElementVisibilityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _visibilityActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementVisibilityActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto visibilityAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + visibilityAction->SetParent(object); + _visibilityActionXmlParser->ParseElement(indexedElement, parserContext, visibilityAction); + + typedObject->SetVisibilityAction(visibilityAction); + + + } + + int PrivateActionXmlParser::SubElementVisibilityActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementVisibilityActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementVisibilityActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementVisibilityActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VISIBILITY_ACTION + }; + } + PrivateActionXmlParser::SubElementSynchronizeActionParser::SubElementSynchronizeActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _synchronizeActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementSynchronizeActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto synchronizeAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + synchronizeAction->SetParent(object); + _synchronizeActionXmlParser->ParseElement(indexedElement, parserContext, synchronizeAction); + + typedObject->SetSynchronizeAction(synchronizeAction); + + + } + + int PrivateActionXmlParser::SubElementSynchronizeActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementSynchronizeActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementSynchronizeActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementSynchronizeActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SYNCHRONIZE_ACTION + }; + } + PrivateActionXmlParser::SubElementActivateControllerActionParser::SubElementActivateControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _activateControllerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementActivateControllerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto activateControllerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + activateControllerAction->SetParent(object); + _activateControllerActionXmlParser->ParseElement(indexedElement, parserContext, activateControllerAction); + + typedObject->SetActivateControllerAction(activateControllerAction); + + + if (!_activateControllerActionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.1'. Comment: 'Moved to ControllerAction'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _activateControllerActionXmlParser->_filename)); + _activateControllerActionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int PrivateActionXmlParser::SubElementActivateControllerActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementActivateControllerActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementActivateControllerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementActivateControllerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACTIVATE_CONTROLLER_ACTION + }; + } + PrivateActionXmlParser::SubElementControllerActionParser::SubElementControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementControllerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controllerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controllerAction->SetParent(object); + _controllerActionXmlParser->ParseElement(indexedElement, parserContext, controllerAction); + + typedObject->SetControllerAction(controllerAction); + + + } + + int PrivateActionXmlParser::SubElementControllerActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementControllerActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementControllerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementControllerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER_ACTION + }; + } + PrivateActionXmlParser::SubElementTeleportActionParser::SubElementTeleportActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _teleportActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementTeleportActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto teleportAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + teleportAction->SetParent(object); + _teleportActionXmlParser->ParseElement(indexedElement, parserContext, teleportAction); + + typedObject->SetTeleportAction(teleportAction); + + + } + + int PrivateActionXmlParser::SubElementTeleportActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementTeleportActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementTeleportActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementTeleportActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TELEPORT_ACTION + }; + } + PrivateActionXmlParser::SubElementRoutingActionParser::SubElementRoutingActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routingActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementRoutingActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto routingAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + routingAction->SetParent(object); + _routingActionXmlParser->ParseElement(indexedElement, parserContext, routingAction); + + typedObject->SetRoutingAction(routingAction); + + + } + + int PrivateActionXmlParser::SubElementRoutingActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementRoutingActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementRoutingActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTING_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementRoutingActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTING_ACTION + }; + } + PrivateActionXmlParser::SubElementAppearanceActionParser::SubElementAppearanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _appearanceActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementAppearanceActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto appearanceAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + appearanceAction->SetParent(object); + _appearanceActionXmlParser->ParseElement(indexedElement, parserContext, appearanceAction); + + typedObject->SetAppearanceAction(appearanceAction); + + + } + + int PrivateActionXmlParser::SubElementAppearanceActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementAppearanceActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementAppearanceActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementAppearanceActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__APPEARANCE_ACTION + }; + } + PrivateActionXmlParser::SubElementTrailerActionParser::SubElementTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trailerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PrivateActionXmlParser::SubElementTrailerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailerAction->SetParent(object); + _trailerActionXmlParser->ParseElement(indexedElement, parserContext, trailerAction); + + typedObject->SetTrailerAction(trailerAction); + + + } + + int PrivateActionXmlParser::SubElementTrailerActionParser::GetMinOccur() + { + return 1; + } + + int PrivateActionXmlParser::SubElementTrailerActionParser::GetMaxOccur() + { + return 1; + } + + bool PrivateActionXmlParser::SubElementTrailerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER_ACTION ; + } + + std::vector PrivateActionXmlParser::SubElementTrailerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER_ACTION + }; + } + + PrivateActionXmlParser::PrivateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ProbabilityDistributionSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ProbabilityDistributionSetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ProbabilityDistributionSetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ProbabilityDistributionSetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ProbabilityDistributionSetXmlParser::SubElementElementsParser::SubElementElementsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _probabilityDistributionSetElementXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ProbabilityDistributionSetXmlParser::SubElementElementsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto elements = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + elements->SetParent(object); + _probabilityDistributionSetElementXmlParser->ParseElement(indexedElement, parserContext, elements); + auto elementsList = typedObject->GetWriterElements(); + elementsList.push_back(elements); + typedObject->SetElements(elementsList); + + + } + + int ProbabilityDistributionSetXmlParser::SubElementElementsParser::GetMinOccur() + { + return 1; + } + + int ProbabilityDistributionSetXmlParser::SubElementElementsParser::GetMaxOccur() + { + return -1; + } + + bool ProbabilityDistributionSetXmlParser::SubElementElementsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ELEMENT ; + } + + std::vector ProbabilityDistributionSetXmlParser::SubElementElementsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ELEMENT + }; + } + + ProbabilityDistributionSetXmlParser::ProbabilityDistributionSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ProbabilityDistributionSetElementImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ProbabilityDistributionSetElementXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ProbabilityDistributionSetElementXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ProbabilityDistributionSetElementXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ProbabilityDistributionSetElementXmlParser::ProbabilityDistributionSetElementXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PropertiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PropertiesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PropertiesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> PropertiesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + PropertiesXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertyXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PropertiesXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertyXmlParser->ParseElement(indexedElement, parserContext, properties); + auto propertiesList = typedObject->GetWriterProperties(); + propertiesList.push_back(properties); + typedObject->SetProperties(propertiesList); + + + } + + int PropertiesXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int PropertiesXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return -1; + } + + bool PropertiesXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTY ; + } + + std::vector PropertiesXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTY + }; + } + PropertiesXmlParser::SubElementFilesParser::SubElementFilesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PropertiesXmlParser::SubElementFilesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto files = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + files->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, files); + auto filesList = typedObject->GetWriterFiles(); + filesList.push_back(files); + typedObject->SetFiles(filesList); + + + } + + int PropertiesXmlParser::SubElementFilesParser::GetMinOccur() + { + return 0; + } + + int PropertiesXmlParser::SubElementFilesParser::GetMaxOccur() + { + return -1; + } + + bool PropertiesXmlParser::SubElementFilesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FILE ; + } + + std::vector PropertiesXmlParser::SubElementFilesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FILE + }; + } + PropertiesXmlParser::SubElementCustomContentParser::SubElementCustomContentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _customContentXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void PropertiesXmlParser::SubElementCustomContentParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto customContent = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + customContent->SetParent(object); + _customContentXmlParser->ParseElement(indexedElement, parserContext, customContent); + auto customContentList = typedObject->GetWriterCustomContent(); + customContentList.push_back(customContent); + typedObject->SetCustomContent(customContentList); + + + } + + int PropertiesXmlParser::SubElementCustomContentParser::GetMinOccur() + { + return 0; + } + + int PropertiesXmlParser::SubElementCustomContentParser::GetMaxOccur() + { + return -1; + } + + bool PropertiesXmlParser::SubElementCustomContentParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CUSTOM_CONTENT ; + } + + std::vector PropertiesXmlParser::SubElementCustomContentParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CUSTOM_CONTENT + }; + } + + PropertiesXmlParser::PropertiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PropertyImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + PropertyXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> PropertyXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> PropertyXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + PropertyXmlParser::PropertyXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RandomRouteActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RandomRouteActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RandomRouteActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RandomRouteActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RandomRouteActionXmlParser::RandomRouteActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RangeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RangeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeLowerLimit: public IAttributeParser, public XmlParserBase + { + public: + AttributeLowerLimit(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLowerLimit(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LOWER_LIMIT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeUpperLimit: public IAttributeParser, public XmlParserBase + { + public: + AttributeUpperLimit(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetUpperLimit(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__UPPER_LIMIT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RangeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RangeXmlParser::RangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ReachPositionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ReachPositionConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ReachPositionConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTolerance: public IAttributeParser, public XmlParserBase + { + public: + AttributeTolerance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTolerance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TOLERANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ReachPositionConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ReachPositionConditionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ReachPositionConditionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int ReachPositionConditionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int ReachPositionConditionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool ReachPositionConditionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector ReachPositionConditionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + ReachPositionConditionXmlParser::ReachPositionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeAngleConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeAngleConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeAngleConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAngle: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngle(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAngle(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeAngleTolerance: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngleTolerance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAngleTolerance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TOLERANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeAngleType: public IAttributeParser, public XmlParserBase + { + public: + AttributeAngleType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = AngleType::GetFromLiteral(attributeValue); + if (kResult != AngleType::UNKNOWN) + { + typedObject->SetAngleType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (AngleType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + AngleType::GetDeprecatedVersion(kResult) +"'. " + AngleType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANGLE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeAngleConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeAngleConditionXmlParser::RelativeAngleConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeClearanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeClearanceConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeClearanceConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDistanceBackward: public IAttributeParser, public XmlParserBase + { + public: + AttributeDistanceBackward(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDistanceBackward(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_BACKWARD, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDistanceForward: public IAttributeParser, public XmlParserBase + { + public: + AttributeDistanceForward(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDistanceForward(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISTANCE_FORWARD, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreeSpace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreeSpace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreeSpace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREE_SPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeOppositeLanes: public IAttributeParser, public XmlParserBase + { + public: + AttributeOppositeLanes(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOppositeLanes(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OPPOSITE_LANES, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeClearanceConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::SubElementRelativeLaneRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeLaneRangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeLaneRange = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeLaneRange->SetParent(object); + _relativeLaneRangeXmlParser->ParseElement(indexedElement, parserContext, relativeLaneRange); + auto relativeLaneRangeList = typedObject->GetWriterRelativeLaneRange(); + relativeLaneRangeList.push_back(relativeLaneRange); + typedObject->SetRelativeLaneRange(relativeLaneRangeList); + + + } + + int RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::GetMinOccur() + { + return 0; + } + + int RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::GetMaxOccur() + { + return -1; + } + + bool RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_RANGE ; + } + + std::vector RelativeClearanceConditionXmlParser::SubElementRelativeLaneRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_LANE_RANGE + }; + } + RelativeClearanceConditionXmlParser::SubElementEntityRefParser::SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeClearanceConditionXmlParser::SubElementEntityRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRef->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRef); + auto entityRefList = typedObject->GetWriterEntityRef(); + entityRefList.push_back(entityRef); + typedObject->SetEntityRef(entityRefList); + + + } + + int RelativeClearanceConditionXmlParser::SubElementEntityRefParser::GetMinOccur() + { + return 0; + } + + int RelativeClearanceConditionXmlParser::SubElementEntityRefParser::GetMaxOccur() + { + return -1; + } + + bool RelativeClearanceConditionXmlParser::SubElementEntityRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector RelativeClearanceConditionXmlParser::SubElementEntityRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + + RelativeClearanceConditionXmlParser::RelativeClearanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeDistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeDistanceConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeDistanceConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRelativeDistanceType: public IAttributeParser, public XmlParserBase + { + public: + AttributeRelativeDistanceType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(attributeValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + typedObject->SetRelativeDistanceType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RelativeDistanceType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RelativeDistanceType::GetDeprecatedVersion(kResult) +"'. " + RelativeDistanceType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRoutingAlgorithm: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoutingAlgorithm(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(attributeValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + typedObject->SetRoutingAlgorithm(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RoutingAlgorithm::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RoutingAlgorithm::GetDeprecatedVersion(kResult) +"'. " + RoutingAlgorithm::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeDistanceConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeDistanceConditionXmlParser::RelativeDistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeLanePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeLanePositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RelativeLanePositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDLane: public IAttributeParser, public XmlParserBase + { + public: + AttributeDLane(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__D_LANE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__D_LANE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDLane(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__D_LANE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__D_LANE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__D_LANE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDs: public IAttributeParser, public XmlParserBase + { + public: + AttributeDs(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDs(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDsLane: public IAttributeParser, public XmlParserBase + { + public: + AttributeDsLane(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDsLane(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DS_LANE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeLanePositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeLanePositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeLanePositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RelativeLanePositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RelativeLanePositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RelativeLanePositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RelativeLanePositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + RelativeLanePositionXmlParser::RelativeLanePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeLaneRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeLaneRangeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeLaneRangeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeFrom: public IAttributeParser, public XmlParserBase + { + public: + AttributeFrom(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FROM, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FROM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFrom(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FROM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FROM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FROM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTo: public IAttributeParser, public XmlParserBase + { + public: + AttributeTo(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TO, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TO, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTo(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TO, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TO, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TO, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeLaneRangeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeLaneRangeXmlParser::RelativeLaneRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeObjectPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeObjectPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RelativeObjectPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDx: public IAttributeParser, public XmlParserBase + { + public: + AttributeDx(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDx(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDy: public IAttributeParser, public XmlParserBase + { + public: + AttributeDy(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDy(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDz: public IAttributeParser, public XmlParserBase + { + public: + AttributeDz(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDz(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeObjectPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeObjectPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeObjectPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RelativeObjectPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RelativeObjectPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RelativeObjectPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RelativeObjectPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + RelativeObjectPositionXmlParser::RelativeObjectPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeRoadPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeRoadPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RelativeRoadPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDs: public IAttributeParser, public XmlParserBase + { + public: + AttributeDs(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDs(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDt: public IAttributeParser, public XmlParserBase + { + public: + AttributeDt(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDt(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DT, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeRoadPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeRoadPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeRoadPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RelativeRoadPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RelativeRoadPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RelativeRoadPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RelativeRoadPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + RelativeRoadPositionXmlParser::RelativeRoadPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeSpeedConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeSpeedConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeSpeedConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDirection: public IAttributeParser, public XmlParserBase + { + public: + AttributeDirection(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(attributeValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + typedObject->SetDirection(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DirectionalDimension::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DirectionalDimension::GetDeprecatedVersion(kResult) +"'. " + DirectionalDimension::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeSpeedConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeSpeedConditionXmlParser::RelativeSpeedConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeSpeedToMasterImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeSpeedToMasterXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeSpeedToMasterXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeSpeedTargetValueType: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpeedTargetValueType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = SpeedTargetValueType::GetFromLiteral(attributeValue); + if (kResult != SpeedTargetValueType::UNKNOWN) + { + typedObject->SetSpeedTargetValueType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (SpeedTargetValueType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + SpeedTargetValueType::GetDeprecatedVersion(kResult) +"'. " + SpeedTargetValueType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeSpeedToMasterXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::SubElementSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _steadyStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto steadyState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + steadyState->SetParent(object); + _steadyStateXmlParser->ParseElement(indexedElement, parserContext, steadyState); + + typedObject->SetSteadyState(steadyState); + + + } + + int RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::GetMinOccur() + { + return 0; + } + + int RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::GetMaxOccur() + { + return 1; + } + + bool RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE || + elementName == OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE ; + } + + std::vector RelativeSpeedToMasterXmlParser::SubElementSteadyStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE, + OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE + }; + } + + RelativeSpeedToMasterXmlParser::RelativeSpeedToMasterXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetLaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeTargetLaneXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeTargetLaneXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype int + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeTargetLaneXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeTargetLaneXmlParser::RelativeTargetLaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetLaneOffsetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeTargetLaneOffsetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeTargetLaneOffsetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeTargetLaneOffsetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeTargetLaneOffsetXmlParser::RelativeTargetLaneOffsetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeTargetSpeedXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RelativeTargetSpeedXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeContinuous: public IAttributeParser, public XmlParserBase + { + public: + AttributeContinuous(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetContinuous(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSpeedTargetValueType: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpeedTargetValueType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = SpeedTargetValueType::GetFromLiteral(attributeValue); + if (kResult != SpeedTargetValueType::UNKNOWN) + { + typedObject->SetSpeedTargetValueType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (SpeedTargetValueType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + SpeedTargetValueType::GetDeprecatedVersion(kResult) +"'. " + SpeedTargetValueType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPEED_TARGET_VALUE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeTargetSpeedXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + RelativeTargetSpeedXmlParser::RelativeTargetSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeWorldPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RelativeWorldPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RelativeWorldPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDx: public IAttributeParser, public XmlParserBase + { + public: + AttributeDx(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDx(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDy: public IAttributeParser, public XmlParserBase + { + public: + AttributeDy(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDy(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDz: public IAttributeParser, public XmlParserBase + { + public: + AttributeDz(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDz(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RelativeWorldPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RelativeWorldPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RelativeWorldPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RelativeWorldPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RelativeWorldPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RelativeWorldPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RelativeWorldPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + RelativeWorldPositionXmlParser::RelativeWorldPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoadConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RoadConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeFrictionScaleFactor: public IAttributeParser, public XmlParserBase + { + public: + AttributeFrictionScaleFactor(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFrictionScaleFactor(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FRICTION_SCALE_FACTOR, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWetness: public IAttributeParser, public XmlParserBase + { + public: + AttributeWetness(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WETNESS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Wetness::GetFromLiteral(attributeValue); + if (kResult != Wetness::UNKNOWN) + { + typedObject->SetWetness(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Wetness::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Wetness::GetDeprecatedVersion(kResult) +"'. " + Wetness::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WETNESS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WETNESS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WETNESS, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RoadConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoadConditionXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadConditionXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int RoadConditionXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int RoadConditionXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool RoadConditionXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector RoadConditionXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + RoadConditionXmlParser::RoadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadCursorImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoadCursorXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RoadCursorXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRoadId: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoadId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRoadId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeS: public IAttributeParser, public XmlParserBase + { + public: + AttributeS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RoadCursorXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoadCursorXmlParser::SubElementLaneParser::SubElementLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _laneXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadCursorXmlParser::SubElementLaneParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto lane = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + lane->SetParent(object); + _laneXmlParser->ParseElement(indexedElement, parserContext, lane); + auto laneList = typedObject->GetWriterLane(); + laneList.push_back(lane); + typedObject->SetLane(laneList); + + + } + + int RoadCursorXmlParser::SubElementLaneParser::GetMinOccur() + { + return 0; + } + + int RoadCursorXmlParser::SubElementLaneParser::GetMaxOccur() + { + return -1; + } + + bool RoadCursorXmlParser::SubElementLaneParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LANE ; + } + + std::vector RoadCursorXmlParser::SubElementLaneParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LANE + }; + } + + RoadCursorXmlParser::RoadCursorXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadNetworkImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoadNetworkXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RoadNetworkXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RoadNetworkXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNALS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoadNetworkXmlParser::SubElementLogicFileParser::SubElementLogicFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadNetworkXmlParser::SubElementLogicFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto logicFile = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + logicFile->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, logicFile); + + typedObject->SetLogicFile(logicFile); + + + } + + int RoadNetworkXmlParser::SubElementLogicFileParser::GetMinOccur() + { + return 0; + } + + int RoadNetworkXmlParser::SubElementLogicFileParser::GetMaxOccur() + { + return 1; + } + + bool RoadNetworkXmlParser::SubElementLogicFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LOGIC_FILE ; + } + + std::vector RoadNetworkXmlParser::SubElementLogicFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LOGIC_FILE + }; + } + RoadNetworkXmlParser::SubElementSceneGraphFileParser::SubElementSceneGraphFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fileXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadNetworkXmlParser::SubElementSceneGraphFileParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto sceneGraphFile = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + sceneGraphFile->SetParent(object); + _fileXmlParser->ParseElement(indexedElement, parserContext, sceneGraphFile); + + typedObject->SetSceneGraphFile(sceneGraphFile); + + + } + + int RoadNetworkXmlParser::SubElementSceneGraphFileParser::GetMinOccur() + { + return 0; + } + + int RoadNetworkXmlParser::SubElementSceneGraphFileParser::GetMaxOccur() + { + return 1; + } + + bool RoadNetworkXmlParser::SubElementSceneGraphFileParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SCENE_GRAPH_FILE ; + } + + std::vector RoadNetworkXmlParser::SubElementSceneGraphFileParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SCENE_GRAPH_FILE + }; + } + RoadNetworkXmlParser::SubElementTrafficSignalsParser::SubElementTrafficSignalsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalControllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadNetworkXmlParser::SubElementTrafficSignalsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignals = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignals->SetParent(object); + _trafficSignalControllerXmlParser->ParseElement(indexedElement, parserContext, trafficSignals); + auto trafficSignalsList = typedObject->GetWriterTrafficSignals(); + trafficSignalsList.push_back(trafficSignals); + typedObject->SetTrafficSignals(trafficSignalsList); + + + } + + int RoadNetworkXmlParser::SubElementTrafficSignalsParser::GetMinOccur() + { + return 0; + } + + int RoadNetworkXmlParser::SubElementTrafficSignalsParser::GetMaxOccur() + { + return -1; + } + + bool RoadNetworkXmlParser::SubElementTrafficSignalsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER; + } + + std::vector RoadNetworkXmlParser::SubElementTrafficSignalsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER}; + } + RoadNetworkXmlParser::SubElementUsedAreaParser::SubElementUsedAreaParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _usedAreaXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadNetworkXmlParser::SubElementUsedAreaParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto usedArea = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + usedArea->SetParent(object); + _usedAreaXmlParser->ParseElement(indexedElement, parserContext, usedArea); + + typedObject->SetUsedArea(usedArea); + + + } + + int RoadNetworkXmlParser::SubElementUsedAreaParser::GetMinOccur() + { + return 0; + } + + int RoadNetworkXmlParser::SubElementUsedAreaParser::GetMaxOccur() + { + return 1; + } + + bool RoadNetworkXmlParser::SubElementUsedAreaParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USED_AREA ; + } + + std::vector RoadNetworkXmlParser::SubElementUsedAreaParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USED_AREA + }; + } + + RoadNetworkXmlParser::RoadNetworkXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoadPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RoadPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRoadId: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoadId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRoadId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROAD_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeS: public IAttributeParser, public XmlParserBase + { + public: + AttributeS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeT: public IAttributeParser, public XmlParserBase + { + public: + AttributeT(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetT(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RoadPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoadPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RoadPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RoadPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RoadPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RoadPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + + RoadPositionXmlParser::RoadPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoadRangeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RoadRangeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeLength: public IAttributeParser, public XmlParserBase + { + public: + AttributeLength(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__LENGTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetLength(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__LENGTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RoadRangeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoadRangeXmlParser::SubElementRoadCursorParser::SubElementRoadCursorParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _roadCursorXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoadRangeXmlParser::SubElementRoadCursorParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto roadCursor = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + roadCursor->SetParent(object); + _roadCursorXmlParser->ParseElement(indexedElement, parserContext, roadCursor); + auto roadCursorList = typedObject->GetWriterRoadCursor(); + roadCursorList.push_back(roadCursor); + typedObject->SetRoadCursor(roadCursorList); + + + } + + int RoadRangeXmlParser::SubElementRoadCursorParser::GetMinOccur() + { + return 2; + } + + int RoadRangeXmlParser::SubElementRoadCursorParser::GetMaxOccur() + { + return -1; + } + + bool RoadRangeXmlParser::SubElementRoadCursorParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROAD_CURSOR ; + } + + std::vector RoadRangeXmlParser::SubElementRoadCursorParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROAD_CURSOR + }; + } + + RoadRangeXmlParser::RoadRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RouteXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> RouteXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeClosed: public IAttributeParser, public XmlParserBase + { + public: + AttributeClosed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetClosed(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> RouteXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RouteXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RouteXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int RouteXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int RouteXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool RouteXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector RouteXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + RouteXmlParser::SubElementWaypointsParser::SubElementWaypointsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _waypointXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RouteXmlParser::SubElementWaypointsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto waypoints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + waypoints->SetParent(object); + _waypointXmlParser->ParseElement(indexedElement, parserContext, waypoints); + auto waypointsList = typedObject->GetWriterWaypoints(); + waypointsList.push_back(waypoints); + typedObject->SetWaypoints(waypointsList); + + + } + + int RouteXmlParser::SubElementWaypointsParser::GetMinOccur() + { + return 2; + } + + int RouteXmlParser::SubElementWaypointsParser::GetMaxOccur() + { + return -1; + } + + bool RouteXmlParser::SubElementWaypointsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__WAYPOINT ; + } + + std::vector RouteXmlParser::SubElementWaypointsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__WAYPOINT + }; + } + + RouteXmlParser::RouteXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RouteCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RouteCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RouteCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RouteCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RouteCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int RouteCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int RouteCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool RouteCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector RouteCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + RouteCatalogLocationXmlParser::RouteCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoutePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoutePositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> RoutePositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RoutePositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoutePositionXmlParser::SubElementRouteRefParser::SubElementRouteRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routeRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutePositionXmlParser::SubElementRouteRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto routeRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + routeRef->SetParent(object); + _routeRefXmlParser->ParseElement(indexedElement, parserContext, routeRef); + + typedObject->SetRouteRef(routeRef); + + + } + + int RoutePositionXmlParser::SubElementRouteRefParser::GetMinOccur() + { + return 1; + } + + int RoutePositionXmlParser::SubElementRouteRefParser::GetMaxOccur() + { + return 1; + } + + bool RoutePositionXmlParser::SubElementRouteRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE_REF ; + } + + std::vector RoutePositionXmlParser::SubElementRouteRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE_REF + }; + } + RoutePositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutePositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int RoutePositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int RoutePositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool RoutePositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector RoutePositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + RoutePositionXmlParser::SubElementInRoutePositionParser::SubElementInRoutePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _inRoutePositionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutePositionXmlParser::SubElementInRoutePositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto inRoutePosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + inRoutePosition->SetParent(object); + _inRoutePositionXmlParser->ParseElement(indexedElement, parserContext, inRoutePosition); + + typedObject->SetInRoutePosition(inRoutePosition); + + + } + + int RoutePositionXmlParser::SubElementInRoutePositionParser::GetMinOccur() + { + return 1; + } + + int RoutePositionXmlParser::SubElementInRoutePositionParser::GetMaxOccur() + { + return 1; + } + + bool RoutePositionXmlParser::SubElementInRoutePositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__IN_ROUTE_POSITION ; + } + + std::vector RoutePositionXmlParser::SubElementInRoutePositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__IN_ROUTE_POSITION + }; + } + + RoutePositionXmlParser::RoutePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RouteRefXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> RouteRefXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RouteRefXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RouteRefXmlParser::SubElementRouteParser::SubElementRouteParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _routeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RouteRefXmlParser::SubElementRouteParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto route = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + route->SetParent(object); + _routeXmlParser->ParseElement(indexedElement, parserContext, route); + + typedObject->SetRoute(route); + + + } + + int RouteRefXmlParser::SubElementRouteParser::GetMinOccur() + { + return 1; + } + + int RouteRefXmlParser::SubElementRouteParser::GetMaxOccur() + { + return 1; + } + + bool RouteRefXmlParser::SubElementRouteParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROUTE ; + } + + std::vector RouteRefXmlParser::SubElementRouteParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROUTE + }; + } + RouteRefXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RouteRefXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int RouteRefXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int RouteRefXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool RouteRefXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector RouteRefXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + + RouteRefXmlParser::RouteRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoutingActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + RoutingActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> RoutingActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> RoutingActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + RoutingActionXmlParser::SubElementAssignRouteActionParser::SubElementAssignRouteActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _assignRouteActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutingActionXmlParser::SubElementAssignRouteActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto assignRouteAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + assignRouteAction->SetParent(object); + _assignRouteActionXmlParser->ParseElement(indexedElement, parserContext, assignRouteAction); + + typedObject->SetAssignRouteAction(assignRouteAction); + + + } + + int RoutingActionXmlParser::SubElementAssignRouteActionParser::GetMinOccur() + { + return 1; + } + + int RoutingActionXmlParser::SubElementAssignRouteActionParser::GetMaxOccur() + { + return 1; + } + + bool RoutingActionXmlParser::SubElementAssignRouteActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION ; + } + + std::vector RoutingActionXmlParser::SubElementAssignRouteActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ASSIGN_ROUTE_ACTION + }; + } + RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::SubElementFollowTrajectoryActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _followTrajectoryActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto followTrajectoryAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + followTrajectoryAction->SetParent(object); + _followTrajectoryActionXmlParser->ParseElement(indexedElement, parserContext, followTrajectoryAction); + + typedObject->SetFollowTrajectoryAction(followTrajectoryAction); + + + } + + int RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::GetMinOccur() + { + return 1; + } + + int RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::GetMaxOccur() + { + return 1; + } + + bool RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION ; + } + + std::vector RoutingActionXmlParser::SubElementFollowTrajectoryActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FOLLOW_TRAJECTORY_ACTION + }; + } + RoutingActionXmlParser::SubElementAcquirePositionActionParser::SubElementAcquirePositionActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _acquirePositionActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutingActionXmlParser::SubElementAcquirePositionActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto acquirePositionAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + acquirePositionAction->SetParent(object); + _acquirePositionActionXmlParser->ParseElement(indexedElement, parserContext, acquirePositionAction); + + typedObject->SetAcquirePositionAction(acquirePositionAction); + + + } + + int RoutingActionXmlParser::SubElementAcquirePositionActionParser::GetMinOccur() + { + return 1; + } + + int RoutingActionXmlParser::SubElementAcquirePositionActionParser::GetMaxOccur() + { + return 1; + } + + bool RoutingActionXmlParser::SubElementAcquirePositionActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION ; + } + + std::vector RoutingActionXmlParser::SubElementAcquirePositionActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACQUIRE_POSITION_ACTION + }; + } + RoutingActionXmlParser::SubElementRandomRouteActionParser::SubElementRandomRouteActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _randomRouteActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void RoutingActionXmlParser::SubElementRandomRouteActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto randomRouteAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + randomRouteAction->SetParent(object); + _randomRouteActionXmlParser->ParseElement(indexedElement, parserContext, randomRouteAction); + + typedObject->SetRandomRouteAction(randomRouteAction); + + + } + + int RoutingActionXmlParser::SubElementRandomRouteActionParser::GetMinOccur() + { + return 1; + } + + int RoutingActionXmlParser::SubElementRandomRouteActionParser::GetMaxOccur() + { + return 1; + } + + bool RoutingActionXmlParser::SubElementRandomRouteActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION ; + } + + std::vector RoutingActionXmlParser::SubElementRandomRouteActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANDOM_ROUTE_ACTION + }; + } + + RoutingActionXmlParser::RoutingActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ScenarioDefinitionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + + std::vector> ScenarioDefinitionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector ScenarioDefinitionXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::SubElementVariableDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto variableDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + variableDeclarations->SetParent(object); + _variableDeclarationXmlParser->ParseElement(indexedElement, parserContext, variableDeclarations); + auto variableDeclarationsList = typedObject->GetWriterVariableDeclarations(); + variableDeclarationsList.push_back(variableDeclarations); + typedObject->SetVariableDeclarations(variableDeclarationsList); + + + } + + int ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::GetMinOccur() + { + return 0; + } + + int ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATION; + } + + std::vector ScenarioDefinitionXmlParser::SubElementVariableDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__VARIABLE_DECLARATION}; + } + ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::SubElementMonitorDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _monitorDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto monitorDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + monitorDeclarations->SetParent(object); + _monitorDeclarationXmlParser->ParseElement(indexedElement, parserContext, monitorDeclarations); + auto monitorDeclarationsList = typedObject->GetWriterMonitorDeclarations(); + monitorDeclarationsList.push_back(monitorDeclarations); + typedObject->SetMonitorDeclarations(monitorDeclarationsList); + + + } + + int ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::GetMinOccur() + { + return 0; + } + + int ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATION; + } + + std::vector ScenarioDefinitionXmlParser::SubElementMonitorDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__MONITOR_DECLARATION}; + } + ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::SubElementCatalogLocationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogLocationsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogLocations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogLocations->SetParent(object); + _catalogLocationsXmlParser->ParseElement(indexedElement, parserContext, catalogLocations); + + typedObject->SetCatalogLocations(catalogLocations); + + + } + + int ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::GetMinOccur() + { + return 1; + } + + int ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS ; + } + + std::vector ScenarioDefinitionXmlParser::SubElementCatalogLocationsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_LOCATIONS + }; + } + ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::SubElementRoadNetworkParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _roadNetworkXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto roadNetwork = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + roadNetwork->SetParent(object); + _roadNetworkXmlParser->ParseElement(indexedElement, parserContext, roadNetwork); + + typedObject->SetRoadNetwork(roadNetwork); + + + } + + int ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::GetMinOccur() + { + return 1; + } + + int ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROAD_NETWORK ; + } + + std::vector ScenarioDefinitionXmlParser::SubElementRoadNetworkParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROAD_NETWORK + }; + } + ScenarioDefinitionXmlParser::SubElementEntitiesParser::SubElementEntitiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entitiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementEntitiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entities = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entities->SetParent(object); + _entitiesXmlParser->ParseElement(indexedElement, parserContext, entities); + + typedObject->SetEntities(entities); + + + } + + int ScenarioDefinitionXmlParser::SubElementEntitiesParser::GetMinOccur() + { + return 1; + } + + int ScenarioDefinitionXmlParser::SubElementEntitiesParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioDefinitionXmlParser::SubElementEntitiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITIES ; + } + + std::vector ScenarioDefinitionXmlParser::SubElementEntitiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITIES + }; + } + ScenarioDefinitionXmlParser::SubElementStoryboardParser::SubElementStoryboardParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _storyboardXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioDefinitionXmlParser::SubElementStoryboardParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto storyboard = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + storyboard->SetParent(object); + _storyboardXmlParser->ParseElement(indexedElement, parserContext, storyboard); + + typedObject->SetStoryboard(storyboard); + + + } + + int ScenarioDefinitionXmlParser::SubElementStoryboardParser::GetMinOccur() + { + return 1; + } + + int ScenarioDefinitionXmlParser::SubElementStoryboardParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioDefinitionXmlParser::SubElementStoryboardParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STORYBOARD ; + } + + std::vector ScenarioDefinitionXmlParser::SubElementStoryboardParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STORYBOARD + }; + } + + ScenarioDefinitionXmlParser::ScenarioDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ScenarioObjectXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ScenarioObjectXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ScenarioObjectXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ScenarioObjectXmlParser::SubElementEntityObjectParser::SubElementEntityObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioObjectXmlParser::SubElementEntityObjectParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityObject = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityObject->SetParent(object); + _entityObjectXmlParser->ParseElement(indexedElement, parserContext, entityObject); + + typedObject->SetEntityObject(entityObject); + + + } + + int ScenarioObjectXmlParser::SubElementEntityObjectParser::GetMinOccur() + { + return 1; + } + + int ScenarioObjectXmlParser::SubElementEntityObjectParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioObjectXmlParser::SubElementEntityObjectParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE || + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE || + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN || + elementName == OSC_CONSTANTS::ELEMENT__MISC_OBJECT || + elementName == OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE ; + } + + std::vector ScenarioObjectXmlParser::SubElementEntityObjectParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE, + OSC_CONSTANTS::ELEMENT__VEHICLE, + OSC_CONSTANTS::ELEMENT__PEDESTRIAN, + OSC_CONSTANTS::ELEMENT__MISC_OBJECT, + OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE + }; + } + ScenarioObjectXmlParser::SubElementObjectControllerParser::SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _objectControllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioObjectXmlParser::SubElementObjectControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto objectController = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + objectController->SetParent(object); + _objectControllerXmlParser->ParseElement(indexedElement, parserContext, objectController); + auto objectControllerList = typedObject->GetWriterObjectController(); + objectControllerList.push_back(objectController); + typedObject->SetObjectController(objectControllerList); + + + } + + int ScenarioObjectXmlParser::SubElementObjectControllerParser::GetMinOccur() + { + return 0; + } + + int ScenarioObjectXmlParser::SubElementObjectControllerParser::GetMaxOccur() + { + return -1; + } + + bool ScenarioObjectXmlParser::SubElementObjectControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER ; + } + + std::vector ScenarioObjectXmlParser::SubElementObjectControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER + }; + } + + ScenarioObjectXmlParser::ScenarioObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioObjectTemplateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ScenarioObjectTemplateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ScenarioObjectTemplateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ScenarioObjectTemplateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::SubElementEntitiyObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entitiyObject = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entitiyObject->SetParent(object); + _entityObjectXmlParser->ParseElement(indexedElement, parserContext, entitiyObject); + + typedObject->SetEntitiyObject(entitiyObject); + + + } + + int ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::GetMinOccur() + { + return 1; + } + + int ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::GetMaxOccur() + { + return 1; + } + + bool ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE || + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE || + elementName == OSC_CONSTANTS::ELEMENT__PEDESTRIAN || + elementName == OSC_CONSTANTS::ELEMENT__MISC_OBJECT || + elementName == OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE ; + } + + std::vector ScenarioObjectTemplateXmlParser::SubElementEntitiyObjectParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE, + OSC_CONSTANTS::ELEMENT__VEHICLE, + OSC_CONSTANTS::ELEMENT__PEDESTRIAN, + OSC_CONSTANTS::ELEMENT__MISC_OBJECT, + OSC_CONSTANTS::ELEMENT__EXTERNAL_OBJECT_REFERENCE + }; + } + ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _objectControllerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto objectController = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + objectController->SetParent(object); + _objectControllerXmlParser->ParseElement(indexedElement, parserContext, objectController); + auto objectControllerList = typedObject->GetWriterObjectController(); + objectControllerList.push_back(objectController); + typedObject->SetObjectController(objectControllerList); + + + } + + int ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::GetMinOccur() + { + return 0; + } + + int ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::GetMaxOccur() + { + return -1; + } + + bool ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER ; + } + + std::vector ScenarioObjectTemplateXmlParser::SubElementObjectControllerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__OBJECT_CONTROLLER + }; + } + + ScenarioObjectTemplateXmlParser::ScenarioObjectTemplateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SelectedEntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SelectedEntitiesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> SelectedEntitiesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> SelectedEntitiesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SelectedEntitiesXmlParser::SubElementEntityRefParser::SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SelectedEntitiesXmlParser::SubElementEntityRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRef->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRef); + auto entityRefList = typedObject->GetWriterEntityRef(); + entityRefList.push_back(entityRef); + typedObject->SetEntityRef(entityRefList); + + + } + + int SelectedEntitiesXmlParser::SubElementEntityRefParser::GetMinOccur() + { + return 1; + } + + int SelectedEntitiesXmlParser::SubElementEntityRefParser::GetMaxOccur() + { + return -1; + } + + bool SelectedEntitiesXmlParser::SubElementEntityRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector SelectedEntitiesXmlParser::SubElementEntityRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + SelectedEntitiesXmlParser::SubElementByTypeParser::SubElementByTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _byTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SelectedEntitiesXmlParser::SubElementByTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto byType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + byType->SetParent(object); + _byTypeXmlParser->ParseElement(indexedElement, parserContext, byType); + auto byTypeList = typedObject->GetWriterByType(); + byTypeList.push_back(byType); + typedObject->SetByType(byTypeList); + + + } + + int SelectedEntitiesXmlParser::SubElementByTypeParser::GetMinOccur() + { + return 1; + } + + int SelectedEntitiesXmlParser::SubElementByTypeParser::GetMaxOccur() + { + return -1; + } + + bool SelectedEntitiesXmlParser::SubElementByTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BY_TYPE ; + } + + std::vector SelectedEntitiesXmlParser::SubElementByTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BY_TYPE + }; + } + + SelectedEntitiesXmlParser::SelectedEntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SensorReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SensorReferenceXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> SensorReferenceXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SensorReferenceXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SensorReferenceXmlParser::SensorReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SensorReferenceSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SensorReferenceSetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SensorReferenceSetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> SensorReferenceSetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SensorReferenceSetXmlParser::SubElementSensorReferencesParser::SubElementSensorReferencesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _sensorReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SensorReferenceSetXmlParser::SubElementSensorReferencesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto sensorReferences = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + sensorReferences->SetParent(object); + _sensorReferenceXmlParser->ParseElement(indexedElement, parserContext, sensorReferences); + auto sensorReferencesList = typedObject->GetWriterSensorReferences(); + sensorReferencesList.push_back(sensorReferences); + typedObject->SetSensorReferences(sensorReferencesList); + + + } + + int SensorReferenceSetXmlParser::SubElementSensorReferencesParser::GetMinOccur() + { + return 1; + } + + int SensorReferenceSetXmlParser::SubElementSensorReferencesParser::GetMaxOccur() + { + return -1; + } + + bool SensorReferenceSetXmlParser::SubElementSensorReferencesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE ; + } + + std::vector SensorReferenceSetXmlParser::SubElementSensorReferencesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE + }; + } + + SensorReferenceSetXmlParser::SensorReferenceSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SetMonitorActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SetMonitorActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SetMonitorActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMonitorRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeMonitorRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetMonitorRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MONITOR_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SetMonitorActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SetMonitorActionXmlParser::SetMonitorActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ShapeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ShapeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> ShapeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ShapeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ShapeXmlParser::SubElementPolylineParser::SubElementPolylineParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _polylineXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ShapeXmlParser::SubElementPolylineParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto polyline = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + polyline->SetParent(object); + _polylineXmlParser->ParseElement(indexedElement, parserContext, polyline); + + typedObject->SetPolyline(polyline); + + + } + + int ShapeXmlParser::SubElementPolylineParser::GetMinOccur() + { + return 1; + } + + int ShapeXmlParser::SubElementPolylineParser::GetMaxOccur() + { + return 1; + } + + bool ShapeXmlParser::SubElementPolylineParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POLYLINE ; + } + + std::vector ShapeXmlParser::SubElementPolylineParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POLYLINE + }; + } + ShapeXmlParser::SubElementClothoidParser::SubElementClothoidParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _clothoidXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ShapeXmlParser::SubElementClothoidParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto clothoid = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + clothoid->SetParent(object); + _clothoidXmlParser->ParseElement(indexedElement, parserContext, clothoid); + + typedObject->SetClothoid(clothoid); + + + } + + int ShapeXmlParser::SubElementClothoidParser::GetMinOccur() + { + return 1; + } + + int ShapeXmlParser::SubElementClothoidParser::GetMaxOccur() + { + return 1; + } + + bool ShapeXmlParser::SubElementClothoidParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CLOTHOID ; + } + + std::vector ShapeXmlParser::SubElementClothoidParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CLOTHOID + }; + } + ShapeXmlParser::SubElementClothoidSplineParser::SubElementClothoidSplineParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _clothoidSplineXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ShapeXmlParser::SubElementClothoidSplineParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto clothoidSpline = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + clothoidSpline->SetParent(object); + _clothoidSplineXmlParser->ParseElement(indexedElement, parserContext, clothoidSpline); + + typedObject->SetClothoidSpline(clothoidSpline); + + + } + + int ShapeXmlParser::SubElementClothoidSplineParser::GetMinOccur() + { + return 1; + } + + int ShapeXmlParser::SubElementClothoidSplineParser::GetMaxOccur() + { + return 1; + } + + bool ShapeXmlParser::SubElementClothoidSplineParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE ; + } + + std::vector ShapeXmlParser::SubElementClothoidSplineParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CLOTHOID_SPLINE + }; + } + ShapeXmlParser::SubElementNurbsParser::SubElementNurbsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _nurbsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ShapeXmlParser::SubElementNurbsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto nurbs = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + nurbs->SetParent(object); + _nurbsXmlParser->ParseElement(indexedElement, parserContext, nurbs); + + typedObject->SetNurbs(nurbs); + + + } + + int ShapeXmlParser::SubElementNurbsParser::GetMinOccur() + { + return 1; + } + + int ShapeXmlParser::SubElementNurbsParser::GetMaxOccur() + { + return 1; + } + + bool ShapeXmlParser::SubElementNurbsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__NURBS ; + } + + std::vector ShapeXmlParser::SubElementNurbsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__NURBS + }; + } + + ShapeXmlParser::ShapeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SimulationTimeConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SimulationTimeConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SimulationTimeConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SimulationTimeConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SimulationTimeConditionXmlParser::SimulationTimeConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SpeedActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> SpeedActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> SpeedActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::SubElementSpeedActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _transitionDynamicsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedActionDynamics = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedActionDynamics->SetParent(object); + _transitionDynamicsXmlParser->ParseElement(indexedElement, parserContext, speedActionDynamics); + + typedObject->SetSpeedActionDynamics(speedActionDynamics); + + + } + + int SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::GetMinOccur() + { + return 1; + } + + int SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::GetMaxOccur() + { + return 1; + } + + bool SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_ACTION_DYNAMICS ; + } + + std::vector SpeedActionXmlParser::SubElementSpeedActionDynamicsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_ACTION_DYNAMICS + }; + } + SpeedActionXmlParser::SubElementSpeedActionTargetParser::SubElementSpeedActionTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _speedActionTargetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedActionXmlParser::SubElementSpeedActionTargetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedActionTarget = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedActionTarget->SetParent(object); + _speedActionTargetXmlParser->ParseElement(indexedElement, parserContext, speedActionTarget); + + typedObject->SetSpeedActionTarget(speedActionTarget); + + + } + + int SpeedActionXmlParser::SubElementSpeedActionTargetParser::GetMinOccur() + { + return 1; + } + + int SpeedActionXmlParser::SubElementSpeedActionTargetParser::GetMaxOccur() + { + return 1; + } + + bool SpeedActionXmlParser::SubElementSpeedActionTargetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_ACTION_TARGET ; + } + + std::vector SpeedActionXmlParser::SubElementSpeedActionTargetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_ACTION_TARGET + }; + } + + SpeedActionXmlParser::SpeedActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedActionTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SpeedActionTargetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> SpeedActionTargetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> SpeedActionTargetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::SubElementRelativeTargetSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _relativeTargetSpeedXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto relativeTargetSpeed = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + relativeTargetSpeed->SetParent(object); + _relativeTargetSpeedXmlParser->ParseElement(indexedElement, parserContext, relativeTargetSpeed); + + typedObject->SetRelativeTargetSpeed(relativeTargetSpeed); + + + } + + int SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::GetMinOccur() + { + return 1; + } + + int SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::GetMaxOccur() + { + return 1; + } + + bool SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED ; + } + + std::vector SpeedActionTargetXmlParser::SubElementRelativeTargetSpeedParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RELATIVE_TARGET_SPEED + }; + } + SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::SubElementAbsoluteTargetSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _absoluteTargetSpeedXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto absoluteTargetSpeed = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + absoluteTargetSpeed->SetParent(object); + _absoluteTargetSpeedXmlParser->ParseElement(indexedElement, parserContext, absoluteTargetSpeed); + + typedObject->SetAbsoluteTargetSpeed(absoluteTargetSpeed); + + + } + + int SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::GetMinOccur() + { + return 1; + } + + int SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::GetMaxOccur() + { + return 1; + } + + bool SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED ; + } + + std::vector SpeedActionTargetXmlParser::SubElementAbsoluteTargetSpeedParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ABSOLUTE_TARGET_SPEED + }; + } + + SpeedActionTargetXmlParser::SpeedActionTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SpeedConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SpeedConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDirection: public IAttributeParser, public XmlParserBase + { + public: + AttributeDirection(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DirectionalDimension::GetFromLiteral(attributeValue); + if (kResult != DirectionalDimension::UNKNOWN) + { + typedObject->SetDirection(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DirectionalDimension::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DirectionalDimension::GetDeprecatedVersion(kResult) +"'. " + DirectionalDimension::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SpeedConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SpeedConditionXmlParser::SpeedConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedProfileActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SpeedProfileActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SpeedProfileActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFollowingMode: public IAttributeParser, public XmlParserBase + { + public: + AttributeFollowingMode(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(attributeValue); + if (kResult != FollowingMode::UNKNOWN) + { + typedObject->SetFollowingMode(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (FollowingMode::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + FollowingMode::GetDeprecatedVersion(kResult) +"'. " + FollowingMode::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SpeedProfileActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _dynamicConstraintsXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto dynamicConstraints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + dynamicConstraints->SetParent(object); + _dynamicConstraintsXmlParser->ParseElement(indexedElement, parserContext, dynamicConstraints); + + typedObject->SetDynamicConstraints(dynamicConstraints); + + + } + + int SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::GetMinOccur() + { + return 0; + } + + int SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::GetMaxOccur() + { + return 1; + } + + bool SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS ; + } + + std::vector SpeedProfileActionXmlParser::SubElementDynamicConstraintsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DYNAMIC_CONSTRAINTS + }; + } + SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::SubElementSpeedProfileEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _speedProfileEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto speedProfileEntry = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + speedProfileEntry->SetParent(object); + _speedProfileEntryXmlParser->ParseElement(indexedElement, parserContext, speedProfileEntry); + auto speedProfileEntryList = typedObject->GetWriterSpeedProfileEntry(); + speedProfileEntryList.push_back(speedProfileEntry); + typedObject->SetSpeedProfileEntry(speedProfileEntryList); + + + } + + int SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::GetMinOccur() + { + return 1; + } + + int SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::GetMaxOccur() + { + return -1; + } + + bool SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ENTRY ; + } + + std::vector SpeedProfileActionXmlParser::SubElementSpeedProfileEntryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SPEED_PROFILE_ENTRY + }; + } + + SpeedProfileActionXmlParser::SpeedProfileActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedProfileEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SpeedProfileEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SpeedProfileEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeSpeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSpeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SpeedProfileEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SpeedProfileEntryXmlParser::SpeedProfileEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StandStillConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StandStillConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StandStillConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDuration: public IAttributeParser, public XmlParserBase + { + public: + AttributeDuration(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DURATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDuration(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DURATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> StandStillConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + StandStillConditionXmlParser::StandStillConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SteadyStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> SteadyStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::SubElementTargetDistanceSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _targetDistanceSteadyStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto targetDistanceSteadyState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + targetDistanceSteadyState->SetParent(object); + _targetDistanceSteadyStateXmlParser->ParseElement(indexedElement, parserContext, targetDistanceSteadyState); + + typedObject->SetTargetDistanceSteadyState(targetDistanceSteadyState); + + + } + + int SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::GetMinOccur() + { + return 1; + } + + int SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::GetMaxOccur() + { + return 1; + } + + bool SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE ; + } + + std::vector SteadyStateXmlParser::SubElementTargetDistanceSteadyStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_DISTANCE_STEADY_STATE + }; + } + SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::SubElementTargetTimeSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _targetTimeSteadyStateXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto targetTimeSteadyState = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + targetTimeSteadyState->SetParent(object); + _targetTimeSteadyStateXmlParser->ParseElement(indexedElement, parserContext, targetTimeSteadyState); + + typedObject->SetTargetTimeSteadyState(targetTimeSteadyState); + + + } + + int SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::GetMinOccur() + { + return 1; + } + + int SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::GetMaxOccur() + { + return 1; + } + + bool SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE ; + } + + std::vector SteadyStateXmlParser::SubElementTargetTimeSteadyStateParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_TIME_STEADY_STATE + }; + } + + SteadyStateXmlParser::SteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StochasticXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StochasticXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeNumberOfTestRuns: public IAttributeParser, public XmlParserBase + { + public: + AttributeNumberOfTestRuns(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetNumberOfTestRuns(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_TEST_RUNS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRandomSeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeRandomSeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRandomSeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RANDOM_SEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> StochasticXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + StochasticXmlParser::SubElementStochasticDistributionsParser::SubElementStochasticDistributionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _stochasticDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticXmlParser::SubElementStochasticDistributionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stochasticDistributions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stochasticDistributions->SetParent(object); + _stochasticDistributionXmlParser->ParseElement(indexedElement, parserContext, stochasticDistributions); + auto stochasticDistributionsList = typedObject->GetWriterStochasticDistributions(); + stochasticDistributionsList.push_back(stochasticDistributions); + typedObject->SetStochasticDistributions(stochasticDistributionsList); + + + } + + int StochasticXmlParser::SubElementStochasticDistributionsParser::GetMinOccur() + { + return 1; + } + + int StochasticXmlParser::SubElementStochasticDistributionsParser::GetMaxOccur() + { + return -1; + } + + bool StochasticXmlParser::SubElementStochasticDistributionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION ; + } + + std::vector StochasticXmlParser::SubElementStochasticDistributionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STOCHASTIC_DISTRIBUTION + }; + } + + StochasticXmlParser::StochasticXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StochasticDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StochasticDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeParameterName: public IAttributeParser, public XmlParserBase + { + public: + AttributeParameterName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetParameterName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PARAMETER_NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> StochasticDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::SubElementStochasticDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _stochasticDistributionTypeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stochasticDistributionType = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stochasticDistributionType->SetParent(object); + _stochasticDistributionTypeXmlParser->ParseElement(indexedElement, parserContext, stochasticDistributionType); + + typedObject->SetStochasticDistributionType(stochasticDistributionType); + + + } + + int StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET || + elementName == OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION || + elementName == OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION || + elementName == OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION || + elementName == OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION || + elementName == OSC_CONSTANTS::ELEMENT__HISTOGRAM || + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ; + } + + std::vector StochasticDistributionXmlParser::SubElementStochasticDistributionTypeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET, + OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION, + OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION, + OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION, + OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION, + OSC_CONSTANTS::ELEMENT__HISTOGRAM, + OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION + }; + } + + StochasticDistributionXmlParser::StochasticDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StochasticDistributionTypeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + + std::vector> StochasticDistributionTypeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::SubElementProbabilityDistributionSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _probabilityDistributionSetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto probabilityDistributionSet = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + probabilityDistributionSet->SetParent(object); + _probabilityDistributionSetXmlParser->ParseElement(indexedElement, parserContext, probabilityDistributionSet); + + typedObject->SetProbabilityDistributionSet(probabilityDistributionSet); + + + } + + int StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementProbabilityDistributionSetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROBABILITY_DISTRIBUTION_SET + }; + } + StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::SubElementNormalDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _normalDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto normalDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + normalDistribution->SetParent(object); + _normalDistributionXmlParser->ParseElement(indexedElement, parserContext, normalDistribution); + + typedObject->SetNormalDistribution(normalDistribution); + + + } + + int StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementNormalDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__NORMAL_DISTRIBUTION + }; + } + StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::SubElementLogNormalDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _logNormalDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto logNormalDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + logNormalDistribution->SetParent(object); + _logNormalDistributionXmlParser->ParseElement(indexedElement, parserContext, logNormalDistribution); + + typedObject->SetLogNormalDistribution(logNormalDistribution); + + + } + + int StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementLogNormalDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__LOG_NORMAL_DISTRIBUTION + }; + } + StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::SubElementUniformDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _uniformDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto uniformDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + uniformDistribution->SetParent(object); + _uniformDistributionXmlParser->ParseElement(indexedElement, parserContext, uniformDistribution); + + typedObject->SetUniformDistribution(uniformDistribution); + + + } + + int StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementUniformDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__UNIFORM_DISTRIBUTION + }; + } + StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::SubElementPoissonDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _poissonDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto poissonDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + poissonDistribution->SetParent(object); + _poissonDistributionXmlParser->ParseElement(indexedElement, parserContext, poissonDistribution); + + typedObject->SetPoissonDistribution(poissonDistribution); + + + } + + int StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementPoissonDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POISSON_DISTRIBUTION + }; + } + StochasticDistributionTypeXmlParser::SubElementHistogramParser::SubElementHistogramParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _histogramXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementHistogramParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto histogram = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + histogram->SetParent(object); + _histogramXmlParser->ParseElement(indexedElement, parserContext, histogram); + + typedObject->SetHistogram(histogram); + + + } + + int StochasticDistributionTypeXmlParser::SubElementHistogramParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementHistogramParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementHistogramParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__HISTOGRAM ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementHistogramParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__HISTOGRAM + }; + } + StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::SubElementUserDefinedDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _userDefinedDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto userDefinedDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + userDefinedDistribution->SetParent(object); + _userDefinedDistributionXmlParser->ParseElement(indexedElement, parserContext, userDefinedDistribution); + + typedObject->SetUserDefinedDistribution(userDefinedDistribution); + + + } + + int StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetMinOccur() + { + return 1; + } + + int StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetMaxOccur() + { + return 1; + } + + bool StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION ; + } + + std::vector StochasticDistributionTypeXmlParser::SubElementUserDefinedDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__USER_DEFINED_DISTRIBUTION + }; + } + + StochasticDistributionTypeXmlParser::StochasticDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StoryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StoryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> StoryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + StoryXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StoryXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int StoryXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int StoryXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool StoryXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector StoryXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + StoryXmlParser::SubElementActsParser::SubElementActsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _actXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StoryXmlParser::SubElementActsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto acts = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + acts->SetParent(object); + _actXmlParser->ParseElement(indexedElement, parserContext, acts); + auto actsList = typedObject->GetWriterActs(); + actsList.push_back(acts); + typedObject->SetActs(actsList); + + + } + + int StoryXmlParser::SubElementActsParser::GetMinOccur() + { + return 1; + } + + int StoryXmlParser::SubElementActsParser::GetMaxOccur() + { + return -1; + } + + bool StoryXmlParser::SubElementActsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ACT ; + } + + std::vector StoryXmlParser::SubElementActsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ACT + }; + } + + StoryXmlParser::StoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryboardImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StoryboardXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StoryboardXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> StoryboardXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + StoryboardXmlParser::SubElementInitParser::SubElementInitParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _initXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StoryboardXmlParser::SubElementInitParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto init = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + init->SetParent(object); + _initXmlParser->ParseElement(indexedElement, parserContext, init); + + typedObject->SetInit(init); + + + } + + int StoryboardXmlParser::SubElementInitParser::GetMinOccur() + { + return 1; + } + + int StoryboardXmlParser::SubElementInitParser::GetMaxOccur() + { + return 1; + } + + bool StoryboardXmlParser::SubElementInitParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__INIT ; + } + + std::vector StoryboardXmlParser::SubElementInitParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__INIT + }; + } + StoryboardXmlParser::SubElementStoriesParser::SubElementStoriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _storyXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StoryboardXmlParser::SubElementStoriesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stories = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stories->SetParent(object); + _storyXmlParser->ParseElement(indexedElement, parserContext, stories); + auto storiesList = typedObject->GetWriterStories(); + storiesList.push_back(stories); + typedObject->SetStories(storiesList); + + + } + + int StoryboardXmlParser::SubElementStoriesParser::GetMinOccur() + { + return 0; + } + + int StoryboardXmlParser::SubElementStoriesParser::GetMaxOccur() + { + return -1; + } + + bool StoryboardXmlParser::SubElementStoriesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STORY ; + } + + std::vector StoryboardXmlParser::SubElementStoriesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STORY + }; + } + StoryboardXmlParser::SubElementStopTriggerParser::SubElementStopTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _triggerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void StoryboardXmlParser::SubElementStopTriggerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto stopTrigger = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + stopTrigger->SetParent(object); + _triggerXmlParser->ParseElement(indexedElement, parserContext, stopTrigger); + + typedObject->SetStopTrigger(stopTrigger); + + + } + + int StoryboardXmlParser::SubElementStopTriggerParser::GetMinOccur() + { + return 0; + } + + int StoryboardXmlParser::SubElementStopTriggerParser::GetMaxOccur() + { + return 1; + } + + bool StoryboardXmlParser::SubElementStopTriggerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__STOP_TRIGGER ; + } + + std::vector StoryboardXmlParser::SubElementStopTriggerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__STOP_TRIGGER + }; + } + + StoryboardXmlParser::StoryboardXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryboardElementStateConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + StoryboardElementStateConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> StoryboardElementStateConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = StoryboardElementState::GetFromLiteral(attributeValue); + if (kResult != StoryboardElementState::UNKNOWN) + { + typedObject->SetState(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (StoryboardElementState::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + StoryboardElementState::GetDeprecatedVersion(kResult) +"'. " + StoryboardElementState::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeStoryboardElementRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeStoryboardElementRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetStoryboardElementRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeStoryboardElementType: public IAttributeParser, public XmlParserBase + { + public: + AttributeStoryboardElementType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = StoryboardElementType::GetFromLiteral(attributeValue); + if (kResult != StoryboardElementType::UNKNOWN) + { + typedObject->SetStoryboardElementType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (StoryboardElementType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + StoryboardElementType::GetDeprecatedVersion(kResult) +"'. " + StoryboardElementType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STORYBOARD_ELEMENT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> StoryboardElementStateConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + StoryboardElementStateConditionXmlParser::StoryboardElementStateConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SunImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SunXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> SunXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAzimuth: public IAttributeParser, public XmlParserBase + { + public: + AttributeAzimuth(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAzimuth(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__AZIMUTH, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeElevation: public IAttributeParser, public XmlParserBase + { + public: + AttributeElevation(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetElevation(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ELEVATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeIlluminance: public IAttributeParser, public XmlParserBase + { + public: + AttributeIlluminance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetIlluminance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ILLUMINANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeIntensity: public IAttributeParser, public XmlParserBase + { + public: + AttributeIntensity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetIntensity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use illuminance instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__INTENSITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SunXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + SunXmlParser::SunXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SynchronizeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + SynchronizeActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> SynchronizeActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMasterEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeMasterEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetMasterEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MASTER_ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTargetTolerance: public IAttributeParser, public XmlParserBase + { + public: + AttributeTargetTolerance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTargetTolerance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTargetToleranceMaster: public IAttributeParser, public XmlParserBase + { + public: + AttributeTargetToleranceMaster(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTargetToleranceMaster(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TARGET_TOLERANCE_MASTER, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> SynchronizeActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::SubElementTargetPositionMasterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto targetPositionMaster = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + targetPositionMaster->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, targetPositionMaster); + + typedObject->SetTargetPositionMaster(targetPositionMaster); + + + } + + int SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::GetMinOccur() + { + return 1; + } + + int SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::GetMaxOccur() + { + return 1; + } + + bool SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_POSITION_MASTER ; + } + + std::vector SynchronizeActionXmlParser::SubElementTargetPositionMasterParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_POSITION_MASTER + }; + } + SynchronizeActionXmlParser::SubElementTargetPositionParser::SubElementTargetPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SynchronizeActionXmlParser::SubElementTargetPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto targetPosition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + targetPosition->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, targetPosition); + + typedObject->SetTargetPosition(targetPosition); + + + } + + int SynchronizeActionXmlParser::SubElementTargetPositionParser::GetMinOccur() + { + return 1; + } + + int SynchronizeActionXmlParser::SubElementTargetPositionParser::GetMaxOccur() + { + return 1; + } + + bool SynchronizeActionXmlParser::SubElementTargetPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TARGET_POSITION ; + } + + std::vector SynchronizeActionXmlParser::SubElementTargetPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TARGET_POSITION + }; + } + SynchronizeActionXmlParser::SubElementFinalSpeedParser::SubElementFinalSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _finalSpeedXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void SynchronizeActionXmlParser::SubElementFinalSpeedParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto finalSpeed = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + finalSpeed->SetParent(object); + _finalSpeedXmlParser->ParseElement(indexedElement, parserContext, finalSpeed); + + typedObject->SetFinalSpeed(finalSpeed); + + + } + + int SynchronizeActionXmlParser::SubElementFinalSpeedParser::GetMinOccur() + { + return 0; + } + + int SynchronizeActionXmlParser::SubElementFinalSpeedParser::GetMaxOccur() + { + return 1; + } + + bool SynchronizeActionXmlParser::SubElementFinalSpeedParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FINAL_SPEED ; + } + + std::vector SynchronizeActionXmlParser::SubElementFinalSpeedParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FINAL_SPEED + }; + } + + SynchronizeActionXmlParser::SynchronizeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TargetDistanceSteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TargetDistanceSteadyStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TargetDistanceSteadyStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDistance: public IAttributeParser, public XmlParserBase + { + public: + AttributeDistance(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDistance(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DISTANCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TargetDistanceSteadyStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TargetDistanceSteadyStateXmlParser::TargetDistanceSteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers4V1_3.cpp b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers4V1_3.cpp new file mode 100644 index 00000000..0a917dee --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsers4V1_3.cpp @@ -0,0 +1,10051 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlParsersV1_3.h" +#include "NamedReferenceProxy.h" +#include "FileContentMessage.h" +#include "Position.h" +#include "Textmarker.h" +#include "ErrorLevel.h" +#include "WrappedListParser.h" +#include "CatalogReferenceParserContextV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TargetTimeSteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TargetTimeSteadyStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TargetTimeSteadyStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TargetTimeSteadyStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TargetTimeSteadyStateXmlParser::TargetTimeSteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TeleportActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TeleportActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TeleportActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TeleportActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TeleportActionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TeleportActionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int TeleportActionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int TeleportActionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool TeleportActionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector TeleportActionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + TeleportActionXmlParser::TeleportActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeHeadwayConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeHeadwayConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TimeHeadwayConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAlongRoute: public IAttributeParser, public XmlParserBase + { + public: + AttributeAlongRoute(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAlongRoute(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.1'. Comment: 'Use relativeDistanceType and coordinateSystem'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeEntityRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeEntityRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetEntityRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ENTITY_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRelativeDistanceType: public IAttributeParser, public XmlParserBase + { + public: + AttributeRelativeDistanceType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(attributeValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + typedObject->SetRelativeDistanceType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RelativeDistanceType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RelativeDistanceType::GetDeprecatedVersion(kResult) +"'. " + RelativeDistanceType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRoutingAlgorithm: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoutingAlgorithm(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(attributeValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + typedObject->SetRoutingAlgorithm(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RoutingAlgorithm::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RoutingAlgorithm::GetDeprecatedVersion(kResult) +"'. " + RoutingAlgorithm::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TimeHeadwayConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TimeHeadwayConditionXmlParser::TimeHeadwayConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeOfDayImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeOfDayXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TimeOfDayXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAnimation: public IAttributeParser, public XmlParserBase + { + public: + AttributeAnimation(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAnimation(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ANIMATION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDateTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeDateTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDateTime(ParseDateTime(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TimeOfDayXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TimeOfDayXmlParser::TimeOfDayXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeOfDayConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeOfDayConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TimeOfDayConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDateTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeDateTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDateTime(ParseDateTime(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DATE_TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TimeOfDayConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TimeOfDayConditionXmlParser::TimeOfDayConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeReferenceXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TimeReferenceXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TimeReferenceXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TimeReferenceXmlParser::SubElementNoneParser::SubElementNoneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _noneXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TimeReferenceXmlParser::SubElementNoneParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto none = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + none->SetParent(object); + _noneXmlParser->ParseElement(indexedElement, parserContext, none); + + typedObject->SetNone(none); + + + } + + int TimeReferenceXmlParser::SubElementNoneParser::GetMinOccur() + { + return 1; + } + + int TimeReferenceXmlParser::SubElementNoneParser::GetMaxOccur() + { + return 1; + } + + bool TimeReferenceXmlParser::SubElementNoneParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__NONE ; + } + + std::vector TimeReferenceXmlParser::SubElementNoneParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__NONE + }; + } + TimeReferenceXmlParser::SubElementTimingParser::SubElementTimingParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timingXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TimeReferenceXmlParser::SubElementTimingParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timing = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timing->SetParent(object); + _timingXmlParser->ParseElement(indexedElement, parserContext, timing); + + typedObject->SetTiming(timing); + + + } + + int TimeReferenceXmlParser::SubElementTimingParser::GetMinOccur() + { + return 1; + } + + int TimeReferenceXmlParser::SubElementTimingParser::GetMaxOccur() + { + return 1; + } + + bool TimeReferenceXmlParser::SubElementTimingParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIMING ; + } + + std::vector TimeReferenceXmlParser::SubElementTimingParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIMING + }; + } + + TimeReferenceXmlParser::TimeReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeToCollisionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeToCollisionConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TimeToCollisionConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAlongRoute: public IAttributeParser, public XmlParserBase + { + public: + AttributeAlongRoute(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAlongRoute(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.1'. Comment: 'Use \"coordiateSystem\" and \"relativeDistanceType\"'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ALONG_ROUTE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCoordinateSystem: public IAttributeParser, public XmlParserBase + { + public: + AttributeCoordinateSystem(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CoordinateSystem::GetFromLiteral(attributeValue); + if (kResult != CoordinateSystem::UNKNOWN) + { + typedObject->SetCoordinateSystem(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CoordinateSystem::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CoordinateSystem::GetDeprecatedVersion(kResult) +"'. " + CoordinateSystem::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__COORDINATE_SYSTEM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFreespace: public IAttributeParser, public XmlParserBase + { + public: + AttributeFreespace(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetFreespace(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FREESPACE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRelativeDistanceType: public IAttributeParser, public XmlParserBase + { + public: + AttributeRelativeDistanceType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RelativeDistanceType::GetFromLiteral(attributeValue); + if (kResult != RelativeDistanceType::UNKNOWN) + { + typedObject->SetRelativeDistanceType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RelativeDistanceType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RelativeDistanceType::GetDeprecatedVersion(kResult) +"'. " + RelativeDistanceType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RELATIVE_DISTANCE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRoutingAlgorithm: public IAttributeParser, public XmlParserBase + { + public: + AttributeRoutingAlgorithm(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RoutingAlgorithm::GetFromLiteral(attributeValue); + if (kResult != RoutingAlgorithm::UNKNOWN) + { + typedObject->SetRoutingAlgorithm(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RoutingAlgorithm::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RoutingAlgorithm::GetDeprecatedVersion(kResult) +"'. " + RoutingAlgorithm::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROUTING_ALGORITHM, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TimeToCollisionConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::SubElementTimeToCollisionConditionTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _timeToCollisionConditionTargetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto timeToCollisionConditionTarget = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + timeToCollisionConditionTarget->SetParent(object); + _timeToCollisionConditionTargetXmlParser->ParseElement(indexedElement, parserContext, timeToCollisionConditionTarget); + + typedObject->SetTimeToCollisionConditionTarget(timeToCollisionConditionTarget); + + + } + + int TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::GetMinOccur() + { + return 1; + } + + int TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::GetMaxOccur() + { + return 1; + } + + bool TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET ; + } + + std::vector TimeToCollisionConditionXmlParser::SubElementTimeToCollisionConditionTargetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TIME_TO_COLLISION_CONDITION_TARGET + }; + } + + TimeToCollisionConditionXmlParser::TimeToCollisionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeToCollisionConditionTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimeToCollisionConditionTargetXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TimeToCollisionConditionTargetXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TimeToCollisionConditionTargetXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector TimeToCollisionConditionTargetXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRef->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRef); + + typedObject->SetEntityRef(entityRef); + + + } + + int TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::GetMinOccur() + { + return 1; + } + + int TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::GetMaxOccur() + { + return 1; + } + + bool TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector TimeToCollisionConditionTargetXmlParser::SubElementEntityRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + + TimeToCollisionConditionTargetXmlParser::TimeToCollisionConditionTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimingImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TimingXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TimingXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDomainAbsoluteRelative: public IAttributeParser, public XmlParserBase + { + public: + AttributeDomainAbsoluteRelative(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ReferenceContext::GetFromLiteral(attributeValue); + if (kResult != ReferenceContext::UNKNOWN) + { + typedObject->SetDomainAbsoluteRelative(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ReferenceContext::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ReferenceContext::GetDeprecatedVersion(kResult) +"'. " + ReferenceContext::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DOMAIN_ABSOLUTE_RELATIVE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeScale: public IAttributeParser, public XmlParserBase + { + public: + AttributeScale(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SCALE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SCALE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetScale(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SCALE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SCALE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SCALE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TimingXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TimingXmlParser::TimingXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTrafficName: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrafficName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTrafficName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficActionXmlParser::SubElementTrafficSourceActionParser::SubElementTrafficSourceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSourceActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficActionXmlParser::SubElementTrafficSourceActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSourceAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSourceAction->SetParent(object); + _trafficSourceActionXmlParser->ParseElement(indexedElement, parserContext, trafficSourceAction); + + typedObject->SetTrafficSourceAction(trafficSourceAction); + + + } + + int TrafficActionXmlParser::SubElementTrafficSourceActionParser::GetMinOccur() + { + return 1; + } + + int TrafficActionXmlParser::SubElementTrafficSourceActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficActionXmlParser::SubElementTrafficSourceActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION ; + } + + std::vector TrafficActionXmlParser::SubElementTrafficSourceActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SOURCE_ACTION + }; + } + TrafficActionXmlParser::SubElementTrafficSinkActionParser::SubElementTrafficSinkActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSinkActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficActionXmlParser::SubElementTrafficSinkActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSinkAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSinkAction->SetParent(object); + _trafficSinkActionXmlParser->ParseElement(indexedElement, parserContext, trafficSinkAction); + + typedObject->SetTrafficSinkAction(trafficSinkAction); + + + } + + int TrafficActionXmlParser::SubElementTrafficSinkActionParser::GetMinOccur() + { + return 1; + } + + int TrafficActionXmlParser::SubElementTrafficSinkActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficActionXmlParser::SubElementTrafficSinkActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION ; + } + + std::vector TrafficActionXmlParser::SubElementTrafficSinkActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SINK_ACTION + }; + } + TrafficActionXmlParser::SubElementTrafficSwarmActionParser::SubElementTrafficSwarmActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSwarmActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficActionXmlParser::SubElementTrafficSwarmActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSwarmAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSwarmAction->SetParent(object); + _trafficSwarmActionXmlParser->ParseElement(indexedElement, parserContext, trafficSwarmAction); + + typedObject->SetTrafficSwarmAction(trafficSwarmAction); + + + } + + int TrafficActionXmlParser::SubElementTrafficSwarmActionParser::GetMinOccur() + { + return 1; + } + + int TrafficActionXmlParser::SubElementTrafficSwarmActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficActionXmlParser::SubElementTrafficSwarmActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION ; + } + + std::vector TrafficActionXmlParser::SubElementTrafficSwarmActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SWARM_ACTION + }; + } + TrafficActionXmlParser::SubElementTrafficAreaActionParser::SubElementTrafficAreaActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficAreaActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficActionXmlParser::SubElementTrafficAreaActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficAreaAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficAreaAction->SetParent(object); + _trafficAreaActionXmlParser->ParseElement(indexedElement, parserContext, trafficAreaAction); + + typedObject->SetTrafficAreaAction(trafficAreaAction); + + + } + + int TrafficActionXmlParser::SubElementTrafficAreaActionParser::GetMinOccur() + { + return 1; + } + + int TrafficActionXmlParser::SubElementTrafficAreaActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficActionXmlParser::SubElementTrafficAreaActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION ; + } + + std::vector TrafficActionXmlParser::SubElementTrafficAreaActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA_ACTION + }; + } + TrafficActionXmlParser::SubElementTrafficStopActionParser::SubElementTrafficStopActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficStopActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficActionXmlParser::SubElementTrafficStopActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficStopAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficStopAction->SetParent(object); + _trafficStopActionXmlParser->ParseElement(indexedElement, parserContext, trafficStopAction); + + typedObject->SetTrafficStopAction(trafficStopAction); + + + } + + int TrafficActionXmlParser::SubElementTrafficStopActionParser::GetMinOccur() + { + return 1; + } + + int TrafficActionXmlParser::SubElementTrafficStopActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficActionXmlParser::SubElementTrafficStopActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION ; + } + + std::vector TrafficActionXmlParser::SubElementTrafficStopActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_STOP_ACTION + }; + } + + TrafficActionXmlParser::TrafficActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficAreaImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficAreaXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficAreaXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrafficAreaXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficAreaXmlParser::SubElementPolygonParser::SubElementPolygonParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _polygonXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficAreaXmlParser::SubElementPolygonParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto polygon = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + polygon->SetParent(object); + _polygonXmlParser->ParseElement(indexedElement, parserContext, polygon); + + typedObject->SetPolygon(polygon); + + + } + + int TrafficAreaXmlParser::SubElementPolygonParser::GetMinOccur() + { + return 1; + } + + int TrafficAreaXmlParser::SubElementPolygonParser::GetMaxOccur() + { + return 1; + } + + bool TrafficAreaXmlParser::SubElementPolygonParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POLYGON ; + } + + std::vector TrafficAreaXmlParser::SubElementPolygonParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POLYGON + }; + } + TrafficAreaXmlParser::SubElementRoadRangeParser::SubElementRoadRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _roadRangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficAreaXmlParser::SubElementRoadRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto roadRange = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + roadRange->SetParent(object); + _roadRangeXmlParser->ParseElement(indexedElement, parserContext, roadRange); + auto roadRangeList = typedObject->GetWriterRoadRange(); + roadRangeList.push_back(roadRange); + typedObject->SetRoadRange(roadRangeList); + + + } + + int TrafficAreaXmlParser::SubElementRoadRangeParser::GetMinOccur() + { + return 1; + } + + int TrafficAreaXmlParser::SubElementRoadRangeParser::GetMaxOccur() + { + return -1; + } + + bool TrafficAreaXmlParser::SubElementRoadRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ROAD_RANGE ; + } + + std::vector TrafficAreaXmlParser::SubElementRoadRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ROAD_RANGE + }; + } + + TrafficAreaXmlParser::TrafficAreaXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficAreaActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficAreaActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficAreaActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeContinuous: public IAttributeParser, public XmlParserBase + { + public: + AttributeContinuous(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetContinuous(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CONTINUOUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeNumberOfEntities: public IAttributeParser, public XmlParserBase + { + public: + AttributeNumberOfEntities(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetNumberOfEntities(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_ENTITIES, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficAreaActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDistribution->SetParent(object); + _trafficDistributionXmlParser->ParseElement(indexedElement, parserContext, trafficDistribution); + + typedObject->SetTrafficDistribution(trafficDistribution); + + + } + + int TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::GetMinOccur() + { + return 1; + } + + int TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION ; + } + + std::vector TrafficAreaActionXmlParser::SubElementTrafficDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION + }; + } + TrafficAreaActionXmlParser::SubElementTrafficAreaParser::SubElementTrafficAreaParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficAreaXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficAreaActionXmlParser::SubElementTrafficAreaParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficArea = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficArea->SetParent(object); + _trafficAreaXmlParser->ParseElement(indexedElement, parserContext, trafficArea); + + typedObject->SetTrafficArea(trafficArea); + + + } + + int TrafficAreaActionXmlParser::SubElementTrafficAreaParser::GetMinOccur() + { + return 1; + } + + int TrafficAreaActionXmlParser::SubElementTrafficAreaParser::GetMaxOccur() + { + return 1; + } + + bool TrafficAreaActionXmlParser::SubElementTrafficAreaParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA ; + } + + std::vector TrafficAreaActionXmlParser::SubElementTrafficAreaParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_AREA + }; + } + + TrafficAreaActionXmlParser::TrafficAreaActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficDefinitionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficDefinitionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficDefinitionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::SubElementVehicleCategoryDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleCategoryDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleCategoryDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleCategoryDistribution->SetParent(object); + _vehicleCategoryDistributionXmlParser->ParseElement(indexedElement, parserContext, vehicleCategoryDistribution); + + typedObject->SetVehicleCategoryDistribution(vehicleCategoryDistribution); + + + } + + int TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::GetMinOccur() + { + return 1; + } + + int TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION ; + } + + std::vector TrafficDefinitionXmlParser::SubElementVehicleCategoryDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION + }; + } + TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::SubElementVehicleRoleDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleRoleDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleRoleDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleRoleDistribution->SetParent(object); + _vehicleRoleDistributionXmlParser->ParseElement(indexedElement, parserContext, vehicleRoleDistribution); + + typedObject->SetVehicleRoleDistribution(vehicleRoleDistribution); + + + } + + int TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::GetMinOccur() + { + return 0; + } + + int TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION ; + } + + std::vector TrafficDefinitionXmlParser::SubElementVehicleRoleDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION + }; + } + TrafficDefinitionXmlParser::SubElementControllerDistributionParser::SubElementControllerDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _controllerDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDefinitionXmlParser::SubElementControllerDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto controllerDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + controllerDistribution->SetParent(object); + _controllerDistributionXmlParser->ParseElement(indexedElement, parserContext, controllerDistribution); + + typedObject->SetControllerDistribution(controllerDistribution); + + + } + + int TrafficDefinitionXmlParser::SubElementControllerDistributionParser::GetMinOccur() + { + return 1; + } + + int TrafficDefinitionXmlParser::SubElementControllerDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficDefinitionXmlParser::SubElementControllerDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION ; + } + + std::vector TrafficDefinitionXmlParser::SubElementControllerDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONTROLLER_DISTRIBUTION + }; + } + + TrafficDefinitionXmlParser::TrafficDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrafficDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::SubElementTrafficDistributionEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDistributionEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDistributionEntry = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDistributionEntry->SetParent(object); + _trafficDistributionEntryXmlParser->ParseElement(indexedElement, parserContext, trafficDistributionEntry); + auto trafficDistributionEntryList = typedObject->GetWriterTrafficDistributionEntry(); + trafficDistributionEntryList.push_back(trafficDistributionEntry); + typedObject->SetTrafficDistributionEntry(trafficDistributionEntryList); + + + } + + int TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::GetMinOccur() + { + return 1; + } + + int TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::GetMaxOccur() + { + return -1; + } + + bool TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY ; + } + + std::vector TrafficDistributionXmlParser::SubElementTrafficDistributionEntryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION_ENTRY + }; + } + + TrafficDistributionXmlParser::TrafficDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficDistributionEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficDistributionEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficDistributionEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::SubElementEntityDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityDistribution->SetParent(object); + _entityDistributionXmlParser->ParseElement(indexedElement, parserContext, entityDistribution); + + typedObject->SetEntityDistribution(entityDistribution); + + + } + + int TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::GetMinOccur() + { + return 1; + } + + int TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION ; + } + + std::vector TrafficDistributionEntryXmlParser::SubElementEntityDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_DISTRIBUTION + }; + } + TrafficDistributionEntryXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficDistributionEntryXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int TrafficDistributionEntryXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int TrafficDistributionEntryXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool TrafficDistributionEntryXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector TrafficDistributionEntryXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + + TrafficDistributionEntryXmlParser::TrafficDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficSignalActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrafficSignalActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::SubElementTrafficSignalControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalControllerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalControllerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalControllerAction->SetParent(object); + _trafficSignalControllerActionXmlParser->ParseElement(indexedElement, parserContext, trafficSignalControllerAction); + + typedObject->SetTrafficSignalControllerAction(trafficSignalControllerAction); + + + } + + int TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::GetMinOccur() + { + return 1; + } + + int TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION ; + } + + std::vector TrafficSignalActionXmlParser::SubElementTrafficSignalControllerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_CONTROLLER_ACTION + }; + } + TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::SubElementTrafficSignalStateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficSignalStateActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficSignalStateAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficSignalStateAction->SetParent(object); + _trafficSignalStateActionXmlParser->ParseElement(indexedElement, parserContext, trafficSignalStateAction); + + typedObject->SetTrafficSignalStateAction(trafficSignalStateAction); + + + } + + int TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::GetMinOccur() + { + return 1; + } + + int TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION ; + } + + std::vector TrafficSignalActionXmlParser::SubElementTrafficSignalStateActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_SIGNAL_STATE_ACTION + }; + } + + TrafficSignalActionXmlParser::TrafficSignalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetState(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalConditionXmlParser::TrafficSignalConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalControllerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalControllerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDelay: public IAttributeParser, public XmlParserBase + { + public: + AttributeDelay(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DELAY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDelay(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DELAY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeReference: public IAttributeParser, public XmlParserBase + { + public: + AttributeReference(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetReference(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__REFERENCE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalControllerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficSignalControllerXmlParser::SubElementPhasesParser::SubElementPhasesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _phaseXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSignalControllerXmlParser::SubElementPhasesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto phases = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + phases->SetParent(object); + _phaseXmlParser->ParseElement(indexedElement, parserContext, phases); + auto phasesList = typedObject->GetWriterPhases(); + phasesList.push_back(phases); + typedObject->SetPhases(phasesList); + + + } + + int TrafficSignalControllerXmlParser::SubElementPhasesParser::GetMinOccur() + { + return 0; + } + + int TrafficSignalControllerXmlParser::SubElementPhasesParser::GetMaxOccur() + { + return -1; + } + + bool TrafficSignalControllerXmlParser::SubElementPhasesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PHASE ; + } + + std::vector TrafficSignalControllerXmlParser::SubElementPhasesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PHASE + }; + } + + TrafficSignalControllerXmlParser::TrafficSignalControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalControllerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalControllerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributePhase: public IAttributeParser, public XmlParserBase + { + public: + AttributePhase(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPhase(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTrafficSignalControllerRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrafficSignalControllerRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetTrafficSignalControllerRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalControllerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalControllerActionXmlParser::TrafficSignalControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalControllerConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalControllerConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributePhase: public IAttributeParser, public XmlParserBase + { + public: + AttributePhase(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__PHASE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetPhase(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__PHASE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTrafficSignalControllerRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrafficSignalControllerRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetTrafficSignalControllerRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_CONTROLLER_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalControllerConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalControllerConditionXmlParser::TrafficSignalControllerConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalGroupStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalGroupStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalGroupStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetState(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalGroupStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalGroupStateXmlParser::TrafficSignalGroupStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalStateXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalStateXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetState(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTrafficSignalId: public IAttributeParser, public XmlParserBase + { + public: + AttributeTrafficSignalId(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTrafficSignalId(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC_SIGNAL_ID, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalStateXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalStateXmlParser::TrafficSignalStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalStateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSignalStateActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficSignalStateActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeState: public IAttributeParser, public XmlParserBase + { + public: + AttributeState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetState(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSignalStateActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficSignalStateActionXmlParser::TrafficSignalStateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSinkActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSinkActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficSinkActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRadius: public IAttributeParser, public XmlParserBase + { + public: + AttributeRadius(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRadius(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSinkActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficSinkActionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSinkActionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int TrafficSinkActionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int TrafficSinkActionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSinkActionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector TrafficSinkActionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDefinition->SetParent(object); + _trafficDefinitionXmlParser->ParseElement(indexedElement, parserContext, trafficDefinition); + + typedObject->SetTrafficDefinition(trafficDefinition); + + + if (!_trafficDefinitionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version 'n/a'. Comment: 'n/a'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _trafficDefinitionXmlParser->_filename)); + _trafficDefinitionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::GetMinOccur() + { + return 0; + } + + int TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION ; + } + + std::vector TrafficSinkActionXmlParser::SubElementTrafficDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION + }; + } + + TrafficSinkActionXmlParser::TrafficSinkActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSourceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSourceActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficSourceActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRadius: public IAttributeParser, public XmlParserBase + { + public: + AttributeRadius(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RADIUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRadius(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RADIUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRate: public IAttributeParser, public XmlParserBase + { + public: + AttributeRate(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetRate(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSpeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSpeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVelocity: public IAttributeParser, public XmlParserBase + { + public: + AttributeVelocity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVelocity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use speed instead'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSourceActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficSourceActionXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSourceActionXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int TrafficSourceActionXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int TrafficSourceActionXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSourceActionXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector TrafficSourceActionXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDefinition->SetParent(object); + _trafficDefinitionXmlParser->ParseElement(indexedElement, parserContext, trafficDefinition); + + typedObject->SetTrafficDefinition(trafficDefinition); + + + if (!_trafficDefinitionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.3'. Comment: 'Use trafficDistribution instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _trafficDefinitionXmlParser->_filename)); + _trafficDefinitionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::GetMinOccur() + { + return 0; + } + + int TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION ; + } + + std::vector TrafficSourceActionXmlParser::SubElementTrafficDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION + }; + } + TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDistribution->SetParent(object); + _trafficDistributionXmlParser->ParseElement(indexedElement, parserContext, trafficDistribution); + + typedObject->SetTrafficDistribution(trafficDistribution); + + + } + + int TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::GetMinOccur() + { + return 0; + } + + int TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION ; + } + + std::vector TrafficSourceActionXmlParser::SubElementTrafficDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION + }; + } + + TrafficSourceActionXmlParser::TrafficSourceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficStopActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficStopActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrafficStopActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrafficStopActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrafficStopActionXmlParser::TrafficStopActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSwarmActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrafficSwarmActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrafficSwarmActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeInnerRadius: public IAttributeParser, public XmlParserBase + { + public: + AttributeInnerRadius(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetInnerRadius(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__INNER_RADIUS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeNumberOfVehicles: public IAttributeParser, public XmlParserBase + { + public: + AttributeNumberOfVehicles(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype unsignedInt + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetNumberOfVehicles(ParseUnsignedInt(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NUMBER_OF_VEHICLES, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeOffset: public IAttributeParser, public XmlParserBase + { + public: + AttributeOffset(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__OFFSET, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetOffset(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__OFFSET, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSemiMajorAxis: public IAttributeParser, public XmlParserBase + { + public: + AttributeSemiMajorAxis(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSemiMajorAxis(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SEMI_MAJOR_AXIS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSemiMinorAxis: public IAttributeParser, public XmlParserBase + { + public: + AttributeSemiMinorAxis(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSemiMinorAxis(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SEMI_MINOR_AXIS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVelocity: public IAttributeParser, public XmlParserBase + { + public: + AttributeVelocity(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetVelocity(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use initialSpeedRange instead'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VELOCITY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrafficSwarmActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrafficSwarmActionXmlParser::SubElementCentralObjectParser::SubElementCentralObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _centralSwarmObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSwarmActionXmlParser::SubElementCentralObjectParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto centralObject = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + centralObject->SetParent(object); + _centralSwarmObjectXmlParser->ParseElement(indexedElement, parserContext, centralObject); + + typedObject->SetCentralObject(centralObject); + + + } + + int TrafficSwarmActionXmlParser::SubElementCentralObjectParser::GetMinOccur() + { + return 1; + } + + int TrafficSwarmActionXmlParser::SubElementCentralObjectParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSwarmActionXmlParser::SubElementCentralObjectParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CENTRAL_OBJECT ; + } + + std::vector TrafficSwarmActionXmlParser::SubElementCentralObjectParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CENTRAL_OBJECT + }; + } + TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDefinitionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDefinition = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDefinition->SetParent(object); + _trafficDefinitionXmlParser->ParseElement(indexedElement, parserContext, trafficDefinition); + + typedObject->SetTrafficDefinition(trafficDefinition); + + + if (!_trafficDefinitionXmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '1.3'. Comment: 'Use trafficDistribution instead.'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _trafficDefinitionXmlParser->_filename)); + _trafficDefinitionXmlParser->_messageLogger.LogMessage(msg); + } + } + + int TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::GetMinOccur() + { + return 0; + } + + int TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION ; + } + + std::vector TrafficSwarmActionXmlParser::SubElementTrafficDefinitionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DEFINITION + }; + } + TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trafficDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trafficDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trafficDistribution->SetParent(object); + _trafficDistributionXmlParser->ParseElement(indexedElement, parserContext, trafficDistribution); + + typedObject->SetTrafficDistribution(trafficDistribution); + + + } + + int TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::GetMinOccur() + { + return 0; + } + + int TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION ; + } + + std::vector TrafficSwarmActionXmlParser::SubElementTrafficDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAFFIC_DISTRIBUTION + }; + } + TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::SubElementInitialSpeedRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto initialSpeedRange = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + initialSpeedRange->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, initialSpeedRange); + + typedObject->SetInitialSpeedRange(initialSpeedRange); + + + } + + int TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::GetMinOccur() + { + return 0; + } + + int TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__INITIAL_SPEED_RANGE ; + } + + std::vector TrafficSwarmActionXmlParser::SubElementInitialSpeedRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__INITIAL_SPEED_RANGE + }; + } + TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::SubElementDirectionOfTravelDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directionOfTravelDistributionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directionOfTravelDistribution = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directionOfTravelDistribution->SetParent(object); + _directionOfTravelDistributionXmlParser->ParseElement(indexedElement, parserContext, directionOfTravelDistribution); + + typedObject->SetDirectionOfTravelDistribution(directionOfTravelDistribution); + + + } + + int TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::GetMinOccur() + { + return 0; + } + + int TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::GetMaxOccur() + { + return 1; + } + + bool TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTION_OF_TRAVEL_DISTRIBUTION ; + } + + std::vector TrafficSwarmActionXmlParser::SubElementDirectionOfTravelDistributionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTION_OF_TRAVEL_DISTRIBUTION + }; + } + + TrafficSwarmActionXmlParser::TrafficSwarmActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrailerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrailerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrailerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrailerXmlParser::SubElementTrailerParser::SubElementTrailerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _scenarioObjectXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrailerXmlParser::SubElementTrailerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailer = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailer->SetParent(object); + _scenarioObjectXmlParser->ParseElement(indexedElement, parserContext, trailer); + + typedObject->SetTrailer(trailer); + + + } + + int TrailerXmlParser::SubElementTrailerParser::GetMinOccur() + { + return 1; + } + + int TrailerXmlParser::SubElementTrailerParser::GetMaxOccur() + { + return 1; + } + + bool TrailerXmlParser::SubElementTrailerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER ; + } + + std::vector TrailerXmlParser::SubElementTrailerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER + }; + } + TrailerXmlParser::SubElementTrailerRefParser::SubElementTrailerRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrailerXmlParser::SubElementTrailerRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailerRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailerRef->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, trailerRef); + + typedObject->SetTrailerRef(trailerRef); + + + } + + int TrailerXmlParser::SubElementTrailerRefParser::GetMinOccur() + { + return 1; + } + + int TrailerXmlParser::SubElementTrailerRefParser::GetMaxOccur() + { + return 1; + } + + bool TrailerXmlParser::SubElementTrailerRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER_REF ; + } + + std::vector TrailerXmlParser::SubElementTrailerRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER_REF + }; + } + + TrailerXmlParser::TrailerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrailerActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrailerActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrailerActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrailerActionXmlParser::SubElementConnectTrailerActionParser::SubElementConnectTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _connectTrailerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrailerActionXmlParser::SubElementConnectTrailerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto connectTrailerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + connectTrailerAction->SetParent(object); + _connectTrailerActionXmlParser->ParseElement(indexedElement, parserContext, connectTrailerAction); + + typedObject->SetConnectTrailerAction(connectTrailerAction); + + + } + + int TrailerActionXmlParser::SubElementConnectTrailerActionParser::GetMinOccur() + { + return 1; + } + + int TrailerActionXmlParser::SubElementConnectTrailerActionParser::GetMaxOccur() + { + return 1; + } + + bool TrailerActionXmlParser::SubElementConnectTrailerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONNECT_TRAILER_ACTION ; + } + + std::vector TrailerActionXmlParser::SubElementConnectTrailerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONNECT_TRAILER_ACTION + }; + } + TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::SubElementDisconnectTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _disconnectTrailerActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto disconnectTrailerAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + disconnectTrailerAction->SetParent(object); + _disconnectTrailerActionXmlParser->ParseElement(indexedElement, parserContext, disconnectTrailerAction); + + typedObject->SetDisconnectTrailerAction(disconnectTrailerAction); + + + } + + int TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::GetMinOccur() + { + return 1; + } + + int TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::GetMaxOccur() + { + return 1; + } + + bool TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DISCONNECT_TRAILER_ACTION ; + } + + std::vector TrailerActionXmlParser::SubElementDisconnectTrailerActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DISCONNECT_TRAILER_ACTION + }; + } + + TrailerActionXmlParser::TrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerCouplerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrailerCouplerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrailerCouplerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDx: public IAttributeParser, public XmlParserBase + { + public: + AttributeDx(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDx(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDz: public IAttributeParser, public XmlParserBase + { + public: + AttributeDz(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDz(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrailerCouplerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrailerCouplerXmlParser::TrailerCouplerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerHitchImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrailerHitchXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrailerHitchXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDx: public IAttributeParser, public XmlParserBase + { + public: + AttributeDx(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DX, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDx(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DX, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDz: public IAttributeParser, public XmlParserBase + { + public: + AttributeDz(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DZ, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDz(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DZ, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrailerHitchXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrailerHitchXmlParser::TrailerHitchXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrajectoryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrajectoryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeClosed: public IAttributeParser, public XmlParserBase + { + public: + AttributeClosed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOSED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetClosed(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CLOSED, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrajectoryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrajectoryXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int TrajectoryXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int TrajectoryXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool TrajectoryXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector TrajectoryXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + TrajectoryXmlParser::SubElementShapeParser::SubElementShapeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _shapeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryXmlParser::SubElementShapeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto shape = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + shape->SetParent(object); + _shapeXmlParser->ParseElement(indexedElement, parserContext, shape); + + typedObject->SetShape(shape); + + + } + + int TrajectoryXmlParser::SubElementShapeParser::GetMinOccur() + { + return 1; + } + + int TrajectoryXmlParser::SubElementShapeParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryXmlParser::SubElementShapeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SHAPE ; + } + + std::vector TrajectoryXmlParser::SubElementShapeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SHAPE + }; + } + + TrajectoryXmlParser::TrajectoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrajectoryCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrajectoryCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrajectoryCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector TrajectoryCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + TrajectoryCatalogLocationXmlParser::TrajectoryCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryFollowingModeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrajectoryFollowingModeXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TrajectoryFollowingModeXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeFollowingMode: public IAttributeParser, public XmlParserBase + { + public: + AttributeFollowingMode(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(attributeValue); + if (kResult != FollowingMode::UNKNOWN) + { + typedObject->SetFollowingMode(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (FollowingMode::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + FollowingMode::GetDeprecatedVersion(kResult) +"'. " + FollowingMode::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrajectoryFollowingModeXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TrajectoryFollowingModeXmlParser::TrajectoryFollowingModeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrajectoryPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> TrajectoryPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeS: public IAttributeParser, public XmlParserBase + { + public: + AttributeS(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__S, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetS(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__S, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeT: public IAttributeParser, public XmlParserBase + { + public: + AttributeT(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__T, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetT(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__T, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TrajectoryPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrajectoryPositionXmlParser::SubElementOrientationParser::SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _orientationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryPositionXmlParser::SubElementOrientationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto orientation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + orientation->SetParent(object); + _orientationXmlParser->ParseElement(indexedElement, parserContext, orientation); + + typedObject->SetOrientation(orientation); + + + } + + int TrajectoryPositionXmlParser::SubElementOrientationParser::GetMinOccur() + { + return 0; + } + + int TrajectoryPositionXmlParser::SubElementOrientationParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryPositionXmlParser::SubElementOrientationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ORIENTATION ; + } + + std::vector TrajectoryPositionXmlParser::SubElementOrientationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ORIENTATION + }; + } + TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::SubElementTrajectoryRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectoryRef = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectoryRef->SetParent(object); + _trajectoryRefXmlParser->ParseElement(indexedElement, parserContext, trajectoryRef); + + typedObject->SetTrajectoryRef(trajectoryRef); + + + } + + int TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::GetMinOccur() + { + return 1; + } + + int TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF ; + } + + std::vector TrajectoryPositionXmlParser::SubElementTrajectoryRefParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY_REF + }; + } + + TrajectoryPositionXmlParser::TrajectoryPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TrajectoryRefXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> TrajectoryRefXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TrajectoryRefXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TrajectoryRefXmlParser::SubElementTrajectoryParser::SubElementTrajectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trajectoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryRefXmlParser::SubElementTrajectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trajectory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trajectory->SetParent(object); + _trajectoryXmlParser->ParseElement(indexedElement, parserContext, trajectory); + + typedObject->SetTrajectory(trajectory); + + + } + + int TrajectoryRefXmlParser::SubElementTrajectoryParser::GetMinOccur() + { + return 1; + } + + int TrajectoryRefXmlParser::SubElementTrajectoryParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryRefXmlParser::SubElementTrajectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAJECTORY ; + } + + std::vector TrajectoryRefXmlParser::SubElementTrajectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAJECTORY + }; + } + TrajectoryRefXmlParser::SubElementCatalogReferenceParser::SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _catalogReferenceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TrajectoryRefXmlParser::SubElementCatalogReferenceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto catalogReference = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + catalogReference->SetParent(object); + _catalogReferenceXmlParser->ParseElement(indexedElement, parserContext, catalogReference); + + typedObject->SetCatalogReference(catalogReference); + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast(catalogReference)); + + + } + + int TrajectoryRefXmlParser::SubElementCatalogReferenceParser::GetMinOccur() + { + return 1; + } + + int TrajectoryRefXmlParser::SubElementCatalogReferenceParser::GetMaxOccur() + { + return 1; + } + + bool TrajectoryRefXmlParser::SubElementCatalogReferenceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE ; + } + + std::vector TrajectoryRefXmlParser::SubElementCatalogReferenceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CATALOG_REFERENCE + }; + } + + TrajectoryRefXmlParser::TrajectoryRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TransitionDynamicsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TransitionDynamicsXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TransitionDynamicsXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDynamicsDimension: public IAttributeParser, public XmlParserBase + { + public: + AttributeDynamicsDimension(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DynamicsDimension::GetFromLiteral(attributeValue); + if (kResult != DynamicsDimension::UNKNOWN) + { + typedObject->SetDynamicsDimension(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DynamicsDimension::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DynamicsDimension::GetDeprecatedVersion(kResult) +"'. " + DynamicsDimension::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_DIMENSION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeDynamicsShape: public IAttributeParser, public XmlParserBase + { + public: + AttributeDynamicsShape(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = DynamicsShape::GetFromLiteral(attributeValue); + if (kResult != DynamicsShape::UNKNOWN) + { + typedObject->SetDynamicsShape(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (DynamicsShape::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + DynamicsShape::GetDeprecatedVersion(kResult) +"'. " + DynamicsShape::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DYNAMICS_SHAPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFollowingMode: public IAttributeParser, public XmlParserBase + { + public: + AttributeFollowingMode(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = FollowingMode::GetFromLiteral(attributeValue); + if (kResult != FollowingMode::UNKNOWN) + { + typedObject->SetFollowingMode(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (FollowingMode::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + FollowingMode::GetDeprecatedVersion(kResult) +"'. " + FollowingMode::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FOLLOWING_MODE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TransitionDynamicsXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TransitionDynamicsXmlParser::TransitionDynamicsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TraveledDistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TraveledDistanceConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TraveledDistanceConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TraveledDistanceConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + TraveledDistanceConditionXmlParser::TraveledDistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TriggerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TriggerXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TriggerXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> TriggerXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TriggerXmlParser::SubElementConditionGroupsParser::SubElementConditionGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _conditionGroupXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TriggerXmlParser::SubElementConditionGroupsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto conditionGroups = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + conditionGroups->SetParent(object); + _conditionGroupXmlParser->ParseElement(indexedElement, parserContext, conditionGroups); + auto conditionGroupsList = typedObject->GetWriterConditionGroups(); + conditionGroupsList.push_back(conditionGroups); + typedObject->SetConditionGroups(conditionGroupsList); + + + } + + int TriggerXmlParser::SubElementConditionGroupsParser::GetMinOccur() + { + return 0; + } + + int TriggerXmlParser::SubElementConditionGroupsParser::GetMaxOccur() + { + return -1; + } + + bool TriggerXmlParser::SubElementConditionGroupsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CONDITION_GROUP ; + } + + std::vector TriggerXmlParser::SubElementConditionGroupsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CONDITION_GROUP + }; + } + + TriggerXmlParser::TriggerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TriggeringEntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + TriggeringEntitiesXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> TriggeringEntitiesXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTriggeringEntitiesRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeTriggeringEntitiesRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = TriggeringEntitiesRule::GetFromLiteral(attributeValue); + if (kResult != TriggeringEntitiesRule::UNKNOWN) + { + typedObject->SetTriggeringEntitiesRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (TriggeringEntitiesRule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + TriggeringEntitiesRule::GetDeprecatedVersion(kResult) +"'. " + TriggeringEntitiesRule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRIGGERING_ENTITIES_RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> TriggeringEntitiesXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + TriggeringEntitiesXmlParser::SubElementEntityRefsParser::SubElementEntityRefsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _entityRefXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void TriggeringEntitiesXmlParser::SubElementEntityRefsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto entityRefs = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + entityRefs->SetParent(object); + _entityRefXmlParser->ParseElement(indexedElement, parserContext, entityRefs); + auto entityRefsList = typedObject->GetWriterEntityRefs(); + entityRefsList.push_back(entityRefs); + typedObject->SetEntityRefs(entityRefsList); + + + } + + int TriggeringEntitiesXmlParser::SubElementEntityRefsParser::GetMinOccur() + { + return 1; + } + + int TriggeringEntitiesXmlParser::SubElementEntityRefsParser::GetMaxOccur() + { + return -1; + } + + bool TriggeringEntitiesXmlParser::SubElementEntityRefsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ENTITY_REF ; + } + + std::vector TriggeringEntitiesXmlParser::SubElementEntityRefsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ENTITY_REF + }; + } + + TriggeringEntitiesXmlParser::TriggeringEntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UniformDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UniformDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UniformDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> UniformDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + UniformDistributionXmlParser::SubElementRangeParser::SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _rangeXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void UniformDistributionXmlParser::SubElementRangeParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto range = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + range->SetParent(object); + _rangeXmlParser->ParseElement(indexedElement, parserContext, range); + + typedObject->SetRange(range); + + + } + + int UniformDistributionXmlParser::SubElementRangeParser::GetMinOccur() + { + return 1; + } + + int UniformDistributionXmlParser::SubElementRangeParser::GetMaxOccur() + { + return 1; + } + + bool UniformDistributionXmlParser::SubElementRangeParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RANGE ; + } + + std::vector UniformDistributionXmlParser::SubElementRangeParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RANGE + }; + } + + UniformDistributionXmlParser::UniformDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UsedAreaImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UsedAreaXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UsedAreaXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> UsedAreaXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + UsedAreaXmlParser::SubElementPositionsParser::SubElementPositionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void UsedAreaXmlParser::SubElementPositionsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto positions = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + positions->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, positions); + auto positionsList = typedObject->GetWriterPositions(); + positionsList.push_back(positions); + typedObject->SetPositions(positionsList); + + + } + + int UsedAreaXmlParser::SubElementPositionsParser::GetMinOccur() + { + return 2; + } + + int UsedAreaXmlParser::SubElementPositionsParser::GetMaxOccur() + { + return -1; + } + + bool UsedAreaXmlParser::SubElementPositionsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector UsedAreaXmlParser::SubElementPositionsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + UsedAreaXmlParser::UsedAreaXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UserDefinedActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UserDefinedActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> UserDefinedActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + UserDefinedActionXmlParser::SubElementCustomCommandActionParser::SubElementCustomCommandActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _customCommandActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void UserDefinedActionXmlParser::SubElementCustomCommandActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto customCommandAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + customCommandAction->SetParent(object); + _customCommandActionXmlParser->ParseElement(indexedElement, parserContext, customCommandAction); + + typedObject->SetCustomCommandAction(customCommandAction); + + + } + + int UserDefinedActionXmlParser::SubElementCustomCommandActionParser::GetMinOccur() + { + return 1; + } + + int UserDefinedActionXmlParser::SubElementCustomCommandActionParser::GetMaxOccur() + { + return 1; + } + + bool UserDefinedActionXmlParser::SubElementCustomCommandActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__CUSTOM_COMMAND_ACTION ; + } + + std::vector UserDefinedActionXmlParser::SubElementCustomCommandActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__CUSTOM_COMMAND_ACTION + }; + } + + UserDefinedActionXmlParser::UserDefinedActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UserDefinedAnimationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UserDefinedAnimationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeUserDefinedAnimationType: public IAttributeParser, public XmlParserBase + { + public: + AttributeUserDefinedAnimationType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetUserDefinedAnimationType(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_ANIMATION_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> UserDefinedAnimationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + UserDefinedAnimationXmlParser::UserDefinedAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedComponentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UserDefinedComponentXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UserDefinedComponentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeUserDefinedComponentType: public IAttributeParser, public XmlParserBase + { + public: + AttributeUserDefinedComponentType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetUserDefinedComponentType(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_COMPONENT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> UserDefinedComponentXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + UserDefinedComponentXmlParser::UserDefinedComponentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + bool UserDefinedDistributionXmlParser::IsContentRequired() + { + return false; + } + + std::map> UserDefinedDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeType: public IAttributeParser, public XmlParserBase + { + public: + AttributeType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetType(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + void UserDefinedDistributionXmlParser::SetContentProperty(const std::string content, std::shared_ptr object) + { + auto typedObject = std::static_pointer_cast(object); + typedObject->SetContent(content); + } + + UserDefinedDistributionXmlParser::UserDefinedDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlSimpleContentParser(messageLogger, filename, parserOptions) {} + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedLightImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UserDefinedLightXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UserDefinedLightXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeUserDefinedLightType: public IAttributeParser, public XmlParserBase + { + public: + AttributeUserDefinedLightType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetUserDefinedLightType(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__USER_DEFINED_LIGHT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> UserDefinedLightXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + UserDefinedLightXmlParser::UserDefinedLightXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedValueConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + UserDefinedValueConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> UserDefinedValueConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> UserDefinedValueConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + UserDefinedValueConditionXmlParser::UserDefinedValueConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueConstraintImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ValueConstraintXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> ValueConstraintXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> ValueConstraintXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + ValueConstraintXmlParser::ValueConstraintXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueConstraintGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ValueConstraintGroupXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ValueConstraintGroupXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ValueConstraintGroupXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ValueConstraintGroupXmlParser::SubElementConstraintsParser::SubElementConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _valueConstraintXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ValueConstraintGroupXmlParser::SubElementConstraintsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto constraints = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + constraints->SetParent(object); + _valueConstraintXmlParser->ParseElement(indexedElement, parserContext, constraints); + auto constraintsList = typedObject->GetWriterConstraints(); + constraintsList.push_back(constraints); + typedObject->SetConstraints(constraintsList); + + + } + + int ValueConstraintGroupXmlParser::SubElementConstraintsParser::GetMinOccur() + { + return 1; + } + + int ValueConstraintGroupXmlParser::SubElementConstraintsParser::GetMaxOccur() + { + return -1; + } + + bool ValueConstraintGroupXmlParser::SubElementConstraintsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VALUE_CONSTRAINT ; + } + + std::vector ValueConstraintGroupXmlParser::SubElementConstraintsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VALUE_CONSTRAINT + }; + } + + ValueConstraintGroupXmlParser::ValueConstraintGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueSetDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + ValueSetDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> ValueSetDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> ValueSetDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::SubElementParameterValueSetsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterValueSetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterValueSets = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterValueSets->SetParent(object); + _parameterValueSetXmlParser->ParseElement(indexedElement, parserContext, parameterValueSets); + auto parameterValueSetsList = typedObject->GetWriterParameterValueSets(); + parameterValueSetsList.push_back(parameterValueSets); + typedObject->SetParameterValueSets(parameterValueSetsList); + + + } + + int ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::GetMinOccur() + { + return 1; + } + + int ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::GetMaxOccur() + { + return -1; + } + + bool ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_SET ; + } + + std::vector ValueSetDistributionXmlParser::SubElementParameterValueSetsParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PARAMETER_VALUE_SET + }; + } + + ValueSetDistributionXmlParser::ValueSetDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> VariableActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeVariableRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeVariableRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetVariableRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VariableActionXmlParser::SubElementSetActionParser::SubElementSetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableSetActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VariableActionXmlParser::SubElementSetActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto setAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + setAction->SetParent(object); + _variableSetActionXmlParser->ParseElement(indexedElement, parserContext, setAction); + + typedObject->SetSetAction(setAction); + + + } + + int VariableActionXmlParser::SubElementSetActionParser::GetMinOccur() + { + return 1; + } + + int VariableActionXmlParser::SubElementSetActionParser::GetMaxOccur() + { + return 1; + } + + bool VariableActionXmlParser::SubElementSetActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SET_ACTION ; + } + + std::vector VariableActionXmlParser::SubElementSetActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SET_ACTION + }; + } + VariableActionXmlParser::SubElementModifyActionParser::SubElementModifyActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableModifyActionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VariableActionXmlParser::SubElementModifyActionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto modifyAction = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + modifyAction->SetParent(object); + _variableModifyActionXmlParser->ParseElement(indexedElement, parserContext, modifyAction); + + typedObject->SetModifyAction(modifyAction); + + + } + + int VariableActionXmlParser::SubElementModifyActionParser::GetMinOccur() + { + return 1; + } + + int VariableActionXmlParser::SubElementModifyActionParser::GetMaxOccur() + { + return 1; + } + + bool VariableActionXmlParser::SubElementModifyActionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MODIFY_ACTION ; + } + + std::vector VariableActionXmlParser::SubElementModifyActionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MODIFY_ACTION + }; + } + + VariableActionXmlParser::VariableActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableAddValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableAddValueRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VariableAddValueRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableAddValueRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VariableAddValueRuleXmlParser::VariableAddValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableConditionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VariableConditionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRule: public IAttributeParser, public XmlParserBase + { + public: + AttributeRule(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__RULE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Rule::GetFromLiteral(attributeValue); + if (kResult != Rule::UNKNOWN) + { + typedObject->SetRule(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Rule::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Rule::GetDeprecatedVersion(kResult) +"'. " + Rule::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__RULE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVariableRef: public IAttributeParser, public XmlParserBase + { + public: + AttributeVariableRef(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Proxy + auto proxy = std::make_shared>(attributeValue); + proxy->SetParent(typedObject); + typedObject->SetVariableRef(proxy); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableConditionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VariableConditionXmlParser::VariableConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableDeclarationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VariableDeclarationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVariableType: public IAttributeParser, public XmlParserBase + { + public: + AttributeVariableType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = ParameterType::GetFromLiteral(attributeValue); + if (kResult != ParameterType::UNKNOWN) + { + typedObject->SetVariableType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (ParameterType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + ParameterType::GetDeprecatedVersion(kResult) +"'. " + ParameterType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableDeclarationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VariableDeclarationXmlParser::VariableDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableModifyActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableModifyActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> VariableModifyActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> VariableModifyActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VariableModifyActionXmlParser::SubElementRuleParser::SubElementRuleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableModifyRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VariableModifyActionXmlParser::SubElementRuleParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto rule = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + rule->SetParent(object); + _variableModifyRuleXmlParser->ParseElement(indexedElement, parserContext, rule); + + typedObject->SetRule(rule); + + + } + + int VariableModifyActionXmlParser::SubElementRuleParser::GetMinOccur() + { + return 1; + } + + int VariableModifyActionXmlParser::SubElementRuleParser::GetMaxOccur() + { + return 1; + } + + bool VariableModifyActionXmlParser::SubElementRuleParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__RULE ; + } + + std::vector VariableModifyActionXmlParser::SubElementRuleParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__RULE + }; + } + + VariableModifyActionXmlParser::VariableModifyActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableModifyRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableModifyRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + + std::map> VariableModifyRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> VariableModifyRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VariableModifyRuleXmlParser::SubElementAddValueParser::SubElementAddValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableAddValueRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VariableModifyRuleXmlParser::SubElementAddValueParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto addValue = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + addValue->SetParent(object); + _variableAddValueRuleXmlParser->ParseElement(indexedElement, parserContext, addValue); + + typedObject->SetAddValue(addValue); + + + } + + int VariableModifyRuleXmlParser::SubElementAddValueParser::GetMinOccur() + { + return 1; + } + + int VariableModifyRuleXmlParser::SubElementAddValueParser::GetMaxOccur() + { + return 1; + } + + bool VariableModifyRuleXmlParser::SubElementAddValueParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__ADD_VALUE ; + } + + std::vector VariableModifyRuleXmlParser::SubElementAddValueParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__ADD_VALUE + }; + } + VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::SubElementMultiplyByValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _variableMultiplyByValueRuleXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto multiplyByValue = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + multiplyByValue->SetParent(object); + _variableMultiplyByValueRuleXmlParser->ParseElement(indexedElement, parserContext, multiplyByValue); + + typedObject->SetMultiplyByValue(multiplyByValue); + + + } + + int VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::GetMinOccur() + { + return 1; + } + + int VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::GetMaxOccur() + { + return 1; + } + + bool VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE ; + } + + std::vector VariableModifyRuleXmlParser::SubElementMultiplyByValueParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__MULTIPLY_BY_VALUE + }; + } + + VariableModifyRuleXmlParser::VariableModifyRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableMultiplyByValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableMultiplyByValueRuleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VariableMultiplyByValueRuleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableMultiplyByValueRuleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VariableMultiplyByValueRuleXmlParser::VariableMultiplyByValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableSetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VariableSetActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VariableSetActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeValue: public IAttributeParser, public XmlParserBase + { + public: + AttributeValue(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VALUE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetValue(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VALUE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VariableSetActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VariableSetActionXmlParser::VariableSetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> VehicleXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeMass: public IAttributeParser, public XmlParserBase + { + public: + AttributeMass(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MASS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetMass(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MASS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeModel3d: public IAttributeParser, public XmlParserBase + { + public: + AttributeModel3d(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetModel3d(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__MODEL3D, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeName: public IAttributeParser, public XmlParserBase + { + public: + AttributeName(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype string + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__NAME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetName(ParseString(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__NAME, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeRole: public IAttributeParser, public XmlParserBase + { + public: + AttributeRole(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Role::GetFromLiteral(attributeValue); + if (kResult != Role::UNKNOWN) + { + typedObject->SetRole(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Role::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Role::GetDeprecatedVersion(kResult) +"'. " + Role::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeVehicleCategory: public IAttributeParser, public XmlParserBase + { + public: + AttributeVehicleCategory(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = VehicleCategory::GetFromLiteral(attributeValue); + if (kResult != VehicleCategory::UNKNOWN) + { + typedObject->SetVehicleCategory(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (VehicleCategory::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + VehicleCategory::GetDeprecatedVersion(kResult) +"'. " + VehicleCategory::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_CATEGORY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VehicleXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, std::make_shared(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATIONS, _parserOptions) ); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VehicleXmlParser::SubElementParameterDeclarationsParser::SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _parameterDeclarationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementParameterDeclarationsParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto parameterDeclarations = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + parameterDeclarations->SetParent(object); + _parameterDeclarationXmlParser->ParseElement(indexedElement, parserContext, parameterDeclarations); + auto parameterDeclarationsList = typedObject->GetWriterParameterDeclarations(); + parameterDeclarationsList.push_back(parameterDeclarations); + typedObject->SetParameterDeclarations(parameterDeclarationsList); + + + } + + int VehicleXmlParser::SubElementParameterDeclarationsParser::GetMinOccur() + { + return 0; + } + + int VehicleXmlParser::SubElementParameterDeclarationsParser::GetMaxOccur() + { + return -1; + } + + bool VehicleXmlParser::SubElementParameterDeclarationsParser::DoesMatch(std::string& elementName) + { + return elementName == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION; + } + + std::vector VehicleXmlParser::SubElementParameterDeclarationsParser::GetExpectedTagNames() + { + return {OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION}; + } + VehicleXmlParser::SubElementBoundingBoxParser::SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _boundingBoxXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementBoundingBoxParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto boundingBox = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + boundingBox->SetParent(object); + _boundingBoxXmlParser->ParseElement(indexedElement, parserContext, boundingBox); + + typedObject->SetBoundingBox(boundingBox); + + + } + + int VehicleXmlParser::SubElementBoundingBoxParser::GetMinOccur() + { + return 1; + } + + int VehicleXmlParser::SubElementBoundingBoxParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementBoundingBoxParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__BOUNDING_BOX ; + } + + std::vector VehicleXmlParser::SubElementBoundingBoxParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__BOUNDING_BOX + }; + } + VehicleXmlParser::SubElementPerformanceParser::SubElementPerformanceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _performanceXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementPerformanceParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto performance = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + performance->SetParent(object); + _performanceXmlParser->ParseElement(indexedElement, parserContext, performance); + + typedObject->SetPerformance(performance); + + + } + + int VehicleXmlParser::SubElementPerformanceParser::GetMinOccur() + { + return 1; + } + + int VehicleXmlParser::SubElementPerformanceParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementPerformanceParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PERFORMANCE ; + } + + std::vector VehicleXmlParser::SubElementPerformanceParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PERFORMANCE + }; + } + VehicleXmlParser::SubElementAxlesParser::SubElementAxlesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _axlesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementAxlesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto axles = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + axles->SetParent(object); + _axlesXmlParser->ParseElement(indexedElement, parserContext, axles); + + typedObject->SetAxles(axles); + + + } + + int VehicleXmlParser::SubElementAxlesParser::GetMinOccur() + { + return 1; + } + + int VehicleXmlParser::SubElementAxlesParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementAxlesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__AXLES ; + } + + std::vector VehicleXmlParser::SubElementAxlesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__AXLES + }; + } + VehicleXmlParser::SubElementPropertiesParser::SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _propertiesXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementPropertiesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto properties = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + properties->SetParent(object); + _propertiesXmlParser->ParseElement(indexedElement, parserContext, properties); + + typedObject->SetProperties(properties); + + + } + + int VehicleXmlParser::SubElementPropertiesParser::GetMinOccur() + { + return 0; + } + + int VehicleXmlParser::SubElementPropertiesParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementPropertiesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PROPERTIES ; + } + + std::vector VehicleXmlParser::SubElementPropertiesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PROPERTIES + }; + } + VehicleXmlParser::SubElementTrailerHitchParser::SubElementTrailerHitchParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trailerHitchXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementTrailerHitchParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailerHitch = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailerHitch->SetParent(object); + _trailerHitchXmlParser->ParseElement(indexedElement, parserContext, trailerHitch); + + typedObject->SetTrailerHitch(trailerHitch); + + + } + + int VehicleXmlParser::SubElementTrailerHitchParser::GetMinOccur() + { + return 0; + } + + int VehicleXmlParser::SubElementTrailerHitchParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementTrailerHitchParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER_HITCH ; + } + + std::vector VehicleXmlParser::SubElementTrailerHitchParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER_HITCH + }; + } + VehicleXmlParser::SubElementTrailerCouplerParser::SubElementTrailerCouplerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trailerCouplerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementTrailerCouplerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailerCoupler = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailerCoupler->SetParent(object); + _trailerCouplerXmlParser->ParseElement(indexedElement, parserContext, trailerCoupler); + + typedObject->SetTrailerCoupler(trailerCoupler); + + + } + + int VehicleXmlParser::SubElementTrailerCouplerParser::GetMinOccur() + { + return 0; + } + + int VehicleXmlParser::SubElementTrailerCouplerParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementTrailerCouplerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER_COUPLER ; + } + + std::vector VehicleXmlParser::SubElementTrailerCouplerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER_COUPLER + }; + } + VehicleXmlParser::SubElementTrailerParser::SubElementTrailerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _trailerXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleXmlParser::SubElementTrailerParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto trailer = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + trailer->SetParent(object); + _trailerXmlParser->ParseElement(indexedElement, parserContext, trailer); + + typedObject->SetTrailer(trailer); + + + } + + int VehicleXmlParser::SubElementTrailerParser::GetMinOccur() + { + return 0; + } + + int VehicleXmlParser::SubElementTrailerParser::GetMaxOccur() + { + return 1; + } + + bool VehicleXmlParser::SubElementTrailerParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__TRAILER ; + } + + std::vector VehicleXmlParser::SubElementTrailerParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__TRAILER + }; + } + + VehicleXmlParser::VehicleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleCatalogLocationXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> VehicleCatalogLocationXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> VehicleCatalogLocationXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VehicleCatalogLocationXmlParser::SubElementDirectoryParser::SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _directoryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleCatalogLocationXmlParser::SubElementDirectoryParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto directory = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + directory->SetParent(object); + _directoryXmlParser->ParseElement(indexedElement, parserContext, directory); + + typedObject->SetDirectory(directory); + + + } + + int VehicleCatalogLocationXmlParser::SubElementDirectoryParser::GetMinOccur() + { + return 1; + } + + int VehicleCatalogLocationXmlParser::SubElementDirectoryParser::GetMaxOccur() + { + return 1; + } + + bool VehicleCatalogLocationXmlParser::SubElementDirectoryParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DIRECTORY ; + } + + std::vector VehicleCatalogLocationXmlParser::SubElementDirectoryParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DIRECTORY + }; + } + + VehicleCatalogLocationXmlParser::VehicleCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCategoryDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleCategoryDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleCategoryDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> VehicleCategoryDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::SubElementVehicleCategoryDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleCategoryDistributionEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleCategoryDistributionEntries = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleCategoryDistributionEntries->SetParent(object); + _vehicleCategoryDistributionEntryXmlParser->ParseElement(indexedElement, parserContext, vehicleCategoryDistributionEntries); + auto vehicleCategoryDistributionEntriesList = typedObject->GetWriterVehicleCategoryDistributionEntries(); + vehicleCategoryDistributionEntriesList.push_back(vehicleCategoryDistributionEntries); + typedObject->SetVehicleCategoryDistributionEntries(vehicleCategoryDistributionEntriesList); + + + } + + int VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::GetMinOccur() + { + return 1; + } + + int VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::GetMaxOccur() + { + return -1; + } + + bool VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY ; + } + + std::vector VehicleCategoryDistributionXmlParser::SubElementVehicleCategoryDistributionEntriesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_CATEGORY_DISTRIBUTION_ENTRY + }; + } + + VehicleCategoryDistributionXmlParser::VehicleCategoryDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCategoryDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleCategoryDistributionEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleCategoryDistributionEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeCategory: public IAttributeParser, public XmlParserBase + { + public: + AttributeCategory(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = VehicleCategory::GetFromLiteral(attributeValue); + if (kResult != VehicleCategory::UNKNOWN) + { + typedObject->SetCategory(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (VehicleCategory::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + VehicleCategory::GetDeprecatedVersion(kResult) +"'. " + VehicleCategory::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CATEGORY, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VehicleCategoryDistributionEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VehicleCategoryDistributionEntryXmlParser::VehicleCategoryDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleComponentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleComponentXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleComponentXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeVehicleComponentType: public IAttributeParser, public XmlParserBase + { + public: + AttributeVehicleComponentType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = VehicleComponentType::GetFromLiteral(attributeValue); + if (kResult != VehicleComponentType::UNKNOWN) + { + typedObject->SetVehicleComponentType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (VehicleComponentType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + VehicleComponentType::GetDeprecatedVersion(kResult) +"'. " + VehicleComponentType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_COMPONENT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VehicleComponentXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VehicleComponentXmlParser::VehicleComponentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleLightImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleLightXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleLightXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeVehicleLightType: public IAttributeParser, public XmlParserBase + { + public: + AttributeVehicleLightType(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = VehicleLightType::GetFromLiteral(attributeValue); + if (kResult != VehicleLightType::UNKNOWN) + { + typedObject->SetVehicleLightType(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (VehicleLightType::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + VehicleLightType::GetDeprecatedVersion(kResult) +"'. " + VehicleLightType::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__VEHICLE_LIGHT_TYPE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VehicleLightXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VehicleLightXmlParser::VehicleLightXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleRoleDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleRoleDistributionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleRoleDistributionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + return result; + } + + std::vector> VehicleRoleDistributionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::SubElementVehicleRoleDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _vehicleRoleDistributionEntryXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto vehicleRoleDistributionEntries = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + vehicleRoleDistributionEntries->SetParent(object); + _vehicleRoleDistributionEntryXmlParser->ParseElement(indexedElement, parserContext, vehicleRoleDistributionEntries); + auto vehicleRoleDistributionEntriesList = typedObject->GetWriterVehicleRoleDistributionEntries(); + vehicleRoleDistributionEntriesList.push_back(vehicleRoleDistributionEntries); + typedObject->SetVehicleRoleDistributionEntries(vehicleRoleDistributionEntriesList); + + + } + + int VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::GetMinOccur() + { + return 1; + } + + int VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::GetMaxOccur() + { + return -1; + } + + bool VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY ; + } + + std::vector VehicleRoleDistributionXmlParser::SubElementVehicleRoleDistributionEntriesParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__VEHICLE_ROLE_DISTRIBUTION_ENTRY + }; + } + + VehicleRoleDistributionXmlParser::VehicleRoleDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleRoleDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VehicleRoleDistributionEntryXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VehicleRoleDistributionEntryXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRole: public IAttributeParser, public XmlParserBase + { + public: + AttributeRole(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROLE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = Role::GetFromLiteral(attributeValue); + if (kResult != Role::UNKNOWN) + { + typedObject->SetRole(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (Role::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + Role::GetDeprecatedVersion(kResult) +"'. " + Role::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROLE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeWeight: public IAttributeParser, public XmlParserBase + { + public: + AttributeWeight(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetWeight(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__WEIGHT, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VehicleRoleDistributionEntryXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + VehicleRoleDistributionEntryXmlParser::VehicleRoleDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VertexImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VertexXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VertexXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeTime: public IAttributeParser, public XmlParserBase + { + public: + AttributeTime(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TIME, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTime(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TIME, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VertexXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VertexXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VertexXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int VertexXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int VertexXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool VertexXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector VertexXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + VertexXmlParser::VertexXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VisibilityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + VisibilityActionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> VisibilityActionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeGraphics: public IAttributeParser, public XmlParserBase + { + public: + AttributeGraphics(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetGraphics(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__GRAPHICS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSensors: public IAttributeParser, public XmlParserBase + { + public: + AttributeSensors(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SENSORS, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSensors(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SENSORS, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SENSORS, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SENSORS, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTraffic: public IAttributeParser, public XmlParserBase + { + public: + AttributeTraffic(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTraffic(ParseBoolean(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TRAFFIC, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> VisibilityActionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + VisibilityActionXmlParser::SubElementSensorReferenceSetParser::SubElementSensorReferenceSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _sensorReferenceSetXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void VisibilityActionXmlParser::SubElementSensorReferenceSetParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto sensorReferenceSet = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + sensorReferenceSet->SetParent(object); + _sensorReferenceSetXmlParser->ParseElement(indexedElement, parserContext, sensorReferenceSet); + + typedObject->SetSensorReferenceSet(sensorReferenceSet); + + + } + + int VisibilityActionXmlParser::SubElementSensorReferenceSetParser::GetMinOccur() + { + return 0; + } + + int VisibilityActionXmlParser::SubElementSensorReferenceSetParser::GetMaxOccur() + { + return 1; + } + + bool VisibilityActionXmlParser::SubElementSensorReferenceSetParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE_SET ; + } + + std::vector VisibilityActionXmlParser::SubElementSensorReferenceSetParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SENSOR_REFERENCE_SET + }; + } + + VisibilityActionXmlParser::VisibilityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WaypointImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + WaypointXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> WaypointXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeRouteStrategy: public IAttributeParser, public XmlParserBase + { + public: + AttributeRouteStrategy(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = RouteStrategy::GetFromLiteral(attributeValue); + if (kResult != RouteStrategy::UNKNOWN) + { + typedObject->SetRouteStrategy(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (RouteStrategy::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + RouteStrategy::GetDeprecatedVersion(kResult) +"'. " + RouteStrategy::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ROUTE_STRATEGY, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> WaypointXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + WaypointXmlParser::SubElementPositionParser::SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _positionXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WaypointXmlParser::SubElementPositionParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto position = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + position->SetParent(object); + _positionXmlParser->ParseElement(indexedElement, parserContext, position); + + typedObject->SetPosition(position); + + + } + + int WaypointXmlParser::SubElementPositionParser::GetMinOccur() + { + return 1; + } + + int WaypointXmlParser::SubElementPositionParser::GetMaxOccur() + { + return 1; + } + + bool WaypointXmlParser::SubElementPositionParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__POSITION ; + } + + std::vector WaypointXmlParser::SubElementPositionParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__POSITION + }; + } + + WaypointXmlParser::WaypointXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WeatherImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + WeatherXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + + std::map> WeatherXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeAtmosphericPressure: public IAttributeParser, public XmlParserBase + { + public: + AttributeAtmosphericPressure(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetAtmosphericPressure(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__ATMOSPHERIC_PRESSURE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeCloudState: public IAttributeParser, public XmlParserBase + { + public: + AttributeCloudState(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = CloudState::GetFromLiteral(attributeValue); + if (kResult != CloudState::UNKNOWN) + { + typedObject->SetCloudState(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (CloudState::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + CloudState::GetDeprecatedVersion(kResult) +"'. " + CloudState::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, std::make_shared(endMarker)); + + + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '1.2'. Comment: 'Use fractionalCloudCover instead'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__CLOUD_STATE, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeFractionalCloudCover: public IAttributeParser, public XmlParserBase + { + public: + AttributeFractionalCloudCover(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Enumeration Type + const auto kResult = FractionalCloudCover::GetFromLiteral(attributeValue); + if (kResult != FractionalCloudCover::UNKNOWN) + { + typedObject->SetFractionalCloudCover(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (FractionalCloudCover::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + FractionalCloudCover::GetDeprecatedVersion(kResult) +"'. " + FractionalCloudCover::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__FRACTIONAL_CLOUD_COVER, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeTemperature: public IAttributeParser, public XmlParserBase + { + public: + AttributeTemperature(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetTemperature(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__TEMPERATURE, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> WeatherXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + result.push_back(std::make_shared(_messageLogger, _filename, _parserOptions)); + return result; + } + + WeatherXmlParser::SubElementSunParser::SubElementSunParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _sunXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WeatherXmlParser::SubElementSunParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto sun = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + sun->SetParent(object); + _sunXmlParser->ParseElement(indexedElement, parserContext, sun); + + typedObject->SetSun(sun); + + + } + + int WeatherXmlParser::SubElementSunParser::GetMinOccur() + { + return 0; + } + + int WeatherXmlParser::SubElementSunParser::GetMaxOccur() + { + return 1; + } + + bool WeatherXmlParser::SubElementSunParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__SUN ; + } + + std::vector WeatherXmlParser::SubElementSunParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__SUN + }; + } + WeatherXmlParser::SubElementFogParser::SubElementFogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _fogXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WeatherXmlParser::SubElementFogParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto fog = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + fog->SetParent(object); + _fogXmlParser->ParseElement(indexedElement, parserContext, fog); + + typedObject->SetFog(fog); + + + } + + int WeatherXmlParser::SubElementFogParser::GetMinOccur() + { + return 0; + } + + int WeatherXmlParser::SubElementFogParser::GetMaxOccur() + { + return 1; + } + + bool WeatherXmlParser::SubElementFogParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__FOG ; + } + + std::vector WeatherXmlParser::SubElementFogParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__FOG + }; + } + WeatherXmlParser::SubElementPrecipitationParser::SubElementPrecipitationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _precipitationXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WeatherXmlParser::SubElementPrecipitationParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto precipitation = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + precipitation->SetParent(object); + _precipitationXmlParser->ParseElement(indexedElement, parserContext, precipitation); + + typedObject->SetPrecipitation(precipitation); + + + } + + int WeatherXmlParser::SubElementPrecipitationParser::GetMinOccur() + { + return 0; + } + + int WeatherXmlParser::SubElementPrecipitationParser::GetMaxOccur() + { + return 1; + } + + bool WeatherXmlParser::SubElementPrecipitationParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__PRECIPITATION ; + } + + std::vector WeatherXmlParser::SubElementPrecipitationParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__PRECIPITATION + }; + } + WeatherXmlParser::SubElementWindParser::SubElementWindParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _windXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WeatherXmlParser::SubElementWindParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto wind = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + wind->SetParent(object); + _windXmlParser->ParseElement(indexedElement, parserContext, wind); + + typedObject->SetWind(wind); + + + } + + int WeatherXmlParser::SubElementWindParser::GetMinOccur() + { + return 0; + } + + int WeatherXmlParser::SubElementWindParser::GetMaxOccur() + { + return 1; + } + + bool WeatherXmlParser::SubElementWindParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__WIND ; + } + + std::vector WeatherXmlParser::SubElementWindParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__WIND + }; + } + WeatherXmlParser::SubElementDomeImageParser::SubElementDomeImageParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _domeImageXmlParser = std::make_shared(messageLogger, filename, parserOptions); + } + + void WeatherXmlParser::SubElementDomeImageParser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto domeImage = std::make_shared(); + auto typedObject = std::static_pointer_cast(object); + // Setting the parent + domeImage->SetParent(object); + _domeImageXmlParser->ParseElement(indexedElement, parserContext, domeImage); + + typedObject->SetDomeImage(domeImage); + + + } + + int WeatherXmlParser::SubElementDomeImageParser::GetMinOccur() + { + return 0; + } + + int WeatherXmlParser::SubElementDomeImageParser::GetMaxOccur() + { + return 1; + } + + bool WeatherXmlParser::SubElementDomeImageParser::DoesMatch(std::string& elementName) + { + return + elementName == OSC_CONSTANTS::ELEMENT__DOME_IMAGE ; + } + + std::vector WeatherXmlParser::SubElementDomeImageParser::GetExpectedTagNames() + { + return { + OSC_CONSTANTS::ELEMENT__DOME_IMAGE + }; + } + + WeatherXmlParser::WeatherXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WindImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + WindXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> WindXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeDirection: public IAttributeParser, public XmlParserBase + { + public: + AttributeDirection(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetDirection(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__DIRECTION, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeSpeed: public IAttributeParser, public XmlParserBase + { + public: + AttributeSpeed(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__SPEED, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetSpeed(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__SPEED, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> WindXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + WindXmlParser::WindXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WorldPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + WorldPositionXmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + + std::map> WorldPositionXmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + class AttributeH: public IAttributeParser, public XmlParserBase + { + public: + AttributeH(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__H, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetH(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__H, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeP: public IAttributeParser, public XmlParserBase + { + public: + AttributeP(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__P, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetP(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__P, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeR: public IAttributeParser, public XmlParserBase + { + public: + AttributeR(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__R, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetR(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__R, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeX: public IAttributeParser, public XmlParserBase + { + public: + AttributeX(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__X, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetX(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__X, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeY: public IAttributeParser, public XmlParserBase + { + public: + AttributeY(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Y, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetY(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 1; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__Y, std::make_shared(_messageLogger, _filename, _parserOptions))); + class AttributeZ: public IAttributeParser, public XmlParserBase + { + public: + AttributeZ(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast(object); + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, attributeValue, startValueMarker); + } + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype double + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__Z, attributeValue, startValueMarker); + } + else + { + + // Parse value + // Simple type + typedObject->SetZ(ParseDouble(attributeValue, startMarker)); + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(endMarker)); + + + } + + int GetMinOccur() override + { + return 0; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__Z, std::make_shared(_messageLogger, _filename, _parserOptions))); + return result; + } + + std::vector> WorldPositionXmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + return result; + } + + + WorldPositionXmlParser::WorldPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + + + + } +} diff --git a/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsersV1_3.h b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsersV1_3.h new file mode 100644 index 00000000..474ed7ee --- /dev/null +++ b/cpp/openScenarioLib/generated/v1_3/xmlParser/XmlParsersV1_3.h @@ -0,0 +1,23229 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IParserMessageLogger.h" +#include "OscConstantsV1_3.h" +#include "IndexedElement.h" +#include "ParserContext.h" +#include "BaseImpl.h" +#include +#include "ApiClassImplV1_3.h" +#include "XmlAllParser.h" +#include "XmlChoiceParser.h" +#include "XmlSequenceParser.h" +#include +#include "XmlComplexTypeParser.h" +#include "XmlGroupParser.h" +#include "XmlSimpleContentParser.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class AbsoluteSpeedXmlParser; + class AbsoluteTargetLaneXmlParser; + class AbsoluteTargetLaneOffsetXmlParser; + class AbsoluteTargetSpeedXmlParser; + class AccelerationConditionXmlParser; + class AcquirePositionActionXmlParser; + class ActXmlParser; + class ActionXmlParser; + class ActivateControllerActionXmlParser; + class ActorsXmlParser; + class AddEntityActionXmlParser; + class AngleConditionXmlParser; + class AnimationActionXmlParser; + class AnimationFileXmlParser; + class AnimationStateXmlParser; + class AnimationTypeXmlParser; + class AppearanceActionXmlParser; + class AssignControllerActionXmlParser; + class AssignRouteActionXmlParser; + class AutomaticGearXmlParser; + class AxleXmlParser; + class AxlesXmlParser; + class BoundingBoxXmlParser; + class BrakeXmlParser; + class BrakeInputXmlParser; + class ByEntityConditionXmlParser; + class ByObjectTypeXmlParser; + class ByTypeXmlParser; + class ByValueConditionXmlParser; + class CatalogXmlParser; + class CatalogDefinitionXmlParser; + class CatalogLocationsXmlParser; + class CatalogReferenceXmlParser; + class CenterXmlParser; + class CentralSwarmObjectXmlParser; + class ClothoidXmlParser; + class ClothoidSplineXmlParser; + class ClothoidSplineSegmentXmlParser; + class CollisionConditionXmlParser; + class ColorXmlParser; + class ColorCmykXmlParser; + class ColorRgbXmlParser; + class ComponentAnimationXmlParser; + class ConditionXmlParser; + class ConditionGroupXmlParser; + class ConnectTrailerActionXmlParser; + class ControlPointXmlParser; + class ControllerXmlParser; + class ControllerActionXmlParser; + class ControllerCatalogLocationXmlParser; + class ControllerDistributionXmlParser; + class ControllerDistributionEntryXmlParser; + class CustomCommandActionXmlParser; + class CustomContentXmlParser; + class DeleteEntityActionXmlParser; + class DeterministicXmlParser; + class DeterministicMultiParameterDistributionXmlParser; + class DeterministicMultiParameterDistributionTypeXmlParser; + class DeterministicParameterDistributionXmlParser; + class DeterministicSingleParameterDistributionXmlParser; + class DeterministicSingleParameterDistributionTypeXmlParser; + class DimensionsXmlParser; + class DirectionOfTravelDistributionXmlParser; + class DirectoryXmlParser; + class DisconnectTrailerActionXmlParser; + class DistanceConditionXmlParser; + class DistributionDefinitionXmlParser; + class DistributionRangeXmlParser; + class DistributionSetXmlParser; + class DistributionSetElementXmlParser; + class DomeImageXmlParser; + class DynamicConstraintsXmlParser; + class EndOfRoadConditionXmlParser; + class EntitiesXmlParser; + class EntityActionXmlParser; + class EntityConditionXmlParser; + class EntityDistributionXmlParser; + class EntityDistributionEntryXmlParser; + class EntityObjectXmlParser; + class EntityRefXmlParser; + class EntitySelectionXmlParser; + class EnvironmentXmlParser; + class EnvironmentActionXmlParser; + class EnvironmentCatalogLocationXmlParser; + class EventXmlParser; + class ExternalObjectReferenceXmlParser; + class FileXmlParser; + class FileHeaderXmlParser; + class FinalSpeedXmlParser; + class FogXmlParser; + class FollowTrajectoryActionXmlParser; + class GearXmlParser; + class GeoPositionXmlParser; + class GlobalActionXmlParser; + class HistogramXmlParser; + class HistogramBinXmlParser; + class InRoutePositionXmlParser; + class InfrastructureActionXmlParser; + class InitXmlParser; + class InitActionsXmlParser; + class KnotXmlParser; + class LaneXmlParser; + class LaneChangeActionXmlParser; + class LaneChangeTargetXmlParser; + class LaneOffsetActionXmlParser; + class LaneOffsetActionDynamicsXmlParser; + class LaneOffsetTargetXmlParser; + class LanePositionXmlParser; + class LateralActionXmlParser; + class LateralDistanceActionXmlParser; + class LicenseXmlParser; + class LightStateXmlParser; + class LightStateActionXmlParser; + class LightTypeXmlParser; + class LogNormalDistributionXmlParser; + class LongitudinalActionXmlParser; + class LongitudinalDistanceActionXmlParser; + class ManeuverXmlParser; + class ManeuverCatalogLocationXmlParser; + class ManeuverGroupXmlParser; + class ManualGearXmlParser; + class MiscObjectXmlParser; + class MiscObjectCatalogLocationXmlParser; + class ModifyRuleXmlParser; + class MonitorDeclarationXmlParser; + class NoneXmlParser; + class NormalDistributionXmlParser; + class NurbsXmlParser; + class ObjectControllerXmlParser; + class OffroadConditionXmlParser; + class OpenScenarioXmlParser; + class OpenScenarioCategoryXmlParser; + class OrientationXmlParser; + class OverrideBrakeActionXmlParser; + class OverrideClutchActionXmlParser; + class OverrideControllerValueActionXmlParser; + class OverrideGearActionXmlParser; + class OverrideParkingBrakeActionXmlParser; + class OverrideSteeringWheelActionXmlParser; + class OverrideThrottleActionXmlParser; + class ParameterActionXmlParser; + class ParameterAddValueRuleXmlParser; + class ParameterAssignmentXmlParser; + class ParameterConditionXmlParser; + class ParameterDeclarationXmlParser; + class ParameterModifyActionXmlParser; + class ParameterMultiplyByValueRuleXmlParser; + class ParameterSetActionXmlParser; + class ParameterValueDistributionXmlParser; + class ParameterValueDistributionDefinitionXmlParser; + class ParameterValueSetXmlParser; + class PedestrianXmlParser; + class PedestrianAnimationXmlParser; + class PedestrianCatalogLocationXmlParser; + class PedestrianGestureXmlParser; + class PerformanceXmlParser; + class PhaseXmlParser; + class PoissonDistributionXmlParser; + class PolygonXmlParser; + class PolylineXmlParser; + class PositionXmlParser; + class PositionInLaneCoordinatesXmlParser; + class PositionInRoadCoordinatesXmlParser; + class PositionOfCurrentEntityXmlParser; + class PrecipitationXmlParser; + class PrivateXmlParser; + class PrivateActionXmlParser; + class ProbabilityDistributionSetXmlParser; + class ProbabilityDistributionSetElementXmlParser; + class PropertiesXmlParser; + class PropertyXmlParser; + class RandomRouteActionXmlParser; + class RangeXmlParser; + class ReachPositionConditionXmlParser; + class RelativeAngleConditionXmlParser; + class RelativeClearanceConditionXmlParser; + class RelativeDistanceConditionXmlParser; + class RelativeLanePositionXmlParser; + class RelativeLaneRangeXmlParser; + class RelativeObjectPositionXmlParser; + class RelativeRoadPositionXmlParser; + class RelativeSpeedConditionXmlParser; + class RelativeSpeedToMasterXmlParser; + class RelativeTargetLaneXmlParser; + class RelativeTargetLaneOffsetXmlParser; + class RelativeTargetSpeedXmlParser; + class RelativeWorldPositionXmlParser; + class RoadConditionXmlParser; + class RoadCursorXmlParser; + class RoadNetworkXmlParser; + class RoadPositionXmlParser; + class RoadRangeXmlParser; + class RouteXmlParser; + class RouteCatalogLocationXmlParser; + class RoutePositionXmlParser; + class RouteRefXmlParser; + class RoutingActionXmlParser; + class ScenarioDefinitionXmlParser; + class ScenarioObjectXmlParser; + class ScenarioObjectTemplateXmlParser; + class SelectedEntitiesXmlParser; + class SensorReferenceXmlParser; + class SensorReferenceSetXmlParser; + class SetMonitorActionXmlParser; + class ShapeXmlParser; + class SimulationTimeConditionXmlParser; + class SpeedActionXmlParser; + class SpeedActionTargetXmlParser; + class SpeedConditionXmlParser; + class SpeedProfileActionXmlParser; + class SpeedProfileEntryXmlParser; + class StandStillConditionXmlParser; + class SteadyStateXmlParser; + class StochasticXmlParser; + class StochasticDistributionXmlParser; + class StochasticDistributionTypeXmlParser; + class StoryXmlParser; + class StoryboardXmlParser; + class StoryboardElementStateConditionXmlParser; + class SunXmlParser; + class SynchronizeActionXmlParser; + class TargetDistanceSteadyStateXmlParser; + class TargetTimeSteadyStateXmlParser; + class TeleportActionXmlParser; + class TimeHeadwayConditionXmlParser; + class TimeOfDayXmlParser; + class TimeOfDayConditionXmlParser; + class TimeReferenceXmlParser; + class TimeToCollisionConditionXmlParser; + class TimeToCollisionConditionTargetXmlParser; + class TimingXmlParser; + class TrafficActionXmlParser; + class TrafficAreaXmlParser; + class TrafficAreaActionXmlParser; + class TrafficDefinitionXmlParser; + class TrafficDistributionXmlParser; + class TrafficDistributionEntryXmlParser; + class TrafficSignalActionXmlParser; + class TrafficSignalConditionXmlParser; + class TrafficSignalControllerXmlParser; + class TrafficSignalControllerActionXmlParser; + class TrafficSignalControllerConditionXmlParser; + class TrafficSignalGroupStateXmlParser; + class TrafficSignalStateXmlParser; + class TrafficSignalStateActionXmlParser; + class TrafficSinkActionXmlParser; + class TrafficSourceActionXmlParser; + class TrafficStopActionXmlParser; + class TrafficSwarmActionXmlParser; + class TrailerXmlParser; + class TrailerActionXmlParser; + class TrailerCouplerXmlParser; + class TrailerHitchXmlParser; + class TrajectoryXmlParser; + class TrajectoryCatalogLocationXmlParser; + class TrajectoryFollowingModeXmlParser; + class TrajectoryPositionXmlParser; + class TrajectoryRefXmlParser; + class TransitionDynamicsXmlParser; + class TraveledDistanceConditionXmlParser; + class TriggerXmlParser; + class TriggeringEntitiesXmlParser; + class UniformDistributionXmlParser; + class UsedAreaXmlParser; + class UserDefinedActionXmlParser; + class UserDefinedAnimationXmlParser; + class UserDefinedComponentXmlParser; + class UserDefinedDistributionXmlParser; + class UserDefinedLightXmlParser; + class UserDefinedValueConditionXmlParser; + class ValueConstraintXmlParser; + class ValueConstraintGroupXmlParser; + class ValueSetDistributionXmlParser; + class VariableActionXmlParser; + class VariableAddValueRuleXmlParser; + class VariableConditionXmlParser; + class VariableDeclarationXmlParser; + class VariableModifyActionXmlParser; + class VariableModifyRuleXmlParser; + class VariableMultiplyByValueRuleXmlParser; + class VariableSetActionXmlParser; + class VehicleXmlParser; + class VehicleCatalogLocationXmlParser; + class VehicleCategoryDistributionXmlParser; + class VehicleCategoryDistributionEntryXmlParser; + class VehicleComponentXmlParser; + class VehicleLightXmlParser; + class VehicleRoleDistributionXmlParser; + class VehicleRoleDistributionEntryXmlParser; + class VertexXmlParser; + class VisibilityActionXmlParser; + class WaypointXmlParser; + class WeatherXmlParser; + class WindXmlParser; + class WorldPositionXmlParser; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteSpeedXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement steadyState + */ + class SubElementSteadyStateParser: public IElementParser + { + private: + std::shared_ptr _steadyStateXmlParser; + + public: + /** + * Constructor + */ + SubElementSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AbsoluteSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetLaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AbsoluteTargetLaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetLaneOffsetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetLaneOffsetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AbsoluteTargetLaneOffsetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AbsoluteTargetSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AbsoluteTargetSpeedXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AbsoluteTargetSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AccelerationConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AccelerationConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AccelerationConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AcquirePositionActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AcquirePositionActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AcquirePositionActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement maneuverGroups + */ + class SubElementManeuverGroupsParser: public IElementParser + { + private: + std::shared_ptr _maneuverGroupXmlParser; + + public: + /** + * Constructor + */ + SubElementManeuverGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement startTrigger + */ + class SubElementStartTriggerParser: public IElementParser + { + private: + std::shared_ptr _triggerXmlParser; + + public: + /** + * Constructor + */ + SubElementStartTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement stopTrigger + */ + class SubElementStopTriggerParser: public IElementParser + { + private: + std::shared_ptr _triggerXmlParser; + + public: + /** + * Constructor + */ + SubElementStopTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ActXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement globalAction + */ + class SubElementGlobalActionParser: public IElementParser + { + private: + std::shared_ptr _globalActionXmlParser; + + public: + /** + * Constructor + */ + SubElementGlobalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedAction + */ + class SubElementUserDefinedActionParser: public IElementParser + { + private: + std::shared_ptr _userDefinedActionXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement privateAction + */ + class SubElementPrivateActionParser: public IElementParser + { + private: + std::shared_ptr _privateActionXmlParser; + + public: + /** + * Constructor + */ + SubElementPrivateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActivateControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActivateControllerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ActivateControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ActorsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ActorsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityRefs + */ + class SubElementEntityRefsParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ActorsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AddEntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AddEntityActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AddEntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AngleConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AngleConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AngleConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement animationType + */ + class SubElementAnimationTypeParser: public IElementParser + { + private: + std::shared_ptr _animationTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementAnimationTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement animationState + */ + class SubElementAnimationStateParser: public IElementParser + { + private: + std::shared_ptr _animationStateXmlParser; + + public: + /** + * Constructor + */ + SubElementAnimationStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AnimationActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationFileImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationFileXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement file + */ + class SubElementFileParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AnimationFileXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AnimationStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AnimationTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AnimationTypeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement componentAnimation + */ + class SubElementComponentAnimationParser: public IElementParser + { + private: + std::shared_ptr _componentAnimationXmlParser; + + public: + /** + * Constructor + */ + SubElementComponentAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement pedestrianAnimation + */ + class SubElementPedestrianAnimationParser: public IElementParser + { + private: + std::shared_ptr _pedestrianAnimationXmlParser; + + public: + /** + * Constructor + */ + SubElementPedestrianAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement animationFile + */ + class SubElementAnimationFileParser: public IElementParser + { + private: + std::shared_ptr _animationFileXmlParser; + + public: + /** + * Constructor + */ + SubElementAnimationFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedAnimation + */ + class SubElementUserDefinedAnimationParser: public IElementParser + { + private: + std::shared_ptr _userDefinedAnimationXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedAnimationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AnimationTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AppearanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AppearanceActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement lightStateAction + */ + class SubElementLightStateActionParser: public IElementParser + { + private: + std::shared_ptr _lightStateActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLightStateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement animationAction + */ + class SubElementAnimationActionParser: public IElementParser + { + private: + std::shared_ptr _animationActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAnimationActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AppearanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AssignControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignControllerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement controller + */ + class SubElementControllerParser: public IElementParser + { + private: + std::shared_ptr _controllerXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement objectController + */ + class SubElementObjectControllerParser: public IElementParser + { + private: + std::shared_ptr _objectControllerXmlParser; + + public: + /** + * Constructor + */ + SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AssignControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AssignRouteActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AssignRouteActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement route + */ + class SubElementRouteParser: public IElementParser + { + private: + std::shared_ptr _routeXmlParser; + + public: + /** + * Constructor + */ + SubElementRouteParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AssignRouteActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AutomaticGearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AutomaticGearXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AutomaticGearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AxleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AxleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a AxlesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class AxlesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement frontAxle + */ + class SubElementFrontAxleParser: public IElementParser + { + private: + std::shared_ptr _axleXmlParser; + + public: + /** + * Constructor + */ + SubElementFrontAxleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement rearAxle + */ + class SubElementRearAxleParser: public IElementParser + { + private: + std::shared_ptr _axleXmlParser; + + public: + /** + * Constructor + */ + SubElementRearAxleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement additionalAxles + */ + class SubElementAdditionalAxlesParser: public IElementParser + { + private: + std::shared_ptr _axleXmlParser; + + public: + /** + * Constructor + */ + SubElementAdditionalAxlesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + AxlesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BoundingBoxImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BoundingBoxXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement center + */ + class SubElementCenterParser: public IElementParser + { + private: + std::shared_ptr _centerXmlParser; + + public: + /** + * Constructor + */ + SubElementCenterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement dimensions + */ + class SubElementDimensionsParser: public IElementParser + { + private: + std::shared_ptr _dimensionsXmlParser; + + public: + /** + * Constructor + */ + SubElementDimensionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + BoundingBoxXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BrakeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + BrakeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a BrakeInputImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class BrakeInputXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement brakePercent + */ + class SubElementBrakePercentParser: public IElementParser + { + private: + std::shared_ptr _brakeXmlParser; + + public: + /** + * Constructor + */ + SubElementBrakePercentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement brakeForce + */ + class SubElementBrakeForceParser: public IElementParser + { + private: + std::shared_ptr _brakeXmlParser; + + public: + /** + * Constructor + */ + SubElementBrakeForceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + BrakeInputXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByEntityConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByEntityConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement triggeringEntities + */ + class SubElementTriggeringEntitiesParser: public IElementParser + { + private: + std::shared_ptr _triggeringEntitiesXmlParser; + + public: + /** + * Constructor + */ + SubElementTriggeringEntitiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entityCondition + */ + class SubElementEntityConditionParser: public IElementParser + { + private: + std::shared_ptr _entityConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ByEntityConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByObjectTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByObjectTypeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ByObjectTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByTypeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ByTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ByValueConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ByValueConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterCondition + */ + class SubElementParameterConditionParser: public IElementParser + { + private: + std::shared_ptr _parameterConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timeOfDayCondition + */ + class SubElementTimeOfDayConditionParser: public IElementParser + { + private: + std::shared_ptr _timeOfDayConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeOfDayConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement simulationTimeCondition + */ + class SubElementSimulationTimeConditionParser: public IElementParser + { + private: + std::shared_ptr _simulationTimeConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementSimulationTimeConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement storyboardElementStateCondition + */ + class SubElementStoryboardElementStateConditionParser: public IElementParser + { + private: + std::shared_ptr _storyboardElementStateConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementStoryboardElementStateConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedValueCondition + */ + class SubElementUserDefinedValueConditionParser: public IElementParser + { + private: + std::shared_ptr _userDefinedValueConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedValueConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSignalCondition + */ + class SubElementTrafficSignalConditionParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSignalControllerCondition + */ + class SubElementTrafficSignalControllerConditionParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalControllerConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalControllerConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement variableCondition + */ + class SubElementVariableConditionParser: public IElementParser + { + private: + std::shared_ptr _variableConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementVariableConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ByValueConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicles + */ + class SubElementVehiclesParser: public IElementParser + { + private: + std::shared_ptr _vehicleXmlParser; + + public: + /** + * Constructor + */ + SubElementVehiclesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement controllers + */ + class SubElementControllersParser: public IElementParser + { + private: + std::shared_ptr _controllerXmlParser; + + public: + /** + * Constructor + */ + SubElementControllersParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement pedestrians + */ + class SubElementPedestriansParser: public IElementParser + { + private: + std::shared_ptr _pedestrianXmlParser; + + public: + /** + * Constructor + */ + SubElementPedestriansParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement miscObjects + */ + class SubElementMiscObjectsParser: public IElementParser + { + private: + std::shared_ptr _miscObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementMiscObjectsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement environments + */ + class SubElementEnvironmentsParser: public IElementParser + { + private: + std::shared_ptr _environmentXmlParser; + + public: + /** + * Constructor + */ + SubElementEnvironmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement maneuvers + */ + class SubElementManeuversParser: public IElementParser + { + private: + std::shared_ptr _maneuverXmlParser; + + public: + /** + * Constructor + */ + SubElementManeuversParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectories + */ + class SubElementTrajectoriesParser: public IElementParser + { + private: + std::shared_ptr _trajectoryXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement routes + */ + class SubElementRoutesParser: public IElementParser + { + private: + std::shared_ptr _routeXmlParser; + + public: + /** + * Constructor + */ + SubElementRoutesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CatalogXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogDefinitionXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement catalog + */ + class SubElementCatalogParser: public IElementParser + { + private: + std::shared_ptr _catalogXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CatalogDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogLocationsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogLocationsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleCatalog + */ + class SubElementVehicleCatalogParser: public IElementParser + { + private: + std::shared_ptr _vehicleCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement controllerCatalog + */ + class SubElementControllerCatalogParser: public IElementParser + { + private: + std::shared_ptr _controllerCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement pedestrianCatalog + */ + class SubElementPedestrianCatalogParser: public IElementParser + { + private: + std::shared_ptr _pedestrianCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementPedestrianCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement miscObjectCatalog + */ + class SubElementMiscObjectCatalogParser: public IElementParser + { + private: + std::shared_ptr _miscObjectCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementMiscObjectCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement environmentCatalog + */ + class SubElementEnvironmentCatalogParser: public IElementParser + { + private: + std::shared_ptr _environmentCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementEnvironmentCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement maneuverCatalog + */ + class SubElementManeuverCatalogParser: public IElementParser + { + private: + std::shared_ptr _maneuverCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementManeuverCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectoryCatalog + */ + class SubElementTrajectoryCatalogParser: public IElementParser + { + private: + std::shared_ptr _trajectoryCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement routeCatalog + */ + class SubElementRouteCatalogParser: public IElementParser + { + private: + std::shared_ptr _routeCatalogLocationXmlParser; + + public: + /** + * Constructor + */ + SubElementRouteCatalogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CatalogLocationsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CatalogReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CatalogReferenceXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterAssignments + */ + class SubElementParameterAssignmentsParser: public IElementParser + { + private: + std::shared_ptr _parameterAssignmentXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterAssignmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CatalogReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CenterImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CenterXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CenterXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CentralSwarmObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CentralSwarmObjectXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CentralSwarmObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ClothoidXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidSplineImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement segments + */ + class SubElementSegmentsParser: public IElementParser + { + private: + std::shared_ptr _clothoidSplineSegmentXmlParser; + + public: + /** + * Constructor + */ + SubElementSegmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ClothoidSplineXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ClothoidSplineSegmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ClothoidSplineSegmentXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement positionStart + */ + class SubElementPositionStartParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionStartParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ClothoidSplineSegmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CollisionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CollisionConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityRef + */ + class SubElementEntityRefParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement byType + */ + class SubElementByTypeParser: public IElementParser + { + private: + std::shared_ptr _byObjectTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementByTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CollisionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement colorRgb + */ + class SubElementColorRgbParser: public IElementParser + { + private: + std::shared_ptr _colorRgbXmlParser; + + public: + /** + * Constructor + */ + SubElementColorRgbParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement colorCmyk + */ + class SubElementColorCmykParser: public IElementParser + { + private: + std::shared_ptr _colorCmykXmlParser; + + public: + /** + * Constructor + */ + SubElementColorCmykParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ColorXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorCmykImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorCmykXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ColorCmykXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ColorRgbImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ColorRgbXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ColorRgbXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ComponentAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ComponentAnimationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleComponent + */ + class SubElementVehicleComponentParser: public IElementParser + { + private: + std::shared_ptr _vehicleComponentXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleComponentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedComponent + */ + class SubElementUserDefinedComponentParser: public IElementParser + { + private: + std::shared_ptr _userDefinedComponentXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedComponentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ComponentAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement byEntityCondition + */ + class SubElementByEntityConditionParser: public IElementParser + { + private: + std::shared_ptr _byEntityConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementByEntityConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement byValueCondition + */ + class SubElementByValueConditionParser: public IElementParser + { + private: + std::shared_ptr _byValueConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementByValueConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConditionGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConditionGroupXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement conditions + */ + class SubElementConditionsParser: public IElementParser + { + private: + std::shared_ptr _conditionXmlParser; + + public: + /** + * Constructor + */ + SubElementConditionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ConditionGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ConnectTrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ConnectTrailerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ConnectTrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControlPointImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControlPointXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControlPointXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement assignControllerAction + */ + class SubElementAssignControllerActionParser: public IElementParser + { + private: + std::shared_ptr _assignControllerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAssignControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement overrideControllerValueAction + */ + class SubElementOverrideControllerValueActionParser: public IElementParser + { + private: + std::shared_ptr _overrideControllerValueActionXmlParser; + + public: + /** + * Constructor + */ + SubElementOverrideControllerValueActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement activateControllerAction + */ + class SubElementActivateControllerActionParser: public IElementParser + { + private: + std::shared_ptr _activateControllerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementActivateControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControllerCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement controllerDistributionEntries + */ + class SubElementControllerDistributionEntriesParser: public IElementParser + { + private: + std::shared_ptr _controllerDistributionEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControllerDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ControllerDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ControllerDistributionEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement controller + */ + class SubElementControllerParser: public IElementParser + { + private: + std::shared_ptr _controllerXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ControllerDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CustomCommandActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomCommandActionXmlParser: public XmlSimpleContentParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + protected: + void SetContentProperty(const std::string content, std::shared_ptr object) override; + bool IsContentRequired() override; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CustomCommandActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a CustomContentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class CustomContentXmlParser: public XmlSimpleContentParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + protected: + void SetContentProperty(const std::string content, std::shared_ptr object) override; + bool IsContentRequired() override; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + CustomContentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeleteEntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeleteEntityActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeleteEntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement deterministicParameterDistributions + */ + class SubElementDeterministicParameterDistributionsParser: public IElementParser + { + private: + std::shared_ptr _deterministicParameterDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicParameterDistributionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicMultiParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement deterministicMultiParameterDistributionType + */ + class SubElementDeterministicMultiParameterDistributionTypeParser: public IElementParser + { + private: + std::shared_ptr _deterministicMultiParameterDistributionTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicMultiParameterDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicMultiParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicMultiParameterDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicMultiParameterDistributionTypeXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement valueSetDistribution + */ + class SubElementValueSetDistributionParser: public IElementParser + { + private: + std::shared_ptr _valueSetDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementValueSetDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicMultiParameterDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicParameterDistributionXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement deterministicMultiParameterDistribution + */ + class SubElementDeterministicMultiParameterDistributionParser: public IElementParser + { + private: + std::shared_ptr _deterministicMultiParameterDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicMultiParameterDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement deterministicSingleParameterDistribution + */ + class SubElementDeterministicSingleParameterDistributionParser: public IElementParser + { + private: + std::shared_ptr _deterministicSingleParameterDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicSingleParameterDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicSingleParameterDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement deterministicSingleParameterDistributionType + */ + class SubElementDeterministicSingleParameterDistributionTypeParser: public IElementParser + { + private: + std::shared_ptr _deterministicSingleParameterDistributionTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicSingleParameterDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicSingleParameterDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DeterministicSingleParameterDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DeterministicSingleParameterDistributionTypeXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement distributionSet + */ + class SubElementDistributionSetParser: public IElementParser + { + private: + std::shared_ptr _distributionSetXmlParser; + + public: + /** + * Constructor + */ + SubElementDistributionSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement distributionRange + */ + class SubElementDistributionRangeParser: public IElementParser + { + private: + std::shared_ptr _distributionRangeXmlParser; + + public: + /** + * Constructor + */ + SubElementDistributionRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedDistribution + */ + class SubElementUserDefinedDistributionParser: public IElementParser + { + private: + std::shared_ptr _userDefinedDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DeterministicSingleParameterDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DimensionsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DimensionsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DimensionsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DirectionOfTravelDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectionOfTravelDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DirectionOfTravelDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DirectoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DirectoryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DirectoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DisconnectTrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DisconnectTrailerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DisconnectTrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistanceConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionDefinitionXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement deterministic + */ + class SubElementDeterministicParser: public IElementParser + { + private: + std::shared_ptr _deterministicXmlParser; + + public: + /** + * Constructor + */ + SubElementDeterministicParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement stochastic + */ + class SubElementStochasticParser: public IElementParser + { + private: + std::shared_ptr _stochasticXmlParser; + + public: + /** + * Constructor + */ + SubElementStochasticParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DistributionDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionRangeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DistributionRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement elements + */ + class SubElementElementsParser: public IElementParser + { + private: + std::shared_ptr _distributionSetElementXmlParser; + + public: + /** + * Constructor + */ + SubElementElementsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DistributionSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DistributionSetElementImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DistributionSetElementXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DistributionSetElementXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DomeImageImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DomeImageXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement domeFile + */ + class SubElementDomeFileParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementDomeFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DomeImageXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a DynamicConstraintsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class DynamicConstraintsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + DynamicConstraintsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EndOfRoadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EndOfRoadConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EndOfRoadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntitiesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement scenarioObjects + */ + class SubElementScenarioObjectsParser: public IElementParser + { + private: + std::shared_ptr _scenarioObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementScenarioObjectsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entitySelections + */ + class SubElementEntitySelectionsParser: public IElementParser + { + private: + std::shared_ptr _entitySelectionXmlParser; + + public: + /** + * Constructor + */ + SubElementEntitySelectionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement addEntityAction + */ + class SubElementAddEntityActionParser: public IElementParser + { + private: + std::shared_ptr _addEntityActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAddEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement deleteEntityAction + */ + class SubElementDeleteEntityActionParser: public IElementParser + { + private: + std::shared_ptr _deleteEntityActionXmlParser; + + public: + /** + * Constructor + */ + SubElementDeleteEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement endOfRoadCondition + */ + class SubElementEndOfRoadConditionParser: public IElementParser + { + private: + std::shared_ptr _endOfRoadConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementEndOfRoadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement collisionCondition + */ + class SubElementCollisionConditionParser: public IElementParser + { + private: + std::shared_ptr _collisionConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementCollisionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement offroadCondition + */ + class SubElementOffroadConditionParser: public IElementParser + { + private: + std::shared_ptr _offroadConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementOffroadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timeHeadwayCondition + */ + class SubElementTimeHeadwayConditionParser: public IElementParser + { + private: + std::shared_ptr _timeHeadwayConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeHeadwayConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timeToCollisionCondition + */ + class SubElementTimeToCollisionConditionParser: public IElementParser + { + private: + std::shared_ptr _timeToCollisionConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeToCollisionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement accelerationCondition + */ + class SubElementAccelerationConditionParser: public IElementParser + { + private: + std::shared_ptr _accelerationConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementAccelerationConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement standStillCondition + */ + class SubElementStandStillConditionParser: public IElementParser + { + private: + std::shared_ptr _standStillConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementStandStillConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement speedCondition + */ + class SubElementSpeedConditionParser: public IElementParser + { + private: + std::shared_ptr _speedConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeSpeedCondition + */ + class SubElementRelativeSpeedConditionParser: public IElementParser + { + private: + std::shared_ptr _relativeSpeedConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeSpeedConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement traveledDistanceCondition + */ + class SubElementTraveledDistanceConditionParser: public IElementParser + { + private: + std::shared_ptr _traveledDistanceConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementTraveledDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement reachPositionCondition + */ + class SubElementReachPositionConditionParser: public IElementParser + { + private: + std::shared_ptr _reachPositionConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementReachPositionConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement distanceCondition + */ + class SubElementDistanceConditionParser: public IElementParser + { + private: + std::shared_ptr _distanceConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeDistanceCondition + */ + class SubElementRelativeDistanceConditionParser: public IElementParser + { + private: + std::shared_ptr _relativeDistanceConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeDistanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeClearanceCondition + */ + class SubElementRelativeClearanceConditionParser: public IElementParser + { + private: + std::shared_ptr _relativeClearanceConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeClearanceConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement angleCondition + */ + class SubElementAngleConditionParser: public IElementParser + { + private: + std::shared_ptr _angleConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementAngleConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeAngleCondition + */ + class SubElementRelativeAngleConditionParser: public IElementParser + { + private: + std::shared_ptr _relativeAngleConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeAngleConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityDistributionEntry + */ + class SubElementEntityDistributionEntryParser: public IElementParser + { + private: + std::shared_ptr _entityDistributionEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityDistributionEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityDistributionEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement scenarioObjectTemplate + */ + class SubElementScenarioObjectTemplateParser: public IElementParser + { + private: + std::shared_ptr _scenarioObjectTemplateXmlParser; + + public: + /** + * Constructor + */ + SubElementScenarioObjectTemplateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityObjectXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement vehicle + */ + class SubElementVehicleParser: public IElementParser + { + private: + std::shared_ptr _vehicleXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement pedestrian + */ + class SubElementPedestrianParser: public IElementParser + { + private: + std::shared_ptr _pedestrianXmlParser; + + public: + /** + * Constructor + */ + SubElementPedestrianParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement miscObject + */ + class SubElementMiscObjectParser: public IElementParser + { + private: + std::shared_ptr _miscObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementMiscObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement externalObjectReference + */ + class SubElementExternalObjectReferenceParser: public IElementParser + { + private: + std::shared_ptr _externalObjectReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementExternalObjectReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntityRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntityRefXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntityRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EntitySelectionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EntitySelectionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement members + */ + class SubElementMembersParser: public IElementParser + { + private: + std::shared_ptr _selectedEntitiesXmlParser; + + public: + /** + * Constructor + */ + SubElementMembersParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EntitySelectionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timeOfDay + */ + class SubElementTimeOfDayParser: public IElementParser + { + private: + std::shared_ptr _timeOfDayXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeOfDayParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement weather + */ + class SubElementWeatherParser: public IElementParser + { + private: + std::shared_ptr _weatherXmlParser; + + public: + /** + * Constructor + */ + SubElementWeatherParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement roadCondition + */ + class SubElementRoadConditionParser: public IElementParser + { + private: + std::shared_ptr _roadConditionXmlParser; + + public: + /** + * Constructor + */ + SubElementRoadConditionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EnvironmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement environment + */ + class SubElementEnvironmentParser: public IElementParser + { + private: + std::shared_ptr _environmentXmlParser; + + public: + /** + * Constructor + */ + SubElementEnvironmentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EnvironmentActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EnvironmentCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EnvironmentCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EnvironmentCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a EventImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class EventXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement actions + */ + class SubElementActionsParser: public IElementParser + { + private: + std::shared_ptr _actionXmlParser; + + public: + /** + * Constructor + */ + SubElementActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement startTrigger + */ + class SubElementStartTriggerParser: public IElementParser + { + private: + std::shared_ptr _triggerXmlParser; + + public: + /** + * Constructor + */ + SubElementStartTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + EventXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ExternalObjectReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ExternalObjectReferenceXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ExternalObjectReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FileImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + FileXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FileHeaderImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FileHeaderXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement license + */ + class SubElementLicenseParser: public IElementParser + { + private: + std::shared_ptr _licenseXmlParser; + + public: + /** + * Constructor + */ + SubElementLicenseParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + FileHeaderXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FinalSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FinalSpeedXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement absoluteSpeed + */ + class SubElementAbsoluteSpeedParser: public IElementParser + { + private: + std::shared_ptr _absoluteSpeedXmlParser; + + public: + /** + * Constructor + */ + SubElementAbsoluteSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeSpeedToMaster + */ + class SubElementRelativeSpeedToMasterParser: public IElementParser + { + private: + std::shared_ptr _relativeSpeedToMasterXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeSpeedToMasterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + FinalSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FogImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FogXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement boundingBox + */ + class SubElementBoundingBoxParser: public IElementParser + { + private: + std::shared_ptr _boundingBoxXmlParser; + + public: + /** + * Constructor + */ + SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + FogXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a FollowTrajectoryActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class FollowTrajectoryActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trajectory + */ + class SubElementTrajectoryParser: public IElementParser + { + private: + std::shared_ptr _trajectoryXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timeReference + */ + class SubElementTimeReferenceParser: public IElementParser + { + private: + std::shared_ptr _timeReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectoryFollowingMode + */ + class SubElementTrajectoryFollowingModeParser: public IElementParser + { + private: + std::shared_ptr _trajectoryFollowingModeXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryFollowingModeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectoryRef + */ + class SubElementTrajectoryRefParser: public IElementParser + { + private: + std::shared_ptr _trajectoryRefXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + FollowTrajectoryActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GearXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement manualGear + */ + class SubElementManualGearParser: public IElementParser + { + private: + std::shared_ptr _manualGearXmlParser; + + public: + /** + * Constructor + */ + SubElementManualGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement automaticGear + */ + class SubElementAutomaticGearParser: public IElementParser + { + private: + std::shared_ptr _automaticGearXmlParser; + + public: + /** + * Constructor + */ + SubElementAutomaticGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + GearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GeoPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GeoPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + GeoPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a GlobalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class GlobalActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement environmentAction + */ + class SubElementEnvironmentActionParser: public IElementParser + { + private: + std::shared_ptr _environmentActionXmlParser; + + public: + /** + * Constructor + */ + SubElementEnvironmentActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entityAction + */ + class SubElementEntityActionParser: public IElementParser + { + private: + std::shared_ptr _entityActionXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement infrastructureAction + */ + class SubElementInfrastructureActionParser: public IElementParser + { + private: + std::shared_ptr _infrastructureActionXmlParser; + + public: + /** + * Constructor + */ + SubElementInfrastructureActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement setMonitorAction + */ + class SubElementSetMonitorActionParser: public IElementParser + { + private: + std::shared_ptr _setMonitorActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSetMonitorActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement parameterAction + */ + class SubElementParameterActionParser: public IElementParser + { + private: + std::shared_ptr _parameterActionXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficAction + */ + class SubElementTrafficActionParser: public IElementParser + { + private: + std::shared_ptr _trafficActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement variableAction + */ + class SubElementVariableActionParser: public IElementParser + { + private: + std::shared_ptr _variableActionXmlParser; + + public: + /** + * Constructor + */ + SubElementVariableActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + GlobalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a HistogramImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement bins + */ + class SubElementBinsParser: public IElementParser + { + private: + std::shared_ptr _histogramBinXmlParser; + + public: + /** + * Constructor + */ + SubElementBinsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + HistogramXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a HistogramBinImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class HistogramBinXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + HistogramBinXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InRoutePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InRoutePositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement fromCurrentEntity + */ + class SubElementFromCurrentEntityParser: public IElementParser + { + private: + std::shared_ptr _positionOfCurrentEntityXmlParser; + + public: + /** + * Constructor + */ + SubElementFromCurrentEntityParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement fromRoadCoordinates + */ + class SubElementFromRoadCoordinatesParser: public IElementParser + { + private: + std::shared_ptr _positionInRoadCoordinatesXmlParser; + + public: + /** + * Constructor + */ + SubElementFromRoadCoordinatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement fromLaneCoordinates + */ + class SubElementFromLaneCoordinatesParser: public IElementParser + { + private: + std::shared_ptr _positionInLaneCoordinatesXmlParser; + + public: + /** + * Constructor + */ + SubElementFromLaneCoordinatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + InRoutePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InfrastructureActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InfrastructureActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficSignalAction + */ + class SubElementTrafficSignalActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + InfrastructureActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InitImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InitXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement actions + */ + class SubElementActionsParser: public IElementParser + { + private: + std::shared_ptr _initActionsXmlParser; + + public: + /** + * Constructor + */ + SubElementActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + InitXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a InitActionsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class InitActionsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement globalActions + */ + class SubElementGlobalActionsParser: public IElementParser + { + private: + std::shared_ptr _globalActionXmlParser; + + public: + /** + * Constructor + */ + SubElementGlobalActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedActions + */ + class SubElementUserDefinedActionsParser: public IElementParser + { + private: + std::shared_ptr _userDefinedActionXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement privates + */ + class SubElementPrivatesParser: public IElementParser + { + private: + std::shared_ptr _privateXmlParser; + + public: + /** + * Constructor + */ + SubElementPrivatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + InitActionsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a KnotImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class KnotXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + KnotXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneChangeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement laneChangeActionDynamics + */ + class SubElementLaneChangeActionDynamicsParser: public IElementParser + { + private: + std::shared_ptr _transitionDynamicsXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneChangeActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement laneChangeTarget + */ + class SubElementLaneChangeTargetParser: public IElementParser + { + private: + std::shared_ptr _laneChangeTargetXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneChangeTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneChangeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneChangeTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneChangeTargetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement relativeTargetLane + */ + class SubElementRelativeTargetLaneParser: public IElementParser + { + private: + std::shared_ptr _relativeTargetLaneXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeTargetLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement absoluteTargetLane + */ + class SubElementAbsoluteTargetLaneParser: public IElementParser + { + private: + std::shared_ptr _absoluteTargetLaneXmlParser; + + public: + /** + * Constructor + */ + SubElementAbsoluteTargetLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneChangeTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement laneOffsetActionDynamics + */ + class SubElementLaneOffsetActionDynamicsParser: public IElementParser + { + private: + std::shared_ptr _laneOffsetActionDynamicsXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneOffsetActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement laneOffsetTarget + */ + class SubElementLaneOffsetTargetParser: public IElementParser + { + private: + std::shared_ptr _laneOffsetTargetXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneOffsetTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneOffsetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetActionDynamicsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetActionDynamicsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneOffsetActionDynamicsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LaneOffsetTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LaneOffsetTargetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement relativeTargetLaneOffset + */ + class SubElementRelativeTargetLaneOffsetParser: public IElementParser + { + private: + std::shared_ptr _relativeTargetLaneOffsetXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeTargetLaneOffsetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement absoluteTargetLaneOffset + */ + class SubElementAbsoluteTargetLaneOffsetParser: public IElementParser + { + private: + std::shared_ptr _absoluteTargetLaneOffsetXmlParser; + + public: + /** + * Constructor + */ + SubElementAbsoluteTargetLaneOffsetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LaneOffsetTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LanePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LanePositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LanePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LateralActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement laneChangeAction + */ + class SubElementLaneChangeActionParser: public IElementParser + { + private: + std::shared_ptr _laneChangeActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneChangeActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement laneOffsetAction + */ + class SubElementLaneOffsetActionParser: public IElementParser + { + private: + std::shared_ptr _laneOffsetActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneOffsetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement lateralDistanceAction + */ + class SubElementLateralDistanceActionParser: public IElementParser + { + private: + std::shared_ptr _lateralDistanceActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLateralDistanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LateralActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LateralDistanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LateralDistanceActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement dynamicConstraints + */ + class SubElementDynamicConstraintsParser: public IElementParser + { + private: + std::shared_ptr _dynamicConstraintsXmlParser; + + public: + /** + * Constructor + */ + SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LateralDistanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LicenseImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LicenseXmlParser: public XmlSimpleContentParser // to check: XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + protected: + void SetContentProperty(const std::string content, std::shared_ptr object) override; + bool IsContentRequired() override; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LicenseXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement color + */ + class SubElementColorParser: public IElementParser + { + private: + std::shared_ptr _colorXmlParser; + + public: + /** + * Constructor + */ + SubElementColorParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LightStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightStateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightStateActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement lightType + */ + class SubElementLightTypeParser: public IElementParser + { + private: + std::shared_ptr _lightTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementLightTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement lightState + */ + class SubElementLightStateParser: public IElementParser + { + private: + std::shared_ptr _lightStateXmlParser; + + public: + /** + * Constructor + */ + SubElementLightStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LightStateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LightTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LightTypeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleLight + */ + class SubElementVehicleLightParser: public IElementParser + { + private: + std::shared_ptr _vehicleLightXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleLightParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedLight + */ + class SubElementUserDefinedLightParser: public IElementParser + { + private: + std::shared_ptr _userDefinedLightXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedLightParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LightTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LogNormalDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LogNormalDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LogNormalDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LongitudinalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement speedAction + */ + class SubElementSpeedActionParser: public IElementParser + { + private: + std::shared_ptr _speedActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement longitudinalDistanceAction + */ + class SubElementLongitudinalDistanceActionParser: public IElementParser + { + private: + std::shared_ptr _longitudinalDistanceActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLongitudinalDistanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement speedProfileAction + */ + class SubElementSpeedProfileActionParser: public IElementParser + { + private: + std::shared_ptr _speedProfileActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedProfileActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LongitudinalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a LongitudinalDistanceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class LongitudinalDistanceActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement dynamicConstraints + */ + class SubElementDynamicConstraintsParser: public IElementParser + { + private: + std::shared_ptr _dynamicConstraintsXmlParser; + + public: + /** + * Constructor + */ + SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + LongitudinalDistanceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement events + */ + class SubElementEventsParser: public IElementParser + { + private: + std::shared_ptr _eventXmlParser; + + public: + /** + * Constructor + */ + SubElementEventsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ManeuverXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ManeuverCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManeuverGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManeuverGroupXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement actors + */ + class SubElementActorsParser: public IElementParser + { + private: + std::shared_ptr _actorsXmlParser; + + public: + /** + * Constructor + */ + SubElementActorsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReferences + */ + class SubElementCatalogReferencesParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferencesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement maneuvers + */ + class SubElementManeuversParser: public IElementParser + { + private: + std::shared_ptr _maneuverXmlParser; + + public: + /** + * Constructor + */ + SubElementManeuversParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ManeuverGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ManualGearImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ManualGearXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ManualGearXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MiscObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement boundingBox + */ + class SubElementBoundingBoxParser: public IElementParser + { + private: + std::shared_ptr _boundingBoxXmlParser; + + public: + /** + * Constructor + */ + SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + MiscObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MiscObjectCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MiscObjectCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + MiscObjectCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ModifyRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ModifyRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement addValue + */ + class SubElementAddValueParser: public IElementParser + { + private: + std::shared_ptr _parameterAddValueRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementAddValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement multiplyByValue + */ + class SubElementMultiplyByValueParser: public IElementParser + { + private: + std::shared_ptr _parameterMultiplyByValueRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementMultiplyByValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ModifyRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a MonitorDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class MonitorDeclarationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + MonitorDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NoneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NoneXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + NoneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NormalDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NormalDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + NormalDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a NurbsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class NurbsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement controlPoints + */ + class SubElementControlPointsParser: public IElementParser + { + private: + std::shared_ptr _controlPointXmlParser; + + public: + /** + * Constructor + */ + SubElementControlPointsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement knots + */ + class SubElementKnotsParser: public IElementParser + { + private: + std::shared_ptr _knotXmlParser; + + public: + /** + * Constructor + */ + SubElementKnotsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + NurbsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ObjectControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ObjectControllerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement controller + */ + class SubElementControllerParser: public IElementParser + { + private: + std::shared_ptr _controllerXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ObjectControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OffroadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OffroadConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OffroadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OpenScenarioImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement fileHeader + */ + class SubElementFileHeaderParser: public IElementParser + { + private: + std::shared_ptr _fileHeaderXmlParser; + + public: + /** + * Constructor + */ + SubElementFileHeaderParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement openScenarioCategory + */ + class SubElementOpenScenarioCategoryParser: public IElementParser + { + private: + std::shared_ptr _openScenarioCategoryXmlParser; + + public: + /** + * Constructor + */ + SubElementOpenScenarioCategoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OpenScenarioXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OpenScenarioCategoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OpenScenarioCategoryXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement scenarioDefinition + */ + class SubElementScenarioDefinitionParser: public IElementParser + { + private: + std::shared_ptr _scenarioDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementScenarioDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogDefinition + */ + class SubElementCatalogDefinitionParser: public IElementParser + { + private: + std::shared_ptr _catalogDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement parameterValueDistributionDefinition + */ + class SubElementParameterValueDistributionDefinitionParser: public IElementParser + { + private: + std::shared_ptr _parameterValueDistributionDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterValueDistributionDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OpenScenarioCategoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OrientationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OrientationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OrientationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideBrakeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideBrakeActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement brakeInput + */ + class SubElementBrakeInputParser: public IElementParser + { + private: + std::shared_ptr _brakeInputXmlParser; + + public: + /** + * Constructor + */ + SubElementBrakeInputParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideBrakeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideClutchActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideClutchActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideClutchActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideControllerValueActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideControllerValueActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement throttle + */ + class SubElementThrottleParser: public IElementParser + { + private: + std::shared_ptr _overrideThrottleActionXmlParser; + + public: + /** + * Constructor + */ + SubElementThrottleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement brake + */ + class SubElementBrakeParser: public IElementParser + { + private: + std::shared_ptr _overrideBrakeActionXmlParser; + + public: + /** + * Constructor + */ + SubElementBrakeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement clutch + */ + class SubElementClutchParser: public IElementParser + { + private: + std::shared_ptr _overrideClutchActionXmlParser; + + public: + /** + * Constructor + */ + SubElementClutchParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement parkingBrake + */ + class SubElementParkingBrakeParser: public IElementParser + { + private: + std::shared_ptr _overrideParkingBrakeActionXmlParser; + + public: + /** + * Constructor + */ + SubElementParkingBrakeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement steeringWheel + */ + class SubElementSteeringWheelParser: public IElementParser + { + private: + std::shared_ptr _overrideSteeringWheelActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSteeringWheelParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement gear + */ + class SubElementGearParser: public IElementParser + { + private: + std::shared_ptr _overrideGearActionXmlParser; + + public: + /** + * Constructor + */ + SubElementGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideControllerValueActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideGearActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideGearActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement gear + */ + class SubElementGearParser: public IElementParser + { + private: + std::shared_ptr _gearXmlParser; + + public: + /** + * Constructor + */ + SubElementGearParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideGearActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideParkingBrakeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideParkingBrakeActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement brakeInput + */ + class SubElementBrakeInputParser: public IElementParser + { + private: + std::shared_ptr _brakeInputXmlParser; + + public: + /** + * Constructor + */ + SubElementBrakeInputParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideParkingBrakeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideSteeringWheelActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideSteeringWheelActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideSteeringWheelActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a OverrideThrottleActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class OverrideThrottleActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + OverrideThrottleActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement setAction + */ + class SubElementSetActionParser: public IElementParser + { + private: + std::shared_ptr _parameterSetActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement modifyAction + */ + class SubElementModifyActionParser: public IElementParser + { + private: + std::shared_ptr _parameterModifyActionXmlParser; + + public: + /** + * Constructor + */ + SubElementModifyActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterAddValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAddValueRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterAddValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterAssignmentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterAssignmentXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterAssignmentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterDeclarationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement constraintGroups + */ + class SubElementConstraintGroupsParser: public IElementParser + { + private: + std::shared_ptr _valueConstraintGroupXmlParser; + + public: + /** + * Constructor + */ + SubElementConstraintGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterModifyActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterModifyActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement rule + */ + class SubElementRuleParser: public IElementParser + { + private: + std::shared_ptr _modifyRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementRuleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterModifyActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterMultiplyByValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterMultiplyByValueRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterMultiplyByValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterSetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterSetActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterSetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement scenarioFile + */ + class SubElementScenarioFileParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementScenarioFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement distributionDefinition + */ + class SubElementDistributionDefinitionParser: public IElementParser + { + private: + std::shared_ptr _distributionDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementDistributionDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterValueDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueDistributionDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueDistributionDefinitionXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterValueDistribution + */ + class SubElementParameterValueDistributionParser: public IElementParser + { + private: + std::shared_ptr _parameterValueDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterValueDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterValueDistributionDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ParameterValueSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ParameterValueSetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterAssignments + */ + class SubElementParameterAssignmentsParser: public IElementParser + { + private: + std::shared_ptr _parameterAssignmentXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterAssignmentsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ParameterValueSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement boundingBox + */ + class SubElementBoundingBoxParser: public IElementParser + { + private: + std::shared_ptr _boundingBoxXmlParser; + + public: + /** + * Constructor + */ + SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PedestrianXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianAnimationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement gestures + */ + class SubElementGesturesParser: public IElementParser + { + private: + std::shared_ptr _pedestrianGestureXmlParser; + + public: + /** + * Constructor + */ + SubElementGesturesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PedestrianAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PedestrianCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PedestrianGestureImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PedestrianGestureXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PedestrianGestureXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PerformanceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PerformanceXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PerformanceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PhaseImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PhaseXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficSignalStates + */ + class SubElementTrafficSignalStatesParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalStateXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalStatesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSignalGroupState + */ + class SubElementTrafficSignalGroupStateParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalGroupStateXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalGroupStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PhaseXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PoissonDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PoissonDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PoissonDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PolygonImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolygonXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement positions + */ + class SubElementPositionsParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PolygonXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PolylineImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PolylineXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vertices + */ + class SubElementVerticesParser: public IElementParser + { + private: + std::shared_ptr _vertexXmlParser; + + public: + /** + * Constructor + */ + SubElementVerticesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PolylineXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement worldPosition + */ + class SubElementWorldPositionParser: public IElementParser + { + private: + std::shared_ptr _worldPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementWorldPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeWorldPosition + */ + class SubElementRelativeWorldPositionParser: public IElementParser + { + private: + std::shared_ptr _relativeWorldPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeWorldPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeObjectPosition + */ + class SubElementRelativeObjectPositionParser: public IElementParser + { + private: + std::shared_ptr _relativeObjectPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeObjectPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement roadPosition + */ + class SubElementRoadPositionParser: public IElementParser + { + private: + std::shared_ptr _roadPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRoadPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeRoadPosition + */ + class SubElementRelativeRoadPositionParser: public IElementParser + { + private: + std::shared_ptr _relativeRoadPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeRoadPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement lanePosition + */ + class SubElementLanePositionParser: public IElementParser + { + private: + std::shared_ptr _lanePositionXmlParser; + + public: + /** + * Constructor + */ + SubElementLanePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement relativeLanePosition + */ + class SubElementRelativeLanePositionParser: public IElementParser + { + private: + std::shared_ptr _relativeLanePositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeLanePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement routePosition + */ + class SubElementRoutePositionParser: public IElementParser + { + private: + std::shared_ptr _routePositionXmlParser; + + public: + /** + * Constructor + */ + SubElementRoutePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement geoPosition + */ + class SubElementGeoPositionParser: public IElementParser + { + private: + std::shared_ptr _geoPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementGeoPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectoryPosition + */ + class SubElementTrajectoryPositionParser: public IElementParser + { + private: + std::shared_ptr _trajectoryPositionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionInLaneCoordinatesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInLaneCoordinatesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PositionInLaneCoordinatesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionInRoadCoordinatesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionInRoadCoordinatesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PositionInRoadCoordinatesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PositionOfCurrentEntityImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PositionOfCurrentEntityXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PositionOfCurrentEntityXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrecipitationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrecipitationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PrecipitationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrivateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement privateActions + */ + class SubElementPrivateActionsParser: public IElementParser + { + private: + std::shared_ptr _privateActionXmlParser; + + public: + /** + * Constructor + */ + SubElementPrivateActionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PrivateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PrivateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PrivateActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement longitudinalAction + */ + class SubElementLongitudinalActionParser: public IElementParser + { + private: + std::shared_ptr _longitudinalActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLongitudinalActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement lateralAction + */ + class SubElementLateralActionParser: public IElementParser + { + private: + std::shared_ptr _lateralActionXmlParser; + + public: + /** + * Constructor + */ + SubElementLateralActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement visibilityAction + */ + class SubElementVisibilityActionParser: public IElementParser + { + private: + std::shared_ptr _visibilityActionXmlParser; + + public: + /** + * Constructor + */ + SubElementVisibilityActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement synchronizeAction + */ + class SubElementSynchronizeActionParser: public IElementParser + { + private: + std::shared_ptr _synchronizeActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSynchronizeActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement activateControllerAction + */ + class SubElementActivateControllerActionParser: public IElementParser + { + private: + std::shared_ptr _activateControllerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementActivateControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement controllerAction + */ + class SubElementControllerActionParser: public IElementParser + { + private: + std::shared_ptr _controllerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement teleportAction + */ + class SubElementTeleportActionParser: public IElementParser + { + private: + std::shared_ptr _teleportActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTeleportActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement routingAction + */ + class SubElementRoutingActionParser: public IElementParser + { + private: + std::shared_ptr _routingActionXmlParser; + + public: + /** + * Constructor + */ + SubElementRoutingActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement appearanceAction + */ + class SubElementAppearanceActionParser: public IElementParser + { + private: + std::shared_ptr _appearanceActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAppearanceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trailerAction + */ + class SubElementTrailerActionParser: public IElementParser + { + private: + std::shared_ptr _trailerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PrivateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ProbabilityDistributionSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement elements + */ + class SubElementElementsParser: public IElementParser + { + private: + std::shared_ptr _probabilityDistributionSetElementXmlParser; + + public: + /** + * Constructor + */ + SubElementElementsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ProbabilityDistributionSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ProbabilityDistributionSetElementImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ProbabilityDistributionSetElementXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ProbabilityDistributionSetElementXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PropertiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PropertiesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertyXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement files + */ + class SubElementFilesParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementFilesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement customContent + */ + class SubElementCustomContentParser: public IElementParser + { + private: + std::shared_ptr _customContentXmlParser; + + public: + /** + * Constructor + */ + SubElementCustomContentParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PropertiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a PropertyImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class PropertyXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + PropertyXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RandomRouteActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RandomRouteActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RandomRouteActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RangeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ReachPositionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ReachPositionConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ReachPositionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeAngleConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeAngleConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeAngleConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeClearanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeClearanceConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement relativeLaneRange + */ + class SubElementRelativeLaneRangeParser: public IElementParser + { + private: + std::shared_ptr _relativeLaneRangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeLaneRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entityRef + */ + class SubElementEntityRefParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeClearanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeDistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeDistanceConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeDistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeLanePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeLanePositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeLanePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeLaneRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeLaneRangeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeLaneRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeObjectPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeObjectPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeObjectPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeRoadPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeRoadPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeRoadPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeSpeedConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeSpeedConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeSpeedToMasterImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeSpeedToMasterXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement steadyState + */ + class SubElementSteadyStateParser: public IElementParser + { + private: + std::shared_ptr _steadyStateXmlParser; + + public: + /** + * Constructor + */ + SubElementSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeSpeedToMasterXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetLaneImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeTargetLaneXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetLaneOffsetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetLaneOffsetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeTargetLaneOffsetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeTargetSpeedImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeTargetSpeedXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeTargetSpeedXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RelativeWorldPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RelativeWorldPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RelativeWorldPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoadConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadCursorImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadCursorXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement lane + */ + class SubElementLaneParser: public IElementParser + { + private: + std::shared_ptr _laneXmlParser; + + public: + /** + * Constructor + */ + SubElementLaneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoadCursorXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadNetworkImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadNetworkXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement logicFile + */ + class SubElementLogicFileParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementLogicFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement sceneGraphFile + */ + class SubElementSceneGraphFileParser: public IElementParser + { + private: + std::shared_ptr _fileXmlParser; + + public: + /** + * Constructor + */ + SubElementSceneGraphFileParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSignals + */ + class SubElementTrafficSignalsParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalControllerXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement usedArea + */ + class SubElementUsedAreaParser: public IElementParser + { + private: + std::shared_ptr _usedAreaXmlParser; + + public: + /** + * Constructor + */ + SubElementUsedAreaParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoadNetworkXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoadPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoadRangeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoadRangeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement roadCursor + */ + class SubElementRoadCursorParser: public IElementParser + { + private: + std::shared_ptr _roadCursorXmlParser; + + public: + /** + * Constructor + */ + SubElementRoadCursorParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoadRangeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement waypoints + */ + class SubElementWaypointsParser: public IElementParser + { + private: + std::shared_ptr _waypointXmlParser; + + public: + /** + * Constructor + */ + SubElementWaypointsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RouteXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RouteCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoutePositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutePositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement routeRef + */ + class SubElementRouteRefParser: public IElementParser + { + private: + std::shared_ptr _routeRefXmlParser; + + public: + /** + * Constructor + */ + SubElementRouteRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement inRoutePosition + */ + class SubElementInRoutePositionParser: public IElementParser + { + private: + std::shared_ptr _inRoutePositionXmlParser; + + public: + /** + * Constructor + */ + SubElementInRoutePositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoutePositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RouteRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RouteRefXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement route + */ + class SubElementRouteParser: public IElementParser + { + private: + std::shared_ptr _routeXmlParser; + + public: + /** + * Constructor + */ + SubElementRouteParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RouteRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a RoutingActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class RoutingActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement assignRouteAction + */ + class SubElementAssignRouteActionParser: public IElementParser + { + private: + std::shared_ptr _assignRouteActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAssignRouteActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement followTrajectoryAction + */ + class SubElementFollowTrajectoryActionParser: public IElementParser + { + private: + std::shared_ptr _followTrajectoryActionXmlParser; + + public: + /** + * Constructor + */ + SubElementFollowTrajectoryActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement acquirePositionAction + */ + class SubElementAcquirePositionActionParser: public IElementParser + { + private: + std::shared_ptr _acquirePositionActionXmlParser; + + public: + /** + * Constructor + */ + SubElementAcquirePositionActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement randomRouteAction + */ + class SubElementRandomRouteActionParser: public IElementParser + { + private: + std::shared_ptr _randomRouteActionXmlParser; + + public: + /** + * Constructor + */ + SubElementRandomRouteActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + RoutingActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioDefinitionXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement variableDeclarations + */ + class SubElementVariableDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _variableDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementVariableDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement monitorDeclarations + */ + class SubElementMonitorDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _monitorDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementMonitorDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogLocations + */ + class SubElementCatalogLocationsParser: public IElementParser + { + private: + std::shared_ptr _catalogLocationsXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogLocationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement roadNetwork + */ + class SubElementRoadNetworkParser: public IElementParser + { + private: + std::shared_ptr _roadNetworkXmlParser; + + public: + /** + * Constructor + */ + SubElementRoadNetworkParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entities + */ + class SubElementEntitiesParser: public IElementParser + { + private: + std::shared_ptr _entitiesXmlParser; + + public: + /** + * Constructor + */ + SubElementEntitiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement storyboard + */ + class SubElementStoryboardParser: public IElementParser + { + private: + std::shared_ptr _storyboardXmlParser; + + public: + /** + * Constructor + */ + SubElementStoryboardParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ScenarioDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioObjectImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityObject + */ + class SubElementEntityObjectParser: public IElementParser + { + private: + std::shared_ptr _entityObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement objectController + */ + class SubElementObjectControllerParser: public IElementParser + { + private: + std::shared_ptr _objectControllerXmlParser; + + public: + /** + * Constructor + */ + SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ScenarioObjectXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ScenarioObjectTemplateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ScenarioObjectTemplateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entitiyObject + */ + class SubElementEntitiyObjectParser: public IElementParser + { + private: + std::shared_ptr _entityObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementEntitiyObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement objectController + */ + class SubElementObjectControllerParser: public IElementParser + { + private: + std::shared_ptr _objectControllerXmlParser; + + public: + /** + * Constructor + */ + SubElementObjectControllerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ScenarioObjectTemplateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SelectedEntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SelectedEntitiesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityRef + */ + class SubElementEntityRefParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement byType + */ + class SubElementByTypeParser: public IElementParser + { + private: + std::shared_ptr _byTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementByTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SelectedEntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SensorReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SensorReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SensorReferenceSetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SensorReferenceSetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement sensorReferences + */ + class SubElementSensorReferencesParser: public IElementParser + { + private: + std::shared_ptr _sensorReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementSensorReferencesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SensorReferenceSetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SetMonitorActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SetMonitorActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SetMonitorActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ShapeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ShapeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement polyline + */ + class SubElementPolylineParser: public IElementParser + { + private: + std::shared_ptr _polylineXmlParser; + + public: + /** + * Constructor + */ + SubElementPolylineParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement clothoid + */ + class SubElementClothoidParser: public IElementParser + { + private: + std::shared_ptr _clothoidXmlParser; + + public: + /** + * Constructor + */ + SubElementClothoidParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement clothoidSpline + */ + class SubElementClothoidSplineParser: public IElementParser + { + private: + std::shared_ptr _clothoidSplineXmlParser; + + public: + /** + * Constructor + */ + SubElementClothoidSplineParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement nurbs + */ + class SubElementNurbsParser: public IElementParser + { + private: + std::shared_ptr _nurbsXmlParser; + + public: + /** + * Constructor + */ + SubElementNurbsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ShapeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SimulationTimeConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SimulationTimeConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SimulationTimeConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement speedActionDynamics + */ + class SubElementSpeedActionDynamicsParser: public IElementParser + { + private: + std::shared_ptr _transitionDynamicsXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedActionDynamicsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement speedActionTarget + */ + class SubElementSpeedActionTargetParser: public IElementParser + { + private: + std::shared_ptr _speedActionTargetXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedActionTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SpeedActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedActionTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedActionTargetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement relativeTargetSpeed + */ + class SubElementRelativeTargetSpeedParser: public IElementParser + { + private: + std::shared_ptr _relativeTargetSpeedXmlParser; + + public: + /** + * Constructor + */ + SubElementRelativeTargetSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement absoluteTargetSpeed + */ + class SubElementAbsoluteTargetSpeedParser: public IElementParser + { + private: + std::shared_ptr _absoluteTargetSpeedXmlParser; + + public: + /** + * Constructor + */ + SubElementAbsoluteTargetSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SpeedActionTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SpeedConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedProfileActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement dynamicConstraints + */ + class SubElementDynamicConstraintsParser: public IElementParser + { + private: + std::shared_ptr _dynamicConstraintsXmlParser; + + public: + /** + * Constructor + */ + SubElementDynamicConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement speedProfileEntry + */ + class SubElementSpeedProfileEntryParser: public IElementParser + { + private: + std::shared_ptr _speedProfileEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementSpeedProfileEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SpeedProfileActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SpeedProfileEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SpeedProfileEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SpeedProfileEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StandStillConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StandStillConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StandStillConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SteadyStateXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement targetDistanceSteadyState + */ + class SubElementTargetDistanceSteadyStateParser: public IElementParser + { + private: + std::shared_ptr _targetDistanceSteadyStateXmlParser; + + public: + /** + * Constructor + */ + SubElementTargetDistanceSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement targetTimeSteadyState + */ + class SubElementTargetTimeSteadyStateParser: public IElementParser + { + private: + std::shared_ptr _targetTimeSteadyStateXmlParser; + + public: + /** + * Constructor + */ + SubElementTargetTimeSteadyStateParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement stochasticDistributions + */ + class SubElementStochasticDistributionsParser: public IElementParser + { + private: + std::shared_ptr _stochasticDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementStochasticDistributionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StochasticXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement stochasticDistributionType + */ + class SubElementStochasticDistributionTypeParser: public IElementParser + { + private: + std::shared_ptr _stochasticDistributionTypeXmlParser; + + public: + /** + * Constructor + */ + SubElementStochasticDistributionTypeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StochasticDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StochasticDistributionTypeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StochasticDistributionTypeXmlParser: public XmlGroupParser + { + + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement probabilityDistributionSet + */ + class SubElementProbabilityDistributionSetParser: public IElementParser + { + private: + std::shared_ptr _probabilityDistributionSetXmlParser; + + public: + /** + * Constructor + */ + SubElementProbabilityDistributionSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement normalDistribution + */ + class SubElementNormalDistributionParser: public IElementParser + { + private: + std::shared_ptr _normalDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementNormalDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement logNormalDistribution + */ + class SubElementLogNormalDistributionParser: public IElementParser + { + private: + std::shared_ptr _logNormalDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementLogNormalDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement uniformDistribution + */ + class SubElementUniformDistributionParser: public IElementParser + { + private: + std::shared_ptr _uniformDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementUniformDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement poissonDistribution + */ + class SubElementPoissonDistributionParser: public IElementParser + { + private: + std::shared_ptr _poissonDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementPoissonDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement histogram + */ + class SubElementHistogramParser: public IElementParser + { + private: + std::shared_ptr _histogramXmlParser; + + public: + /** + * Constructor + */ + SubElementHistogramParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement userDefinedDistribution + */ + class SubElementUserDefinedDistributionParser: public IElementParser + { + private: + std::shared_ptr _userDefinedDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementUserDefinedDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StochasticDistributionTypeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement acts + */ + class SubElementActsParser: public IElementParser + { + private: + std::shared_ptr _actXmlParser; + + public: + /** + * Constructor + */ + SubElementActsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryboardImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement init + */ + class SubElementInitParser: public IElementParser + { + private: + std::shared_ptr _initXmlParser; + + public: + /** + * Constructor + */ + SubElementInitParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement stories + */ + class SubElementStoriesParser: public IElementParser + { + private: + std::shared_ptr _storyXmlParser; + + public: + /** + * Constructor + */ + SubElementStoriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement stopTrigger + */ + class SubElementStopTriggerParser: public IElementParser + { + private: + std::shared_ptr _triggerXmlParser; + + public: + /** + * Constructor + */ + SubElementStopTriggerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StoryboardXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a StoryboardElementStateConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class StoryboardElementStateConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + StoryboardElementStateConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SunImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SunXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SunXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a SynchronizeActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class SynchronizeActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement targetPositionMaster + */ + class SubElementTargetPositionMasterParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementTargetPositionMasterParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement targetPosition + */ + class SubElementTargetPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementTargetPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement finalSpeed + */ + class SubElementFinalSpeedParser: public IElementParser + { + private: + std::shared_ptr _finalSpeedXmlParser; + + public: + /** + * Constructor + */ + SubElementFinalSpeedParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + SynchronizeActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TargetDistanceSteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetDistanceSteadyStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TargetDistanceSteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TargetTimeSteadyStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TargetTimeSteadyStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TargetTimeSteadyStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TeleportActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TeleportActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TeleportActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeHeadwayConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeHeadwayConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeHeadwayConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeOfDayImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeOfDayXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeOfDayConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeOfDayConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeOfDayConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeReferenceImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeReferenceXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement none + */ + class SubElementNoneParser: public IElementParser + { + private: + std::shared_ptr _noneXmlParser; + + public: + /** + * Constructor + */ + SubElementNoneParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement timing + */ + class SubElementTimingParser: public IElementParser + { + private: + std::shared_ptr _timingXmlParser; + + public: + /** + * Constructor + */ + SubElementTimingParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeReferenceXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeToCollisionConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement timeToCollisionConditionTarget + */ + class SubElementTimeToCollisionConditionTargetParser: public IElementParser + { + private: + std::shared_ptr _timeToCollisionConditionTargetXmlParser; + + public: + /** + * Constructor + */ + SubElementTimeToCollisionConditionTargetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeToCollisionConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimeToCollisionConditionTargetImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimeToCollisionConditionTargetXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement entityRef + */ + class SubElementEntityRefParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimeToCollisionConditionTargetXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TimingImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TimingXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TimingXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficSourceAction + */ + class SubElementTrafficSourceActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSourceActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSourceActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSinkAction + */ + class SubElementTrafficSinkActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSinkActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSinkActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSwarmAction + */ + class SubElementTrafficSwarmActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSwarmActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSwarmActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficAreaAction + */ + class SubElementTrafficAreaActionParser: public IElementParser + { + private: + std::shared_ptr _trafficAreaActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficAreaActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficStopAction + */ + class SubElementTrafficStopActionParser: public IElementParser + { + private: + std::shared_ptr _trafficStopActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficStopActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficAreaImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement polygon + */ + class SubElementPolygonParser: public IElementParser + { + private: + std::shared_ptr _polygonXmlParser; + + public: + /** + * Constructor + */ + SubElementPolygonParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement roadRange + */ + class SubElementRoadRangeParser: public IElementParser + { + private: + std::shared_ptr _roadRangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRoadRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficAreaXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficAreaActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficAreaActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficDistribution + */ + class SubElementTrafficDistributionParser: public IElementParser + { + private: + std::shared_ptr _trafficDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficArea + */ + class SubElementTrafficAreaParser: public IElementParser + { + private: + std::shared_ptr _trafficAreaXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficAreaParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficAreaActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDefinitionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDefinitionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleCategoryDistribution + */ + class SubElementVehicleCategoryDistributionParser: public IElementParser + { + private: + std::shared_ptr _vehicleCategoryDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleCategoryDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement vehicleRoleDistribution + */ + class SubElementVehicleRoleDistributionParser: public IElementParser + { + private: + std::shared_ptr _vehicleRoleDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleRoleDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement controllerDistribution + */ + class SubElementControllerDistributionParser: public IElementParser + { + private: + std::shared_ptr _controllerDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementControllerDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficDefinitionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficDistributionEntry + */ + class SubElementTrafficDistributionEntryParser: public IElementParser + { + private: + std::shared_ptr _trafficDistributionEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDistributionEntryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficDistributionEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityDistribution + */ + class SubElementEntityDistributionParser: public IElementParser + { + private: + std::shared_ptr _entityDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trafficSignalControllerAction + */ + class SubElementTrafficSignalControllerActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalControllerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalControllerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficSignalStateAction + */ + class SubElementTrafficSignalStateActionParser: public IElementParser + { + private: + std::shared_ptr _trafficSignalStateActionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficSignalStateActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement phases + */ + class SubElementPhasesParser: public IElementParser + { + private: + std::shared_ptr _phaseXmlParser; + + public: + /** + * Constructor + */ + SubElementPhasesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalControllerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalControllerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalControllerConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalControllerConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalControllerConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalGroupStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalGroupStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalGroupStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalStateImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalStateXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSignalStateActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSignalStateActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSignalStateActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSinkActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSinkActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficDefinition + */ + class SubElementTrafficDefinitionParser: public IElementParser + { + private: + std::shared_ptr _trafficDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSinkActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSourceActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSourceActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficDefinition + */ + class SubElementTrafficDefinitionParser: public IElementParser + { + private: + std::shared_ptr _trafficDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficDistribution + */ + class SubElementTrafficDistributionParser: public IElementParser + { + private: + std::shared_ptr _trafficDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSourceActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficStopActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficStopActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficStopActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrafficSwarmActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrafficSwarmActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement centralObject + */ + class SubElementCentralObjectParser: public IElementParser + { + private: + std::shared_ptr _centralSwarmObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementCentralObjectParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficDefinition + */ + class SubElementTrafficDefinitionParser: public IElementParser + { + private: + std::shared_ptr _trafficDefinitionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDefinitionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trafficDistribution + */ + class SubElementTrafficDistributionParser: public IElementParser + { + private: + std::shared_ptr _trafficDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementTrafficDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement initialSpeedRange + */ + class SubElementInitialSpeedRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementInitialSpeedRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement directionOfTravelDistribution + */ + class SubElementDirectionOfTravelDistributionParser: public IElementParser + { + private: + std::shared_ptr _directionOfTravelDistributionXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectionOfTravelDistributionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrafficSwarmActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trailer + */ + class SubElementTrailerParser: public IElementParser + { + private: + std::shared_ptr _scenarioObjectXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trailerRef + */ + class SubElementTrailerRefParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrailerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement connectTrailerAction + */ + class SubElementConnectTrailerActionParser: public IElementParser + { + private: + std::shared_ptr _connectTrailerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementConnectTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement disconnectTrailerAction + */ + class SubElementDisconnectTrailerActionParser: public IElementParser + { + private: + std::shared_ptr _disconnectTrailerActionXmlParser; + + public: + /** + * Constructor + */ + SubElementDisconnectTrailerActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrailerActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerCouplerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerCouplerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrailerCouplerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrailerHitchImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrailerHitchXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrailerHitchXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement shape + */ + class SubElementShapeParser: public IElementParser + { + private: + std::shared_ptr _shapeXmlParser; + + public: + /** + * Constructor + */ + SubElementShapeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrajectoryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrajectoryCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryFollowingModeImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryFollowingModeXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrajectoryFollowingModeXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement orientation + */ + class SubElementOrientationParser: public IElementParser + { + private: + std::shared_ptr _orientationXmlParser; + + public: + /** + * Constructor + */ + SubElementOrientationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trajectoryRef + */ + class SubElementTrajectoryRefParser: public IElementParser + { + private: + std::shared_ptr _trajectoryRefXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryRefParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrajectoryPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TrajectoryRefImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TrajectoryRefXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement trajectory + */ + class SubElementTrajectoryParser: public IElementParser + { + private: + std::shared_ptr _trajectoryXmlParser; + + public: + /** + * Constructor + */ + SubElementTrajectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement catalogReference + */ + class SubElementCatalogReferenceParser: public IElementParser + { + private: + std::shared_ptr _catalogReferenceXmlParser; + + public: + /** + * Constructor + */ + SubElementCatalogReferenceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TrajectoryRefXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TransitionDynamicsImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TransitionDynamicsXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TransitionDynamicsXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TraveledDistanceConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TraveledDistanceConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TraveledDistanceConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TriggerImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggerXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement conditionGroups + */ + class SubElementConditionGroupsParser: public IElementParser + { + private: + std::shared_ptr _conditionGroupXmlParser; + + public: + /** + * Constructor + */ + SubElementConditionGroupsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TriggerXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a TriggeringEntitiesImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class TriggeringEntitiesXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement entityRefs + */ + class SubElementEntityRefsParser: public IElementParser + { + private: + std::shared_ptr _entityRefXmlParser; + + public: + /** + * Constructor + */ + SubElementEntityRefsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + TriggeringEntitiesXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UniformDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UniformDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement range + */ + class SubElementRangeParser: public IElementParser + { + private: + std::shared_ptr _rangeXmlParser; + + public: + /** + * Constructor + */ + SubElementRangeParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UniformDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UsedAreaImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UsedAreaXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement positions + */ + class SubElementPositionsParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UsedAreaXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement customCommandAction + */ + class SubElementCustomCommandActionParser: public IElementParser + { + private: + std::shared_ptr _customCommandActionXmlParser; + + public: + /** + * Constructor + */ + SubElementCustomCommandActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedAnimationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedAnimationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedAnimationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedComponentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedComponentXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedComponentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedDistributionXmlParser: public XmlSimpleContentParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + protected: + void SetContentProperty(const std::string content, std::shared_ptr object) override; + bool IsContentRequired() override; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedLightImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedLightXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedLightXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a UserDefinedValueConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class UserDefinedValueConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + UserDefinedValueConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueConstraintImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ValueConstraintXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueConstraintGroupImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueConstraintGroupXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement constraints + */ + class SubElementConstraintsParser: public IElementParser + { + private: + std::shared_ptr _valueConstraintXmlParser; + + public: + /** + * Constructor + */ + SubElementConstraintsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ValueConstraintGroupXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a ValueSetDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class ValueSetDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterValueSets + */ + class SubElementParameterValueSetsParser: public IElementParser + { + private: + std::shared_ptr _parameterValueSetXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterValueSetsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + ValueSetDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement setAction + */ + class SubElementSetActionParser: public IElementParser + { + private: + std::shared_ptr _variableSetActionXmlParser; + + public: + /** + * Constructor + */ + SubElementSetActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement modifyAction + */ + class SubElementModifyActionParser: public IElementParser + { + private: + std::shared_ptr _variableModifyActionXmlParser; + + public: + /** + * Constructor + */ + SubElementModifyActionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableAddValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableAddValueRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableAddValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableConditionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableConditionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableConditionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableDeclarationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableDeclarationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableDeclarationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableModifyActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement rule + */ + class SubElementRuleParser: public IElementParser + { + private: + std::shared_ptr _variableModifyRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementRuleParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableModifyActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableModifyRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableModifyRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement addValue + */ + class SubElementAddValueParser: public IElementParser + { + private: + std::shared_ptr _variableAddValueRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementAddValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement multiplyByValue + */ + class SubElementMultiplyByValueParser: public IElementParser + { + private: + std::shared_ptr _variableMultiplyByValueRuleXmlParser; + + public: + /** + * Constructor + */ + SubElementMultiplyByValueParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableModifyRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableMultiplyByValueRuleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableMultiplyByValueRuleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableMultiplyByValueRuleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VariableSetActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VariableSetActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VariableSetActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement parameterDeclarations + */ + class SubElementParameterDeclarationsParser: public IElementParser + { + private: + std::shared_ptr _parameterDeclarationXmlParser; + + public: + /** + * Constructor + */ + SubElementParameterDeclarationsParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement boundingBox + */ + class SubElementBoundingBoxParser: public IElementParser + { + private: + std::shared_ptr _boundingBoxXmlParser; + + public: + /** + * Constructor + */ + SubElementBoundingBoxParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement performance + */ + class SubElementPerformanceParser: public IElementParser + { + private: + std::shared_ptr _performanceXmlParser; + + public: + /** + * Constructor + */ + SubElementPerformanceParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement axles + */ + class SubElementAxlesParser: public IElementParser + { + private: + std::shared_ptr _axlesXmlParser; + + public: + /** + * Constructor + */ + SubElementAxlesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement properties + */ + class SubElementPropertiesParser: public IElementParser + { + private: + std::shared_ptr _propertiesXmlParser; + + public: + /** + * Constructor + */ + SubElementPropertiesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trailerHitch + */ + class SubElementTrailerHitchParser: public IElementParser + { + private: + std::shared_ptr _trailerHitchXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerHitchParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trailerCoupler + */ + class SubElementTrailerCouplerParser: public IElementParser + { + private: + std::shared_ptr _trailerCouplerXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerCouplerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement trailer + */ + class SubElementTrailerParser: public IElementParser + { + private: + std::shared_ptr _trailerXmlParser; + + public: + /** + * Constructor + */ + SubElementTrailerParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCatalogLocationImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCatalogLocationXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement directory + */ + class SubElementDirectoryParser: public IElementParser + { + private: + std::shared_ptr _directoryXmlParser; + + public: + /** + * Constructor + */ + SubElementDirectoryParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleCatalogLocationXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCategoryDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleCategoryDistributionEntries + */ + class SubElementVehicleCategoryDistributionEntriesParser: public IElementParser + { + private: + std::shared_ptr _vehicleCategoryDistributionEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleCategoryDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleCategoryDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleCategoryDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleCategoryDistributionEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleCategoryDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleComponentImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleComponentXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleComponentXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleLightImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleLightXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleLightXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleRoleDistributionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement vehicleRoleDistributionEntries + */ + class SubElementVehicleRoleDistributionEntriesParser: public IElementParser + { + private: + std::shared_ptr _vehicleRoleDistributionEntryXmlParser; + + public: + /** + * Constructor + */ + SubElementVehicleRoleDistributionEntriesParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleRoleDistributionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VehicleRoleDistributionEntryImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VehicleRoleDistributionEntryXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VehicleRoleDistributionEntryXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VertexImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VertexXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VertexXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a VisibilityActionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class VisibilityActionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement sensorReferenceSet + */ + class SubElementSensorReferenceSetParser: public IElementParser + { + private: + std::shared_ptr _sensorReferenceSetXmlParser; + + public: + /** + * Constructor + */ + SubElementSensorReferenceSetParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + VisibilityActionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WaypointImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WaypointXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement position + */ + class SubElementPositionParser: public IElementParser + { + private: + std::shared_ptr _positionXmlParser; + + public: + /** + * Constructor + */ + SubElementPositionParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + WaypointXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WeatherImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WeatherXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + /** + * A parser for subelement sun + */ + class SubElementSunParser: public IElementParser + { + private: + std::shared_ptr _sunXmlParser; + + public: + /** + * Constructor + */ + SubElementSunParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement fog + */ + class SubElementFogParser: public IElementParser + { + private: + std::shared_ptr _fogXmlParser; + + public: + /** + * Constructor + */ + SubElementFogParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement precipitation + */ + class SubElementPrecipitationParser: public IElementParser + { + private: + std::shared_ptr _precipitationXmlParser; + + public: + /** + * Constructor + */ + SubElementPrecipitationParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement wind + */ + class SubElementWindParser: public IElementParser + { + private: + std::shared_ptr _windXmlParser; + + public: + /** + * Constructor + */ + SubElementWindParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + /** + * A parser for subelement domeImage + */ + class SubElementDomeImageParser: public IElementParser + { + private: + std::shared_ptr _domeImageXmlParser; + + public: + /** + * Constructor + */ + SubElementDomeImageParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + WeatherXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WindImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WindXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + WindXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + + /** + * This is a automatic generated file according to the OpenSCENARIO specification version 1.3 + * Filling a WorldPositionImpl instance from an xml tree. + * + * @author RA Consulting OpenSCENARIO generation facility + */ + class WorldPositionXmlParser: public XmlComplexTypeParser + { + + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + private: + /** + * Parser for all subelements + */ + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + WorldPositionXmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + + } +} diff --git a/cpp/openScenarioLib/headers.cmake b/cpp/openScenarioLib/headers.cmake index 328b625f..965809ff 100644 --- a/cpp/openScenarioLib/headers.cmake +++ b/cpp/openScenarioLib/headers.cmake @@ -443,4 +443,103 @@ set( HEADERS_GENERATED_1_2_XMLEXPORTER "generated/v1_2/export/xml/OpenScenarioXmlExporterV1_2.h" ) set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_2_XMLEXPORTER} ) -endif (SUPPORT_OSC_1_2) \ No newline at end of file +endif (SUPPORT_OSC_1_2) + +################################################ +## V1_3 +################################ +if (SUPPORT_OSC_1_3) +# Headers hand crafted +set( HEADERS_LOADER_1_3 + "src/v1_3/loader/OpenScenarioProcessingHelperV1_3.h" + "src/v1_3/loader/XmlScenarioImportLoaderV1_3.h" + "src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.h" + "src/v1_3/loader/XmlScenarioLoaderV1_3.h" + "src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_LOADER_1_3} ) + +set( HEADERS_EXPRESSION_1_3 + "src/v1_3/expression/ExpressionResolverV1_3.h" + "src/v1_3/expression/ExpressionResolverStackV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_EXPRESSION_1_3} ) + +set( HEADERS_PARSER_1_3 + "src/v1_3/parser/CatalogReferenceParserContextV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_PARSER_1_3} ) + +set( HEADERS_CHECKER_1_3 + "src/v1_3/checker/VersionCheckerRuleV1_3.h" + "src/v1_3/checker/ParameterDeclarationCheckerV1_3.h" + "src/v1_3/checker/VariableCheckerV1_3.h" + "src/v1_3/checker/DeprecatedCheckerV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_CHECKER_1_3} ) + +################################ +# Headers generated +set( HEADERS_GENERATED_1_3_API + "generated/v1_3/api/EnumerationsV1_3.h" + "generated/v1_3/api/ApiClassInterfacesV1_3.h" + "generated/v1_3/api/OscInterfacesV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_API} ) + +set( HEADERS_GENERATED_1_3_API_WRITER + "generated/v1_3/api/writer/ApiClassWriterInterfacesV1_3.h" + "generated/v1_3/api/writer/ApiWriterInterfacesV1_3.h" + "generated/v1_3/api/writer/IOpenScenarioWriterFactoryV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_API_WRITER} ) + +set( HEADERS_GENERATED_1_3_COMMON + "generated/v1_3/common/OscConstantsV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_COMMON} ) + +set( HEADERS_GENERATED_1_3_CHECKER + "generated/v1_3/checker/IScenarioCheckerV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_CHECKER} ) + +set( HEADERS_GENERATED_1_3_CHECKER_MODEL + "generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.h" + "generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.h" + "generated/v1_3/checker/model/UnionCheckerRulesV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_CHECKER_MODEL} ) + +set( HEADERS_GENERATED_1_3_CHECKER_IMPL + "generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_CHECKER_IMPL} ) + +set( HEADERS_GENERATED_1_3_CHECKER_RANGE + "generated/v1_3/checker/range/RangeCheckerRulesV1_3.h" + "generated/v1_3/checker/range/RangeCheckerHelperV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_CHECKER_RANGE} ) + +set( HEADERS_GENERATED_1_3_CATALOG + "generated/v1_3/catalog/CatalogHelperV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_CATALOG} ) + +set( HEADERS_GENERATED_1_3_IMPL + "generated/v1_3/impl/ApiClassImplV1_3.h" + "generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_IMPL} ) + +set( HEADERS_GENERATED_1_3_XMLPARSER + "generated/v1_3/xmlParser/XmlParsersV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_XMLPARSER} ) + +set( HEADERS_GENERATED_1_3_XMLEXPORTER + "generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.h" +) +set( ALL_HEADERS ${ALL_HEADERS} ${HEADERS_GENERATED_1_3_XMLEXPORTER} ) +endif (SUPPORT_OSC_1_3) \ No newline at end of file diff --git a/cpp/openScenarioLib/sources.cmake b/cpp/openScenarioLib/sources.cmake index 2faa8f86..6f17061f 100644 --- a/cpp/openScenarioLib/sources.cmake +++ b/cpp/openScenarioLib/sources.cmake @@ -373,4 +373,92 @@ set( SOURCES_GENERATED_1_2_XMLEXPORTER # SOURCES_GENERATED_1_2_XMLEXPORTER_ ) set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_2_XMLEXPORTER} ) -endif (SUPPORT_OSC_1_2) \ No newline at end of file +endif (SUPPORT_OSC_1_2) + +################################################ +## V1_3 +################################ +if (SUPPORT_OSC_1_3) +# Sources hand crafted +set( SOURCES_V1_3_LOADER + "src/v1_3/loader/OpenScenarioProcessingHelperV1_3.cpp" + "src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.cpp" + "src/v1_3/loader/XmlScenarioImportLoaderV1_3.cpp" + "src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.cpp" + "src/v1_3/loader/XmlScenarioLoaderV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_V1_3_LOADER} ) + +set( SOURCES_V1_3_EXPRESSION + "src/v1_3/expression/ExpressionResolverV1_3.cpp" + "src/v1_3/expression/ExpressionResolverStackV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_V1_3_EXPRESSION} ) +set( SOURCES_V1_3_PARSER + "src/v1_3/parser/CatalogReferenceParserContextV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_V1_3_PARSER} ) + +set( SOURCES_V1_3_CHECKER + "src/v1_3/checker/ParameterDeclarationCheckerV1_3.cpp" + "src/v1_3/checker/VariableCheckerV1_3.cpp" + "src/v1_3/checker/DeprecatedCheckerV1_3.cpp" + "src/v1_3/checker/VersionCheckerRuleV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_V1_3_CHECKER} ) + +set( SOURCES_V1_3_CATALOG + "src/v1_3/catalog/CatalogCacheV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_V1_3_CATALOG} ) + +################################ +# Sources generated +set( SOURCES_GENERATED_1_3_API + "generated/v1_3/api/EnumerationsV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_API} ) + +set( SOURCES_GENERATED_1_3_CHECKER_MODEL + "generated/v1_3/checker/model/UnionCheckerRulesV1_3.cpp" + "generated/v1_3/checker/model/CardinalityCheckerRulesV1_3.cpp" + "generated/v1_3/checker/model/CardinalityCheckerHelperV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_CHECKER_MODEL} ) + +set( SOURCES_GENERATED_1_3_CHECKER_IMPL + "generated/v1_3/checker/impl/ScenarioCheckerImplV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_CHECKER_IMPL} ) + +set( SOURCES_GENERATED_1_3_CHECKER_RANGE + "generated/v1_3/checker/range/RangeCheckerRulesV1_3.cpp" + "generated/v1_3/checker/range/RangeCheckerHelperV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_CHECKER_RANGE} ) + +set( SOURCES_GENERATED_1_3_CATALOG + "generated/v1_3/catalog/CatalogHelperV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_CATALOG} ) + +set( SOURCES_GENERATED_1_3_IMPL + "generated/v1_3/impl/ApiClassImplV1_3.cpp" + "generated/v1_3/impl/OpenScenarioWriterFactoryImplV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_IMPL} ) + +set( SOURCES_GENERATED_1_3_XMLPARSER + "generated/v1_3/xmlParser/XmlParsers1V1_3.cpp" + "generated/v1_3/xmlParser/XmlParsers2V1_3.cpp" + "generated/v1_3/xmlParser/XmlParsers3V1_3.cpp" + "generated/v1_3/xmlParser/XmlParsers4V1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_XMLPARSER} ) + +set( SOURCES_GENERATED_1_3_XMLEXPORTER # SOURCES_GENERATED_1_3_XMLEXPORTER_ + "generated/v1_3/export/xml/OpenScenarioXmlExporterV1_3.cpp" +) +set( ALL_SOURCES ${ALL_SOURCES} ${SOURCES_GENERATED_1_3_XMLEXPORTER} ) + +endif (SUPPORT_OSC_1_3) \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.cpp b/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.cpp new file mode 100644 index 00000000..e3b5965a --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.cpp @@ -0,0 +1,209 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "CatalogCacheV1_3.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + CatalogCache::CatalogCache(std::shared_ptr& resourceLocator, std::shared_ptr& messageLogger) : _resourceLocator(resourceLocator), _messageLogger(messageLogger) {} + + void CatalogCache::AddCatalogFile(std::shared_ptr scenarioLoaderFactory) + { + _catalogFiles.push_back(scenarioLoaderFactory); + _isAnyCatalogToParse = true; + } + + std::shared_ptr CatalogCache::ImportCatalogElement(std::shared_ptr & catalogReference) + { + std::shared_ptr catalogElement = nullptr; + while (catalogElement == nullptr) + { + catalogElement = GetCatalogElementInternal(catalogReference); + if (catalogElement != nullptr || !_isAnyCatalogToParse) { + break; + } + else { + ParseNextCatalog(); + } + } + return catalogElement; + } + + void CatalogCache::ParseNextCatalog() + { + if (_currentLoaderFactoryIndex >= _catalogFiles.size()) + { + _isAnyCatalogToParse = false; + return; + } + else + { + // Parse Catalog + auto scenarioLoaderFactory = _catalogFiles[_currentLoaderFactoryIndex++]; + auto loader = scenarioLoaderFactory->CreateLoader(_resourceLocator); + std::shared_ptr openScenario = nullptr; + bool isSuccessfullyParsed = true; + + //auto messageLogger = std::make_shared(_messageLogger); + try + { + openScenario = std::static_pointer_cast(loader->Load(_messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + } + catch (ScenarioLoaderException& e) + { + (void)e; + // Ignore + isSuccessfullyParsed = false; + } + if (isSuccessfullyParsed && _messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ERROR).empty()) + { + auto catalogDefinition = openScenario->GetOpenScenarioCategory()->GetCatalogDefinition(); + if (catalogDefinition) + { + auto catalog = catalogDefinition->GetCatalog(); + if (catalog) + { + // Does Controller already exists + const auto kCatalogName = catalog->GetName(); + + auto catalogMap = _catalogElements[kCatalogName]; + + auto controllers = catalog->GetControllers(); + if (!controllers.empty()) + { + for (auto&& controller : controllers) + { + auto name = controller->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, controller)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto vehicles = catalog->GetVehicles(); + if (!vehicles.empty()) + { + for (auto&& vehicle : vehicles) + { + auto name = vehicle->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, vehicle)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto miscObjects = catalog->GetMiscObjects(); + if (!miscObjects.empty()) + { + for (auto&& miscObject : miscObjects) + { + auto name = miscObject->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, miscObject)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto routes = catalog->GetRoutes(); + if (!routes.empty()) + { + for (auto&& route : routes) + { + auto name = route->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, route)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto environments = catalog->GetEnvironments(); + if (!environments.empty()) + { + for (auto&& environment : environments) + { + auto name = environment->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, environment)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto pedestrians = catalog->GetPedestrians(); + if (!pedestrians.empty()) + { + for (auto&& pedestrian : pedestrians) + { + auto name = pedestrian->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, pedestrian)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto trajectories = catalog->GetTrajectories(); + if (!trajectories.empty()) + { + for (auto&& trajectory : trajectories) + { + auto name = trajectory->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, trajectory)); + } + _catalogElements[kCatalogName] = catalogMap; + } + + auto maneuvers = catalog->GetManeuvers(); + if (!maneuvers.empty()) + { + for (auto&& maneuver : maneuvers) + { + auto name = maneuver->GetName(); + if (!name.empty()) + catalogMap.emplace(std::make_pair(name, maneuver)); + } + _catalogElements[kCatalogName] = catalogMap; + } + } + + } + } + } + + } + + std::shared_ptr CatalogCache::GetCatalogElementInternal(std::shared_ptr catalogReference) + { + auto catalog = _catalogElements[catalogReference->GetCatalogName()]; + if (!catalog.empty()) + { + auto catalogElement = catalog[catalogReference->GetEntryName()]; + + if (catalogElement) + { + // Clone it for import + return std::dynamic_pointer_cast(std::dynamic_pointer_cast(catalogElement)->Clone()); + } + + } + return nullptr; + } + + }; +} diff --git a/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.h b/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.h new file mode 100644 index 00000000..ed1eb228 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/catalog/CatalogCacheV1_3.h @@ -0,0 +1,91 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#undef ERROR +#include +#include +#include "ApiClassInterfacesV1_3.h" +#include "IParserMessageLogger.h" +#include "BaseImpl.h" +#include "IResourceLocator.h" +#include "IScenarioLoader.h" +#include "IScenarioLoaderFactory.h" +#include "ErrorLevel.h" +#include "ScenarioLoaderException.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * A cache class for a catalog directory. It enables to search for a catalog element in a specific catalog. + * If a element is found, the search returns and stops without loading further files from the directory. + * The loaded files are stored in cache for later searches. + * @author Andreas Hege - RA Consulting + * + */ + + class CatalogCache + { + private: + std::map>> _catalogElements; + bool _isAnyCatalogToParse = false; + std::vector> _catalogFiles; + std::shared_ptr _resourceLocator; + unsigned int _currentLoaderFactoryIndex = 0; + std::shared_ptr _messageLogger; + + public: + /** + * Constructor + * @param resourceLocator locator for the directory to search into + * @param messageLogger to log messages during parsing the catalogs + */ + CatalogCache(std::shared_ptr& resourceLocator, std::shared_ptr& messageLogger); + + /** + * Adds a catalog file in its own loader factory. + * @param scenarioLoaderFactory the loader factory that is initialized with this file. + */ + void AddCatalogFile(std::shared_ptr scenarioLoaderFactory); + + /** + * Searches for a specific catalog element in the directory. + * @param catalogReference the catalog reference that represents the catalog element to be searched. + * @return the found catalog element or null if the catalog element is not faound in the directory + */ + std::shared_ptr ImportCatalogElement(std::shared_ptr & catalogReference); + + private: + /* + * parses the next catalog in the list. + */ + void ParseNextCatalog(); + + + protected: + /** + * Searches for a specific catalog element in the cache and returns a clone. + * @param catalogReference the catalog reference that represents the catalog element to be searched. + * @return the cloned catalog element or null if element is not in cache. + */ + std::shared_ptr GetCatalogElementInternal(std::shared_ptr catalogReference); + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/catalog/ICatalogReferenceProviderV1_3.h b/cpp/openScenarioLib/src/v1_3/catalog/ICatalogReferenceProviderV1_3.h new file mode 100644 index 00000000..e7bce7d7 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/catalog/ICatalogReferenceProviderV1_3.h @@ -0,0 +1,42 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "ApiClassInterfacesV1_3.h" +#include "MemLeakDetection.h" +#include + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class ICatalogReferenceProvider + { + public: + ICatalogReferenceProvider() = default; + virtual ~ICatalogReferenceProvider() = default; + /** + * Provides a list with all catalog references from a scenario a file. + * @return the list with the catalog references + */ + virtual std::vector> GetCatalogReferences() + { + return {}; + } + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.cpp b/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.cpp new file mode 100644 index 00000000..b6c1dfda --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.cpp @@ -0,0 +1,669 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DeprecatedCheckerV1_3.h" + +#include "PropertyTreeContext.h" + + + /** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void GeoPositionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetHeight() && object->IsSetAltitude()) + { + result.push_back("Property 'height' is deprecated and must not be used with property 'altitude'."); + } + if (object->IsSetLatitude() && object->IsSetLatitudeDeg()) + { + result.push_back("Property 'latitude' is deprecated and must not be used with property 'latitudeDeg'."); + } + if (object->IsSetLongitude() && object->IsSetLongitudeDeg()) + { + result.push_back("Property 'longitude' is deprecated and must not be used with property 'longitudeDeg'."); + } + } + + void GeoPositionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetHeight() && object->IsSetAltitude()) + { + result.push_back("Attribute 'height' is deprecated and must not be used with attribute 'altitude'."); + } + if (object->IsSetLatitude() && object->IsSetLatitudeDeg()) + { + result.push_back("Attribute 'latitude' is deprecated and must not be used with attribute 'latitudeDeg'."); + } + if (object->IsSetLongitude() && object->IsSetLongitudeDeg()) + { + result.push_back("Attribute 'longitude' is deprecated and must not be used with attribute 'longitudeDeg'."); + } + } + void GeoPositionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void GeoPositionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void OverrideBrakeActionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetValue() && object->GetBrakeInput() != nullptr) + { + result.push_back("Property 'value' is deprecated and must not be used with property 'brakeInput'."); + } + } + + void OverrideBrakeActionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetValue() && object->GetBrakeInput() != nullptr) + { + result.push_back("Attribute 'value' is deprecated and must not be used with element 'BrakePercent' or 'BrakeForce'."); + } + } + void OverrideBrakeActionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void OverrideBrakeActionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void OverrideGearActionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetNumber() && object->GetGear() != nullptr) + { + result.push_back("Property 'number' is deprecated and must not be used with property 'gear'."); + } + } + void OverrideGearActionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetNumber() && object->GetGear() != nullptr) + { + result.push_back("Attribute 'number' is deprecated and must not be used with attribute 'gear'."); + } + } + void OverrideGearActionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void OverrideGearActionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void OverrideParkingBrakeActionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetValue() && object->GetBrakeInput() != nullptr) + { + result.push_back("Property 'value' is deprecated and must not be used with property 'brakeInput'."); + } + + } + void OverrideParkingBrakeActionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetValue() && object->GetBrakeInput() != nullptr) + { + result.push_back("Attribute 'value' is deprecated and must not be used with element 'BrakePercent' or 'BrakeForce'."); + } + + } + void OverrideParkingBrakeActionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void OverrideParkingBrakeActionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void SunDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + // Do the checks + if (object->IsSetIntensity() && object->IsSetIlluminance()) + { + result.push_back("Property 'intensity' is deprecated and must not be used with property 'illuminance'."); + } + + } + void SunDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + // Do the checks + if (object->IsSetIntensity() && object->IsSetIlluminance()) + { + result.push_back("Attribute 'intensity' is deprecated and must not be used with attribute 'illuminance'."); + } + + } + void SunDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void SunDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void TrafficSourceActionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetVelocity() && object->IsSetSpeed()) + { + result.push_back("Property 'velocity' is deprecated and must not be used with property 'speed'."); + } + } + void TrafficSourceActionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetVelocity() && object->IsSetSpeed()) + { + result.push_back("Attribute 'velocity' is deprecated and must not be used with attribute 'speed'."); + } + } + void TrafficSourceActionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void TrafficSourceActionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void TrafficSwarmActionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetVelocity() && object->GetInitialSpeedRange() != nullptr) + { + result.push_back("Property 'velocity' is deprecated and must not be used with property 'initialSpeedRange'."); + } + } + void TrafficSwarmActionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetVelocity() && object->GetInitialSpeedRange() != nullptr) + { + result.push_back("Attribute 'velocity' is deprecated and must not be used with element 'InitialSpeedRange'."); + } + } + void TrafficSwarmActionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void TrafficSwarmActionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void WeatherDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetCloudState() && object->IsSetFractionalCloudCover()) + { + result.push_back("Property 'cloudState' is deprecated and must not be used with property 'fractionalCloudCover'."); + } + } + void WeatherDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetCloudState() && object->IsSetFractionalCloudCover()) + { + result.push_back("Attribute 'cloudState' is deprecated and must not be used with attribute 'fractionalCloudCover'."); + } + } + void WeatherDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void WeatherDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void ClothoidDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetCurvatureDot() && object->IsSetCurvaturePrime()) + { + result.push_back("Property 'curvatureDot' is deprecated and must not be used with property 'isSetCurvaturePrime'."); + } + + } + void ClothoidDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetCurvatureDot() && object->IsSetCurvaturePrime()) + { + result.push_back("Attribute 'curvatureDot' is deprecated and must not be used with attribute 'isSetCurvaturePrime'."); + } + + } + void ClothoidDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void ClothoidDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void DistanceConditionDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetAlongRoute() && object->IsSetCoordinateSystem()) + { + result.push_back("Property 'alongRoute' is deprecated and must not be used with property 'coordinateSystem'."); + } + if (object->IsSetAlongRoute() && object->IsSetRelativeDistanceType()) + { + result.push_back("Property 'alongRoute' is deprecated and must not be used with property 'relativeDistanceType'."); + } + } + + void DistanceConditionDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetAlongRoute() && object->IsSetCoordinateSystem()) + { + result.push_back("Attribute 'alongRoute' is deprecated and must not be used with attribute 'coordinateSystem'."); + } + if (object->IsSetAlongRoute() && object->IsSetRelativeDistanceType()) + { + result.push_back("Attribute 'alongRoute' is deprecated and must not be used with attribute 'relativeDistanceType'."); + } + } + void DistanceConditionDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void DistanceConditionDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + void PrecipitationDeprecationChecker::Check(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetIntensity() && object->IsSetPrecipitationIntensity()) + { + result.push_back("Property 'intensity' is deprecated and must not be used with property 'precipitationIntensity'."); + } + + } + void PrecipitationDeprecationChecker::CheckFileContext(std::vector& result, std::shared_ptr object) + { + // Do the checks + if (object->IsSetIntensity() && object->IsSetPrecipitationIntensity()) + { + result.push_back("Attribute 'intensity' is deprecated and must not be used with attribute 'precipitationIntensity'."); + } + + } + void PrecipitationDeprecationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + CheckFileContext(result, typedObject); + if (!result.empty()) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + if (locator) + { + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = FileContentMessage(*it, ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + } + + void PrecipitationDeprecationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + std::vector result{}; + Check(result, typedObject); + if (!result.empty()) + { + auto kContext = std::make_shared(typedObject); + for (auto it = result.begin(); it < result.end(); it++) + { + auto msg = TreeContentMessage(*it, ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + } + + + + + + DeprecatedChecker::DeprecatedChecker() + { + DeprecatedChecker::AddGeoPositionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddOverrideBrakeActionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddOverrideGearActionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddOverrideParkingBrakeActionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddSunCheckerRule(std::make_shared ()); + DeprecatedChecker::AddTrafficSourceActionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddTrafficSwarmActionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddWeatherCheckerRule(std::make_shared ()); + DeprecatedChecker::AddClothoidCheckerRule(std::make_shared ()); + DeprecatedChecker::AddDistanceConditionCheckerRule(std::make_shared ()); + DeprecatedChecker::AddPrecipitationCheckerRule(std::make_shared ()); + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.h b/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.h new file mode 100644 index 00000000..384a52bc --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/DeprecatedCheckerV1_3.h @@ -0,0 +1,169 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** */ +#pragma once + +#include "ICheckerRule.h" +#include "IParserMessageLogger.h" +#include "ParserHelper.h" +#include "ApiClassImplV1_3.h" +#include "ITreeMessageLogger.h" +#include +#include "ScenarioCheckerImplV1_3.h" +#include "MemLeakDetection.h" + +/** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + class GeoPositionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class OverrideBrakeActionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class OverrideGearActionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class OverrideParkingBrakeActionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, + std::shared_ptr object); + }; + + class SunDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class TrafficSourceActionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class TrafficSwarmActionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class WeatherDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class ClothoidDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class DistanceConditionDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + class PrecipitationDeprecationChecker : public ICheckerRule + { + + public: + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + private: + void Check(std::vector& result, std::shared_ptr object); + void CheckFileContext(std::vector& result, std::shared_ptr object); + }; + + + + class DeprecatedChecker : public ScenarioCheckerImpl + { + + public: + DeprecatedChecker(); + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.cpp b/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.cpp new file mode 100644 index 00000000..0f6b6581 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.cpp @@ -0,0 +1,109 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ParameterDeclarationCheckerV1_3.h" + +#include "PropertyTreeContext.h" + + + /** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void ParameterDeclarationChecker::ValidateParsing(std::string& value, const ParameterType parameterType) + { + if (!value.empty() && !ParserHelper::IsExpression(value) && !ParserHelper::IsParametrized(value)) + { + if (parameterType == ParameterType::INTEGER || parameterType == ParameterType::INT) + { + ParserHelper::ValidateInt(value); + } + else if (parameterType == ParameterType::UNSIGNED_INT) + { + ParserHelper::ValidateUnsignedInt(value); + } + else if (parameterType == ParameterType::UNSIGNED_SHORT) + { + ParserHelper::ValidateUnsignedShort(value); + } + else if (parameterType == ParameterType::DOUBLE) + { + ParserHelper::ValidateDouble(value); + } + else if (parameterType == ParameterType::DATE_TIME) + { + ParserHelper::ValidateDateTime(value); + } + else if (parameterType == ParameterType::BOOLEAN) + { + ParserHelper::ValidateBoolean(value); + } + } + } + + void ParameterDeclarationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + // Check whether the value is validatable: + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto value = typedObject->GetValue(); + const auto kParameterType = typedObject->GetParameterType(); + try + { + ValidateParsing(value, kParameterType); + } + catch (std::exception &e) + { + (void)e; + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + + if (locator) + { + auto msg = FileContentMessage("Value '" + value + "' cannot be parsed into '" + kParameterType.GetLiteral() + "'", ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE)); + messageLogger->LogMessage(msg); + } + } + } + + void ParameterDeclarationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto value = typedObject->GetValue(); + const auto kParameterType = typedObject->GetParameterType(); + try + { + ValidateParsing(value, kParameterType); + } + catch (std::exception &e) + { + (void)e; + const auto kContext = PropertyTreeContext::Create(object, OSC_CONSTANTS::ATTRIBUTE__VALUE); + auto msg = TreeContentMessage("Value '" + value + "' cannot be parsed into '" + kParameterType.GetLiteral() + "'", ERROR, kContext); + messageLogger->LogMessage(msg); + } + + }; + + + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.h b/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.h new file mode 100644 index 00000000..8b5257fe --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/ParameterDeclarationCheckerV1_3.h @@ -0,0 +1,45 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** */ +#pragma once + +#include "ICheckerRule.h" +#include "IParserMessageLogger.h" +#include "ParserHelper.h" +#include "ApiClassImplV1_3.h" +#include "ITreeMessageLogger.h" +#include "MemLeakDetection.h" + +/** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class ParameterDeclarationChecker : public ICheckerRule + { + private: + void ValidateParsing(std::string& value, const ParameterType parameterType); + public: + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.cpp b/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.cpp new file mode 100644 index 00000000..b85c3423 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.cpp @@ -0,0 +1,262 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VariableCheckerV1_3.h" + +#include "PropertyTreeContext.h" + + + /** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void VariableCheckerHelper::ValidateParsing(std::string value, const ParameterType& parameterType) + { + if (!value.empty()) + { + if (parameterType == ParameterType::INTEGER || parameterType == ParameterType::INT) + { + ParserHelper::ValidateInt(value); + } + else if (parameterType == ParameterType::UNSIGNED_INT) + { + ParserHelper::ValidateUnsignedInt(value); + } + else if (parameterType == ParameterType::UNSIGNED_SHORT) + { + ParserHelper::ValidateUnsignedShort(value); + } + else if (parameterType == ParameterType::DOUBLE) + { + ParserHelper::ValidateDouble(value); + } + else if (parameterType == ParameterType::DATE_TIME) + { + ParserHelper::ValidateDateTime(value); + } + else if (parameterType == ParameterType::BOOLEAN) + { + ParserHelper::ValidateBoolean(value); + } + } + } + + std::shared_ptr VariableCheckerHelper::GetVariableDeclarationByName(const std::set>& setToSearch, + const std::string& name) + { + std::shared_ptr result = nullptr; + for (auto it = setToSearch.begin(); it != setToSearch.end(); ++it) { + if ((*it)->GetName() == name) + { + result = *it; + break; + } + } + return result; + } + + + VariableDeclarationChecker::VariableDeclarationChecker(std::shared_ptr < std::set>> definedVariables) : definedVariables{ definedVariables } + { + + } + + + void VariableDeclarationChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + // Check whether the value is validatable: + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto value = typedObject->GetValue(); + const auto kParameterType = typedObject->GetVariableType(); + try + { + VariableCheckerHelper::ValidateParsing(value, kParameterType); + definedVariables->insert(typedObject); + } + catch (std::exception &e) + { + (void)e; + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + + if (locator) + { + auto msg = FileContentMessage("Value '" + value + "' cannot be parsed into '" + kParameterType.GetLiteral() + "'.", ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE)); + messageLogger->LogMessage(msg); + } + } + } + + void VariableDeclarationChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto value = typedObject->GetValue(); + const auto kParameterType = typedObject->GetVariableType(); + try + { + VariableCheckerHelper::ValidateParsing(value, kParameterType); + definedVariables->insert(typedObject); + } + catch (std::exception &e) + { + (void)e; + const auto kContext = PropertyTreeContext::Create(object, OSC_CONSTANTS::ATTRIBUTE__VALUE); + auto msg = TreeContentMessage("Value '" + value + "' cannot be parsed into '" + kParameterType.GetLiteral() + "'.", ERROR, kContext); + messageLogger->LogMessage(msg); + } + + }; + + VariableActionChecker::VariableActionChecker(std::shared_ptr < std::set>> definedVariables) : definedVariables{ definedVariables } + { + + } + void VariableActionChecker::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + // Check whether the value is validatable: + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto name = typedObject->GetVariableRef()->GetNameRef(); + + // Is Name defined + std::shared_ptr foundVariableDeclaration = VariableCheckerHelper::GetVariableDeclarationByName(*definedVariables, name); + if (foundVariableDeclaration == nullptr) + { + + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + + if (locator) + { + auto msg = FileContentMessage("Variable '" + name + "' is not defined.", ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF)); + messageLogger->LogMessage(msg); + } + + } else { + // Check the Action + // SetAction: value must be parsable due to data type + std::shared_ptr setAction = typedObject->GetSetAction(); + if (setAction != nullptr) + { + try + { + VariableCheckerHelper::ValidateParsing(setAction->GetValue(), foundVariableDeclaration->GetVariableType()); + } + catch (std::exception &e) + { + (void)e; + auto locator = std::static_pointer_cast(setAction->GetAdapter(typeid(ILocator).name())); + + if (locator) + { + auto msg = FileContentMessage("Value '" + setAction->GetValue() + "' cannot be parsed into '" + foundVariableDeclaration->GetVariableType().GetLiteral() + "'.", ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE)); + messageLogger->LogMessage(msg); + } + } + } + // VariableAddValueRule, VariableMultiplyByValueRule: Restrict type to numeric (no bool or dateTime or string) + + std::shared_ptr modifyAction = typedObject->GetModifyAction(); + if (modifyAction != nullptr && (modifyAction->GetRule()->GetAddValue() != nullptr || modifyAction->GetRule()->GetMultiplyByValue()) ) + { + auto locator = std::static_pointer_cast(modifyAction->GetAdapter(typeid(ILocator).name())); + + ParameterType parameterType = foundVariableDeclaration->GetVariableType(); + if (parameterType == ParameterType::DATE_TIME || parameterType == ParameterType::STRING || parameterType == ParameterType::BOOLEAN) + { + if (locator) + { + auto msg = FileContentMessage("Variable '" + name + "' must be of numeric type to use a ModifyAction.", ERROR, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + + } + } + + void VariableActionChecker::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { // Check whether the value is validatable: + if (!object) return; + auto typedObject = std::dynamic_pointer_cast (object); + + auto name = typedObject->GetVariableRef()->GetNameRef(); + + // Is Name defined + std::shared_ptr foundVariableDeclaration = VariableCheckerHelper::GetVariableDeclarationByName(*definedVariables, name); + if (foundVariableDeclaration == nullptr) + { + + auto kContext = PropertyTreeContext::Create(object, OSC_CONSTANTS::ATTRIBUTE__VARIABLE_REF); + auto msg = TreeContentMessage("Variable '" + name + "' is not defined.", ERROR, kContext); + messageLogger->LogMessage(msg); + + + } else { + // Check the Action + // SetAction: value must be parsable due to data type + std::shared_ptr setAction = typedObject->GetSetAction(); + if (setAction != nullptr) + { + try + { + VariableCheckerHelper::ValidateParsing(setAction->GetValue(), foundVariableDeclaration->GetVariableType()); + } + catch (std::exception &e) + { + (void)e; + auto kContext = PropertyTreeContext::Create(object, OSC_CONSTANTS::ATTRIBUTE__VALUE); + auto msg = TreeContentMessage("Value '" + setAction->GetValue() + "' cannot be parsed into '" + foundVariableDeclaration->GetVariableType().GetLiteral() + "'.", ERROR, kContext); + messageLogger->LogMessage(msg); + } + } + // VariableAddValueRule, VariableMultiplyByValueRule: Restrict type to numeric (no bool or dateTime or string) + + std::shared_ptr modifyAction = typedObject->GetModifyAction(); + if (modifyAction != nullptr && (modifyAction->GetRule()->GetAddValue() != nullptr || modifyAction->GetRule()->GetMultiplyByValue())) + { + + ParameterType parameterType = foundVariableDeclaration->GetVariableType(); + if (parameterType == ParameterType::DATE_TIME || parameterType == ParameterType::STRING || parameterType == ParameterType::BOOLEAN) + { + auto kContext = std::make_shared(modifyAction); + auto msg = TreeContentMessage("Variable '" + name + "' must be of numeric type to use a ModifyAction.", ERROR, kContext); + messageLogger->LogMessage(msg); + + + } + } + + } + + } + + + VariableChecker::VariableChecker() + { + std::shared_ptr>> definedVariables = std::make_shared>>(); + VariableChecker::AddVariableDeclarationCheckerRule(std::make_shared (definedVariables)); + VariableChecker::AddVariableActionCheckerRule(std::make_shared (definedVariables)); + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.h b/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.h new file mode 100644 index 00000000..6e38597a --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/VariableCheckerV1_3.h @@ -0,0 +1,81 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** */ +#pragma once + +#include "ICheckerRule.h" +#include "IParserMessageLogger.h" +#include "ParserHelper.h" +#include "ApiClassImplV1_3.h" +#include "ITreeMessageLogger.h" +#include +#include "ScenarioCheckerImplV1_3.h" +#include "MemLeakDetection.h" + +/** + * Checks Parameter declarations' value to be parsable (not empty value) + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + class VariableCheckerHelper + { + public: + static void ValidateParsing(std::string value, const ParameterType& parameterType); + static std::shared_ptr GetVariableDeclarationByName(const std::set>& setToSearch, const std::string& name); + + }; + + class VariableDeclarationChecker : public ICheckerRule + { + private: + std::shared_ptr >> definedVariables; + + // set of Strings + public: + VariableDeclarationChecker(std::shared_ptr < std::set>> definedVariables); + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + + }; + + class VariableActionChecker : public ICheckerRule + { + private: + std::shared_ptr < std::set>> definedVariables; + + + + public: + VariableActionChecker(std::shared_ptr < std::set>> definedVariables); + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + class VariableChecker : public ScenarioCheckerImpl + { + + public: + VariableChecker(); + + + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.cpp b/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.cpp new file mode 100644 index 00000000..47969de7 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.cpp @@ -0,0 +1,79 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VersionCheckerRuleV1_3.h" + +#include "PropertyTreeContext.h" + + + /** + * A checker rule for checking the version of the standard within a OpenSCENARIO file. + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + + bool VersionCheckerRule::IsRevValid(std::shared_ptr object) + { + if (!object) return false; + + auto typedObject = std::dynamic_pointer_cast (object); + + const auto kRevMajor = typedObject->GetRevMajor(); + const auto kRevMinor = typedObject->GetRevMinor(); + + return kRevMajor == _majorRev && kRevMinor == _minorRev; + } + + std::string VersionCheckerRule::GetMsg() + { + return "Major revision and minor revision are expected to be " + std::to_string(_majorRev) + " and " + std::to_string(_minorRev); + } + + VersionCheckerRule::VersionCheckerRule(const int majorRev, const int minorRev) : _majorRev(majorRev), _minorRev(minorRev) {} + + void VersionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!IsRevValid(object)) + { + auto locator = std::static_pointer_cast(object->GetAdapter(typeid(ILocator).name())); + + if (locator) + { + auto msg = FileContentMessage(GetMsg(), WARNING, locator->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + + void VersionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + if (!IsRevValid(object)) + { + std::vector propertyNames; + propertyNames.push_back(OSC_CONSTANTS::ATTRIBUTE__REV_MINOR); + propertyNames.push_back(OSC_CONSTANTS::ATTRIBUTE__REV_MAJOR); + const auto kContext = std::make_shared(object, propertyNames); + auto msg = TreeContentMessage(GetMsg(), WARNING, kContext); + messageLogger->LogMessage(msg); + } + + } + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.h b/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.h new file mode 100644 index 00000000..cc1d7dc5 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/checker/VersionCheckerRuleV1_3.h @@ -0,0 +1,56 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** */ +#pragma once + +#include "ICheckerRule.h" +#include "IParserMessageLogger.h" +#include "ITreeMessageLogger.h" +#include "ApiClassImplV1_3.h" +#include "ExportDefinitions.h" + +/** + * A checker rule for checking the version of the standard within a OpenSCENARIO file. + */ +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class VersionCheckerRule: public ICheckerRule + { + private: + int _majorRev; + int _minorRev; + + bool IsRevValid(std::shared_ptr object); + + std::string GetMsg(); + + public: + /** + * @param majorRev The expected major revision + * @param minorRev The expected minor revision + */ + OPENSCENARIOLIB_EXP VersionCheckerRule(const int majorRev, const int minorRev); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + } +} \ No newline at end of file diff --git a/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.cpp b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.cpp new file mode 100644 index 00000000..e28a0683 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.cpp @@ -0,0 +1,106 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include "ExpressionResolverStackV1_3.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + std::shared_ptr ExpressionResolverStack::FindExpression(std::string& parameterName) + { + const auto &kIt = _parameterValueLists.find(parameterName); + if (kIt != _parameterValueLists.end()) + { + std::shared_ptr>> expressionVector; + expressionVector = kIt->second; + // return the first occurance in the vector + return *expressionVector->begin(); + } + return nullptr; + } + + ExpressionResolverStack::ExpressionResolverStack() + { + _flatParameterValueSet = std::make_shared>>(std::map>{}); + + } + + ExpressionResolverStack::~ExpressionResolverStack() + { + } + + void ExpressionResolverStack::PushExpression(std::string name, std::shared_ptr expression) + { + // Is there already a vector + const auto &kIt = _parameterValueLists.find(name); + std::shared_ptr>> expressionVector; + + if (kIt != _parameterValueLists.end()) + { + expressionVector = kIt->second; + _flatParameterValueSet->erase(name); + }else + { + // insert into list + expressionVector = std::make_shared< std::vector >>(); + _parameterValueLists.insert(std::pair>>>(name, expressionVector)); + } + + expressionVector->insert(expressionVector->begin(), expression); + // Overwrite it in the flat list + _flatParameterValueSet->insert(std::pair < std::string, std::shared_ptr>(name, expression)); + // push it to the name stack + _nameStack.insert(_nameStack.begin(), name); + } + + void ExpressionResolverStack::PopExpression(int count) + { + for (int i = 0; i< count; i++) + { + // Get Name from name stack + std::string lastNameAdded = *_nameStack.begin(); + //Pop it from the stack + _nameStack.erase(_nameStack.begin()); + // Erase it from the lists + _flatParameterValueSet->erase(lastNameAdded); + const auto &kIt = _parameterValueLists.find(lastNameAdded); + std::shared_ptr>> expressionVector = kIt->second; + expressionVector->erase(expressionVector->begin()); + if (!expressionVector->empty()) + { + // insert the next from the list + _flatParameterValueSet->insert(std::pair < std::string, std::shared_ptr>(lastNameAdded, *expressionVector->begin())); + + }else + { + // delete the vector + _parameterValueLists.erase(lastNameAdded); + } + } + } + + std::shared_ptr>> ExpressionResolverStack::GetCurrentMap() + { + return _flatParameterValueSet; + } + } +} diff --git a/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.h b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.h new file mode 100644 index 00000000..0ab1e850 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverStackV1_3.h @@ -0,0 +1,84 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include +#include +#include "ApiClassImplV1_3.h" +#include "BaseImpl.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * A stack for expressions + */ + class ExpressionResolverStack + { + + private: + std::map>>> _parameterValueLists; + + std::shared_ptr >> _flatParameterValueSet; + + std::vector _nameStack; + + + /** + * @param parameterName name of the parameter the value is looked up + * @return the expressionValue + */ + std::shared_ptr FindExpression(std::string& parameterName); + + + public: + + /** + * Constructor + */ + ExpressionResolverStack(); + + /** + * Default Destructor + */ + virtual ~ExpressionResolverStack(); + + /** + * Pushes a parameter value set on the stack. Implementing scopes of values. + * The values are always looked up in the head of the stack first. + * @param name name of the expression + * @param expression expression to push + */ + void PushExpression(std::string name, std::shared_ptr expression); + + /** + * Remove the head of the stack + * @param count number of elements to be popped + */ + void PopExpression(int count); + + /** + * Returns the Expression Flat list + * @return flat map + */ + std::shared_ptr >> GetCurrentMap(); + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.cpp b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.cpp new file mode 100644 index 00000000..461e1c27 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.cpp @@ -0,0 +1,666 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include "ExpressionResolverV1_3.h" +#include +#include +#include +#include +#include +#include + +#include + +#include "ErrorLevel.h" +#include "FileContentMessage.h" +#include "IParserMessageLogger.h" +#include "BaseImpl.h" +#include "ApiClassImplV1_3.h" +#include "CatalogHelperV1_3.h" +#include "SimpleType.h" +#include "MemLeakDetection.h" +#include "OscExprEvaluatorFactory.h" +#include "SemanticException.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + bool ExpressionResolver::AlmostEqual(double x, double y, int ulp) + { + // https://en.cppreference.com/w/cpp/types/numeric_limits/epsilon + return std::fabs(x - y) <= std::numeric_limits::epsilon() * std::fabs(x + y) * ulp + // unless the result is subnormal + || std::fabs(x - y) < std::numeric_limits::min(); + } + std::shared_ptr ExpressionResolver::CreateExprValueFromParameterValue( + std::shared_ptr paramterValue) + { + std::shared_ptr result = nullptr; + SimpleType targetType = paramterValue->GetType(); + return OscExpression::ExprValue::CreateTypedValue(paramterValue->GetValue(), CreateExprTypeFromSimpleType(targetType)); + } + + + std::shared_ptr ExpressionResolver::CreateExprTypeFromSimpleType( + SimpleType& actualSimpleType) + { + std::shared_ptr result = nullptr; + switch (actualSimpleType) + { + case STRING: + result = OscExpression::ExprType::GetStringType(); + break; + + case DOUBLE: + + result = OscExpression::ExprType::GetDoubleType(); + break; + + case INT: + + result = OscExpression::ExprType::GetIntType(); + break; + + case UNSIGNED_INT: + + result = OscExpression::ExprType::GetUnsignedIntType(); + break; + + case UNSIGNED_SHORT: + + result = OscExpression::ExprType::GetUnsignedShortType(); + break; + + case BOOLEAN: + + result = OscExpression::ExprType::GetBooleanType(); + break; + + case DATE_TIME: + result = OscExpression::ExprType::GetDateTimeType(); + break; + + case ENUM_TYPE: + result = OscExpression::ExprType::GetStringType(); + break; + + default: + break; + } + return result; + } + + void ExpressionResolver::ResolveInternal(std::shared_ptr& logger, std::shared_ptr expressionObject, const bool logUnresolvableParameter) + { + auto attributeKeys = expressionObject->GetParameterizedAttributeKeys(); + + for (auto&& attributeKey : attributeKeys) + { + auto expression = expressionObject->GetParameterNameFromAttribute(attributeKey); + std::shared_ptr targetType= nullptr; + bool isTypedStringAttribute = expressionObject->IsTypedStringAttribute(attributeKey) && ParserHelper::IsExpression(expression); + if (isTypedStringAttribute) + { + targetType = nullptr; + + }else + { + SimpleType simpleTargetType = expressionObject->GetTypeFromAttributeName(attributeKey); + targetType = CreateExprTypeFromSimpleType(simpleTargetType); + } + + std::shared_ptr evaluator = OscExpression::OscExprEvaluatorFactory::CreateOscExprEvaluator(_expressionResolverStack->GetCurrentMap(), targetType); + try { + std::shared_ptr value = evaluator->Evaluate(expression); + + + if(isTypedStringAttribute) + { + // targetIsString, so resolve String attribute + auto valueString = value->ToString(); + expressionObject->ResolveStringExpression(attributeKey, valueString); + }else if (targetType == OscExpression::ExprType::GetDoubleType()) + { + double doubleValue = value->getDoubleValue(); + expressionObject->ResolveDoubleExpression(attributeKey, doubleValue); + } + else if (targetType == OscExpression::ExprType::GetIntType()) + { + + int intValue = (int) value->getDoubleValue(); + expressionObject->ResolveIntExpression(attributeKey, intValue); + } + else if (targetType == OscExpression::ExprType::GetUnsignedIntType()) + { + unsigned int unsignedIntValue = (unsigned int)value->getDoubleValue(); + expressionObject->ResolveUnsignedIntExpression(attributeKey, unsignedIntValue); + } + else if (targetType == OscExpression::ExprType::GetUnsignedShortType()) + { + unsigned short unsignedShortValue = (unsigned short)value->getDoubleValue(); + expressionObject->ResolveUnsignedShortExpression(attributeKey, unsignedShortValue); + } + else + { + std::string stringValue = value->ToString(); + expressionObject->ResolveParameter(logger, attributeKey, stringValue); + + } + } catch (OscExpression::SemanticException& s) + { + std::shared_ptr textMarker = expressionObject->GetTextmarker(attributeKey); + Textmarker newTextmarker = Textmarker(textMarker->GetLine(), textMarker->GetColumn() + static_cast(s.GetColumn()), textMarker->GetFilename()); + // Add log Message + auto msg = FileContentMessage(s.GetErrorMessage(), ERROR, newTextmarker); + logger->LogMessage(msg); + + } + } + } + + bool ExpressionResolver::ValidateParameterConstraintGroups(std::shared_ptr& logger, + std::shared_ptr parameterResolvedValue, std::string parameterName, + std::shared_ptr parameterType, + std::vector> constraintGroups) + { + std::vector> gatheredMessages = std::vector>(); + bool result = false; + if (constraintGroups.empty()) + { + // No contraints => Validation Succeeds + result = true; + }else + { + for (std::shared_ptr valueConstraintGroup : constraintGroups) + { + result = result || ValidateParameterConstraints(logger,gatheredMessages, parameterResolvedValue, parameterName, parameterType, valueConstraintGroup); + } + + if (!result) + { + // None of the validation groups succeeded, log all the info messages + for (auto msg : gatheredMessages) + { + logger->LogMessage(*msg); + } + } + } + return result; + + } + + bool ExpressionResolver::ValidateParameterConstraints(std::shared_ptr& logger, std::vector>& gatheredMessages, + std::shared_ptr parameterResolvedValue, std::string parameterName, + std::shared_ptr parameterType, + std::shared_ptr constraintGroup) + { + bool result = true; + if (constraintGroup == nullptr || constraintGroup->GetConstraints().size() == 0) + { + // No constraints to be tested + result = true; + } + else + { + for (std::shared_ptr valueConstraint : constraintGroup->GetConstraints()) + { + // Test the constraint + bool isConstrainedViolated = ValidateSingleParameterConstraint(logger, parameterResolvedValue, parameterName, parameterType, valueConstraint); + if (!isConstrainedViolated) + { + // Skip the validations (like in and operation). Do not execute the terms after the first false. + auto locator = std::static_pointer_cast(valueConstraint->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + if (locator != nullptr) + { + std::shared_ptr msg = std::make_shared("Parameter constraint for parameter '" + parameterName + "' is violated. Value is '" + parameterResolvedValue->ToString() + "'.", ErrorLevel::INFO, locator->GetStartMarker()); + gatheredMessages.insert(gatheredMessages.end(), msg); + } + result = false; + break; + } + } + } + return result; + } + bool ExpressionResolver::ValidateSingleParameterConstraint( + std::shared_ptr& logger, + std::shared_ptr parameterResolvedValue, + std::string parameterName, + std::shared_ptr parameterType, + std::shared_ptr constraint) + { + // First, check whether the constraint value can be converted into the targetData type; + std::shared_ptr constraintValue = OscExpression::ExprValue::CreateTypedValue(constraint->GetValue(), parameterType); + parameterResolvedValue = OscExpression::ExprValue::CreateTypedValue(parameterResolvedValue->ToString(), parameterResolvedValue->GetExprType()); + if (constraintValue == nullptr) + { + auto locator = std::static_pointer_cast(constraint->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + if (locator != nullptr) + { + auto msg = FileContentMessage("Value of constraint for parameter '" + parameterName + "' cannot be converted to '" + parameterType->GetLiteral() + "' ("+ constraint->GetValue() +").", ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE)); + logger->LogMessage(msg); + } + return false; + } + + bool result = false; + // Now compare + Rule rule = constraint->GetRule(); + if (parameterType == OscExpression::ExprType::GetDoubleType()) + { + double firstOperand = parameterResolvedValue->getDoubleValue(); + double secondOperand = constraintValue->getDoubleValue(); + if (rule == Rule::RuleEnum::EQUAL_TO || rule == Rule::RuleEnum::NOT_EQUAL_TO) + { + bool equalResult = AlmostEqual(firstOperand, secondOperand); + result = rule == Rule::RuleEnum::EQUAL_TO ? equalResult : !equalResult; + + }else if (rule == Rule::RuleEnum::LESS_THAN) + { + result = firstOperand < secondOperand; + } + else if (rule == Rule::RuleEnum::LESS_OR_EQUAL) + { + + result = firstOperand < secondOperand || AlmostEqual(firstOperand, secondOperand); + + } + else if (rule == Rule::RuleEnum::GREATER_THAN) + { + result = firstOperand > secondOperand; + } + else if (rule == Rule::RuleEnum::GREATER_OR_EQUAL) + { + result = firstOperand >= secondOperand || AlmostEqual(firstOperand, secondOperand); ; + } + + } + else if (parameterType == OscExpression::ExprType::GetUnsignedIntType() + || parameterType == OscExpression::ExprType::GetUnsignedShortType() + || parameterType == OscExpression::ExprType::GetIntType()) + { + if (rule == Rule::RuleEnum::EQUAL_TO) + { + + result = ((long long) parameterResolvedValue->getDoubleValue()) == ((long long)constraintValue->getDoubleValue()); + + } + else if (rule == Rule::RuleEnum::LESS_THAN) + { + result = ((long long)parameterResolvedValue->getDoubleValue()) < ((long long)constraintValue->getDoubleValue()); + } + else if (rule == Rule::RuleEnum::LESS_OR_EQUAL) + { + + result = ((long long)parameterResolvedValue->getDoubleValue()) <= ((long long)constraintValue->getDoubleValue()); + + } + else if (rule == Rule::RuleEnum::GREATER_THAN) + { + result = ((long long)parameterResolvedValue->getDoubleValue()) > ((long long)constraintValue->getDoubleValue()); + } + else if (rule == Rule::RuleEnum::GREATER_OR_EQUAL) + { + result = ((long long)parameterResolvedValue->getDoubleValue()) >= ((long long)constraintValue->getDoubleValue()); + } + else if (rule == Rule::RuleEnum::NOT_EQUAL_TO) + { + result = ((long long)parameterResolvedValue->getDoubleValue()) != ((long long)constraintValue->getDoubleValue()); + } + } + + else if (parameterType == OscExpression::ExprType::GetBooleanType()) + { + if (rule == Rule::RuleEnum::EQUAL_TO) + { + result = parameterResolvedValue->GetBoolValue() == constraintValue->GetBoolValue(); + } + else if (rule == Rule::RuleEnum::LESS_THAN) + { + result = parameterResolvedValue->GetBoolValue() < constraintValue->GetBoolValue(); + } + else if (rule == Rule::RuleEnum::LESS_OR_EQUAL) + { + + result = parameterResolvedValue->GetBoolValue() <= constraintValue->GetBoolValue(); + + } + else if (rule == Rule::RuleEnum::GREATER_THAN) + { + result = parameterResolvedValue->GetBoolValue() > constraintValue->GetBoolValue(); + } + else if (rule == Rule::RuleEnum::GREATER_OR_EQUAL) + { + result = parameterResolvedValue->GetBoolValue() >= constraintValue->GetBoolValue(); + } + else if (rule == Rule::RuleEnum::NOT_EQUAL_TO) + { + result = parameterResolvedValue->GetBoolValue() != constraintValue->GetBoolValue(); + } + } + else if (parameterType == OscExpression::ExprType::GetStringType()) + { + if (rule == Rule::RuleEnum::EQUAL_TO) + { + result = parameterResolvedValue->ToString() == constraintValue->ToString(); + } + else if (rule == Rule::RuleEnum::LESS_THAN) + { + result = parameterResolvedValue->ToString() < constraintValue->ToString(); + } + else if (rule == Rule::RuleEnum::LESS_OR_EQUAL) + { + + result = parameterResolvedValue->ToString() <= constraintValue->ToString(); + + } + else if (rule == Rule::RuleEnum::GREATER_THAN) + { + result = parameterResolvedValue->ToString() > constraintValue->ToString(); + } + else if (rule == Rule::RuleEnum::GREATER_OR_EQUAL) + { + result = parameterResolvedValue->ToString() >= constraintValue->ToString(); + } + else if (rule == Rule::RuleEnum::NOT_EQUAL_TO) + { + result = parameterResolvedValue->ToString() != constraintValue->ToString(); + } + } + else if (parameterType == OscExpression::ExprType::GetDateTimeType()) + { + DateTime dateTimeParam; + DateTime dateTimeConstraintValue; + std::string dateTimeString = parameterResolvedValue->ToString(); + DateTimeParser::ToDateTime(dateTimeString, dateTimeParam); + dateTimeString = constraintValue->ToString(); + DateTimeParser::ToDateTime(dateTimeString, dateTimeConstraintValue); + + + if (rule == Rule::RuleEnum::EQUAL_TO) + { + result = dateTimeParam == dateTimeConstraintValue; + } + else if (rule == Rule::RuleEnum::NOT_EQUAL_TO) + { + result = dateTimeParam != dateTimeConstraintValue; + } + else if (rule == Rule::RuleEnum::LESS_THAN) + { + result = dateTimeParam < dateTimeConstraintValue; + } + else if (rule == Rule::RuleEnum::LESS_OR_EQUAL) + { + result = dateTimeParam <= dateTimeConstraintValue; + } + else if (rule == Rule::RuleEnum::GREATER_THAN) + { + result = dateTimeParam > dateTimeConstraintValue; + } + else if (rule == Rule::RuleEnum::GREATER_OR_EQUAL) + { + result = dateTimeParam >= dateTimeConstraintValue; + } + + } + + return result; + } + + ExpressionResolver::ExpressionResolver() + { + _expressionResolverStack = std::make_shared(); + } + + bool ExpressionResolver::OverrideGlobalParameterWithInjectedParameter(std::shared_ptr parameterValue, std::shared_ptr logger, std::map& injectedParameters, std::shared_ptr parameterDeclaration) + { + bool result = false; + auto locator = std::static_pointer_cast(parameterDeclaration->GetAdapter(typeid(ILocator).name())); + if (!locator) + { + return false; + } + + //auto temp = locator-> + Textmarker textmarker = locator->GetStartMarker(); + + auto name = parameterDeclaration->GetName(); + if (name == "testInteger") + { + name = "testInteger"; + } + auto injectedValue = injectedParameters[name]; + if (!injectedValue.empty()) + { + auto typeName = parameterDeclaration->GetParameterType(); + try + { + if (typeName == ParameterType::UNSIGNED_INT) + { + ParserHelper::ValidateUnsignedInt(injectedValue); + } + else if (typeName == ParameterType::INTEGER || typeName == ParameterType::INT) + { + ParserHelper::ValidateInt(injectedValue); + } + else if (typeName == ParameterType::UNSIGNED_SHORT) + { + ParserHelper::ValidateUnsignedShort(injectedValue); + } + else if (typeName == ParameterType::DATE_TIME) + { + ParserHelper::ValidateDateTime(injectedValue); + } + else if (typeName == ParameterType::BOOLEAN) + { + ParserHelper::ValidateBoolean(injectedValue); + } + else if (typeName == ParameterType::DOUBLE) + { + ParserHelper::ValidateDouble(injectedValue); + } + parameterValue->SetValue(injectedValue); + result = true; + } + catch (std::exception& e) + { + auto msg = FileContentMessage("Injected parameter '" + name + "': " + e.what() + " Injected parameter is ignored.", ERROR, textmarker); + logger->LogMessage(msg); + result = false; + } + + } + return result; + } + + void ExpressionResolver::LogParameterConstraintError(std::shared_ptr& logger, std::shared_ptr parameterDeclaration) + { + std::string parameterName = parameterDeclaration->GetName(); + auto locator = std::static_pointer_cast(parameterDeclaration->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + if (locator != nullptr) + { + auto msg = FileContentMessage("Parameter validation with value constraint groups for parameter '" + parameterName + "' fail.", ErrorLevel::ERROR, locator->GetStartMarker()); + logger->LogMessage(msg); + } + } + void ExpressionResolver::LogParameterTypeError(std::shared_ptr& logger, std::shared_ptr parameterDeclaration) + { + std::string parameterName = parameterDeclaration->GetName(); + std::string parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + std::string parameterValue = parameterDeclaration->GetValue(); + + auto locator = std::static_pointer_cast(parameterDeclaration->GetAdapter(typeid(NET_ASAM_OPENSCENARIO::ILocator).name())); + if (locator != nullptr) + { + auto msg = FileContentMessage("Parameter '" + parameterName + "' cannot be converted into type '"+parameterType +"' ('"+ parameterValue +"').", ErrorLevel::ERROR, locator->GetStartMarkerOfProperty(OSC_CONSTANTS::ATTRIBUTE__VALUE)); + logger->LogMessage(msg); + } + } + void ExpressionResolver::Resolve(std::shared_ptr& logger, std::shared_ptr baseImpl, std::map& injectedParameters, bool logUnresolvableParameter) + { + std::map emptyMap; + + //Resolve the object's attribute BEFORE evaluating the possible ParameterDeclarations + ResolveInternal(logger, baseImpl, logUnresolvableParameter); + + std::set notUsedInjectedParameters; + + if (std::dynamic_pointer_cast(baseImpl) != nullptr) + { + // track the injected parameters + for (auto&& elm : injectedParameters) + { + notUsedInjectedParameters.insert(elm.first); + } + } + + size_t paramsDefinitionSize = 0; + auto children = baseImpl->GetChildren(); + + + if (!children.empty()) + { + for (auto&& child : children) + { + // Resolve the child element + Resolve(logger, child, injectedParameters, logUnresolvableParameter); + if (child->GetModelType() == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + auto parameterDeclaration = std::dynamic_pointer_cast(child); + std::shared_ptr exprValue = nullptr; + std::string parameterName = parameterDeclaration->GetName(); + + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), child->GetParameterType(parameterType), parameterDeclaration->GetValue()); + + if (!injectedParameters.empty() && (std::dynamic_pointer_cast(baseImpl) != nullptr || std::dynamic_pointer_cast(baseImpl) != nullptr)) + { + // override parameter values with injected parameters + if (OverrideGlobalParameterWithInjectedParameter(parameterValue, logger, injectedParameters, parameterDeclaration)) + { + // Is overriden + notUsedInjectedParameters.erase(parameterValue->GetName()); + } + } + + exprValue = CreateExprValueFromParameterValue(parameterValue); + if (exprValue != nullptr) + { + // Insert it and potentially override it + if (!ValidateParameterConstraintGroups(logger, exprValue, parameterName, OscExpression::ExprType::GetFromLiteral(parameterType), parameterDeclaration->GetConstraintGroups())) + { + LogParameterConstraintError(logger, parameterDeclaration); + } + _expressionResolverStack->PushExpression(parameterDeclaration->GetName(), exprValue); + paramsDefinitionSize++; + } else + { + LogParameterTypeError(logger, parameterDeclaration); + } + + + } + + } + + if (std::dynamic_pointer_cast(baseImpl) != nullptr) + { + // not used Parameters + for (std::string name : notUsedInjectedParameters) + { + auto locator = std::static_pointer_cast(baseImpl->GetAdapter(typeid(ILocator).name())); + if (locator) + { + Textmarker textmarker = locator->GetStartMarker(); + auto msg = FileContentMessage("Injected parameter '" + name + "' must be declared as a global parameter. Injected parameter is ignored.", WARNING, textmarker); + logger->LogMessage(msg); + } + } + } + } + + _expressionResolverStack->PopExpression(static_cast(paramsDefinitionSize)); + + } + + + + void ExpressionResolver::ResolveWithParameterAssignments(std::shared_ptr& logger, std::shared_ptr& catalogElement, const std::map parameterAssignments) + { + auto baseImpl = std::dynamic_pointer_cast(catalogElement); + + if (baseImpl == nullptr) + return; + + size_t paramsDefinitionSize = 0; + + ResolveInternal(logger, baseImpl, false); + auto children = baseImpl->GetChildren(); + if (!children.empty()) + { + for (auto&& child : children) + { + std::map emptyMap; + + Resolve(logger, child, emptyMap,false); + // if ParameterDefinition type + if (child->GetModelType() == OSC_CONSTANTS::ELEMENT__PARAMETER_DECLARATION) + { + // Resolve the value if value is an expression + auto parameterDeclaration = std::dynamic_pointer_cast(child); + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), child->GetParameterType(parameterType), parameterDeclaration->GetValue()); + + const auto kIt = parameterAssignments.find(parameterValue->GetName()); + if (kIt != parameterAssignments.end()) + { + parameterValue->SetValue(kIt->second); + } + + std::shared_ptr exprValue = CreateExprValueFromParameterValue(parameterValue); + + exprValue = CreateExprValueFromParameterValue(parameterValue); + if (exprValue != nullptr) + { + // Insert it and potentially override it + if (!ValidateParameterConstraintGroups(logger, exprValue, parameterValue->GetName(), OscExpression::ExprType::GetFromLiteral(parameterType), parameterDeclaration->GetConstraintGroups())) + { + LogParameterConstraintError(logger, parameterDeclaration); + } + _expressionResolverStack->PushExpression(parameterValue->GetName(), exprValue); + paramsDefinitionSize++; + } + else + { + LogParameterTypeError(logger, parameterDeclaration); + } + + + } + } + } + + _expressionResolverStack->PopExpression(static_cast(paramsDefinitionSize)); + + } + + } +} diff --git a/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.h b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.h new file mode 100644 index 00000000..07865d4e --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/expression/ExpressionResolverV1_3.h @@ -0,0 +1,166 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include +#include +#include "OscInterfacesV1_3.h" +#include "IParserMessageLogger.h" +#include "ApiClassImplV1_3.h" +#include "BaseImpl.h" +#include "SimpleType.h" +#include "ExpressionResolverStackV1_3.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * Resolves all parameter of a parameterized object + */ + class ExpressionResolver + { + + private: + std::shared_ptr _expressionResolverStack;; + /* + * Test equal with epsilon (See https://en.cppreference.com/w/cpp/types/numeric_limits/epsilon) + * @param x first operand + * @param y first operand + * return true if both operands are seen as equal. + */ + bool AlmostEqual(double x, double y, int ulp = 3); + /** + * Adapter function that creates a ExprValue for a ParameterValue. + * @param paramterValue to log messages + * @return the created ExprValue + */ + std::shared_ptr CreateExprValueFromParameterValue(std::shared_ptr paramterValue); + + /** + * Adapter function that creates a ExprValue for a ParameterValue. + * @param actualSimpleType to log messages + * @return the created ExprValue + */ + std::shared_ptr CreateExprTypeFromSimpleType(SimpleType& actualSimpleType); + + /** + * Resolves all parameters of a parameterized object. + * @param logger to log messages + * @param expressionObject the expression object + * @param logUnresolvableParameter a flag whether unresolvable parameters should be logged. + */ + void ResolveInternal(std::shared_ptr& logger, std::shared_ptr expressionObject, const bool logUnresolvableParameter); + /** + * Validates the parameter constraint groups. Puts the error messages to a list and add them to the logger if all constraint groups fail. + * This represents an OR operation between the parameter constraint groups. + * @param logger to log messages + * @param parameterResolvedValue the resolvedValue for the parameter + * @param parameterName name of the parameter + * @param parameterType the type of the parameter + * @param constraintGroups the vector with the constraint groups + * @return false if all groups fail to validate (OR) + */ + bool ValidateParameterConstraintGroups(std::shared_ptr& logger, + std::shared_ptr parameterResolvedValue, + std::string parameterName, + std::shared_ptr parameterType, + std::vector> + constraintGroups); + + /** + * Validates the parameter constraints + * @param logger to log messages + * @param gatheredMessages messages to gather form the validation + * @param parameterResolvedValue the resolvedValue for the parameter + * @param parameterName name of the parameter + * @param parameterType the type of the parameter + * @param constraintGroup the constraintGroup + * @return false if the group fails to validate (any constraint, AND) + */ + bool ValidateParameterConstraints(std::shared_ptr& logger, std::vector>& gatheredMessages, std::shared_ptr parameterResolvedValue, std::string parameterName, std::shared_ptr parameterType, std::shared_ptr constraintGroup); + /** + * Validates the parameter constraints + * @param logger to log messages + * @param parameterResolvedValue the resolvedValue for the parameter + * @param parameterName name of the parameter + * @param parameterType the type of the parameter + * @param constraint the constraint + * @return fasle if validation of the single constraint fails + */ + bool ValidateSingleParameterConstraint(std::shared_ptr& logger, + std::shared_ptr parameterResolvedValue, + std::string parameterName, + std::shared_ptr parameterType, + std::shared_ptr constraint); + + public: + + /** + * Constructor + */ + ExpressionResolver(); + + /** + * Default Destructor + */ + virtual ~ExpressionResolver() = default; + + + + private: + + /** + * Checks the data type and overrides the values in the parametervalues. + * + * @param parameterDefinition the parameter value to override + * @param logger the logger to pick up the errors and warnings + * @param injectedParameters the injected parameters + * @param parameterDeclaration the parameterDefinition with the global parameter declarations + * @return true if an injected parameter overrides the parameter definition + */ + bool OverrideGlobalParameterWithInjectedParameter(std::shared_ptr parameterDefinition, + std::shared_ptr logger, + std::map& injectedParameters, + std::shared_ptr parameterDeclaration); + void LogParameterConstraintError(std::shared_ptr& logger, + std::shared_ptr parameterDeclaration); + void LogParameterTypeError(std::shared_ptr& logger, + std::shared_ptr parameterDeclaration); + + public: + /** + * + * @param logger logger to log messages + * @param baseImpl instance of BaseImpl for which the parameters should be resolved. + * @param injectedParameters the injected parameters + * @param logUnresolvableParameter a flag whether unresolvable parameters should be logged. + */ + void Resolve(std::shared_ptr& logger, std::shared_ptr baseImpl, std::map& injectedParameters, bool logUnresolvableParameter); + + /** + * Resolve all parameters with parameter assignments, instead of parameter definitions + * @param logger to log messages + * @param catalogElement a catalogElement the parameters will be resolved. + * @param parameterAssignments the parameter assignments that provide the parameter names and values + */ + void ResolveWithParameterAssignments(std::shared_ptr& logger, std::shared_ptr& catalogElement, const std::map parameterAssignments); + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.cpp b/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.cpp new file mode 100644 index 00000000..a2ccb10d --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.cpp @@ -0,0 +1,53 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "OpenScenarioProcessingHelperV1_3.h" +#include + +#include "ExpressionResolverV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + class ExpressionResolver; + + + bool OpenScenarioProcessingHelper::IsCatalog(std::shared_ptr openScenario) + { + auto openScenarioCategory = openScenario->GetOpenScenarioCategory(); + return openScenarioCategory != nullptr && openScenarioCategory->GetCatalogDefinition() != nullptr; + } + + void OpenScenarioProcessingHelper::Resolve(std::shared_ptr& logger, std::shared_ptr openScenario, std::map& injectedParameters) + { + //if (!IsCatalog(openScenario)) + ExpressionResolver expressionResolver; + expressionResolver.Resolve(logger, openScenario, injectedParameters, true); + } + + + void OpenScenarioProcessingHelper::ResolveWithParameterAssignements(std::shared_ptr logger, std::shared_ptr& catalogElement, const std::map parameterAssignments) + { + ExpressionResolver expressionResolver; + expressionResolver.ResolveWithParameterAssignments(logger, catalogElement, parameterAssignments); + } + + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.h b/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.h new file mode 100644 index 00000000..d93765db --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/OpenScenarioProcessingHelperV1_3.h @@ -0,0 +1,60 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "OscInterfacesV1_3.h" +#include "ApiClassInterfacesV1_3.h" +#include "IParserMessageLogger.h" +#include "ApiClassImplV1_3.h" +#include +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * Helper mehtod for processing a instance of a loaded IOpenScenario + */ + class OpenScenarioProcessingHelper + { + public: + /** + * is the loaded scenario a catalog. + * @param openScenario the loaded instance of IOpenScenario + * @return true if catalog + */ + static bool IsCatalog(std::shared_ptr openScenario); + + /** + * Resolve all parameters in the loaded instance of IOpenScenario + * @param logger to log messages + * @param openScenario the loaded instance of IOpenScenario + */ + static void Resolve(std::shared_ptr& logger, std::shared_ptr openScenario, std::map& injectedParameters); + + /** + * Resolve all parameters in the loaded catalog element + * @param logger to log messages + * @param catalogElement a catalogElement the parameters will be resolved. + * @param parameterAssignments the parameter assignments that provide the parameter names and values + */ + static void ResolveWithParameterAssignements(std::shared_ptr logger, std::shared_ptr& catalogElement, const std::map parameterAssignments); + + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.cpp b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.cpp new file mode 100644 index 00000000..ec336bba --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.cpp @@ -0,0 +1,36 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlScenarioImportLoaderFactoryV1_3.h" +#include "XmlScenarioLoaderV1_3.h" +#include "XmlScenarioImportLoaderV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + XmlScenarioImportLoaderFactory::XmlScenarioImportLoaderFactory(const std::shared_ptr catalogMessageLogger, const std::string filename) :_catalogMessageLogger(catalogMessageLogger), _filename(filename) {} + + std::shared_ptr XmlScenarioImportLoaderFactory::CreateLoader(std::shared_ptr resourceLocator) + { + auto innerScenarioLoader = std::make_shared(_filename, resourceLocator); + return std::make_shared(innerScenarioLoader, _catalogMessageLogger); + } + + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.h b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.h new file mode 100644 index 00000000..da936a96 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderFactoryV1_3.h @@ -0,0 +1,52 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "IParserMessageLogger.h" +#include "XmlScenarioImportLoaderV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * A factory for creating catalog loaders + */ + class XmlScenarioImportLoaderFactory : public IScenarioLoaderFactory + { + private: + + std::shared_ptr _catalogMessageLogger; + std::string _filename; + + public: + /** + * Constructor + * + * @param catalogMessageLogger + * to log messages + * @param filename + * base directory + */ + OPENSCENARIOLIB_EXP XmlScenarioImportLoaderFactory(const std::shared_ptr catalogMessageLogger, const std::string filename); + + OPENSCENARIOLIB_EXP std::shared_ptr CreateLoader(std::shared_ptr resourceLocator) override; + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.cpp b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.cpp new file mode 100644 index 00000000..3062b272 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.cpp @@ -0,0 +1,237 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include +#include +#include "XmlScenarioImportLoaderV1_3.h" +#include "CatalogCacheV1_3.h" +#include "ICatalogReferenceProviderV1_3.h" +#include "ErrorLevel.h" +#include "FileContentMessage.h" +#include "ILocator.h" +#include "IParserMessageLogger.h" +#include "OscConstantsV1_3.h" +#include "Textmarker.h" +#include "ApiClassImplV1_3.h" +#include "CardinalityCheckerHelperV1_3.h" +#include "XmlScenarioLoaderV1_3.h" +#include "XmlScenarioLoaderFactoryV1_3.h" +#include "OpenScenarioProcessingHelperV1_3.h" +#include "MemLeakDetection.h" + + +#undef ERROR +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + void XmlScenarioImportLoader::setExternalCatalogLocations(const std::map& valueMap) { _customCatalogLocations = valueMap; } + + XmlScenarioImportLoader::XmlScenarioImportLoader(std::shared_ptr& innerScenarioLoader, std::shared_ptr& catalogMessageLogger) :_innerScenarioLoader(innerScenarioLoader), _catalogMessageLogger(catalogMessageLogger) {} + + std::shared_ptr XmlScenarioImportLoader::Load(std::shared_ptr messageLogger) + { + std::map injectedParameters; + return Load(messageLogger, injectedParameters); + } + + std::shared_ptr XmlScenarioImportLoader::Load(std::shared_ptr messageLogger, std::map& injectedParameters) + { + auto openScenario = std::static_pointer_cast(_innerScenarioLoader->Load(messageLogger)->GetAdapter(typeid(IOpenScenario).name())); + + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + auto resourceLocator = _innerScenarioLoader->GetResourceLocator(); + + // do imports here + auto filename = _innerScenarioLoader->GetFilename(); + if (!openScenario) + return openScenario; + auto catalogLocations = GetCatalogLocations(openScenario, *resourceLocator.get(), filename, messageLogger); + CatalogCache catalogCache(resourceLocator, _catalogMessageLogger); + for (auto&& catalogLocationPath : catalogLocations) + { + auto filenames = resourceLocator->GetSymbolicFilenamesInSymbolicDir(catalogLocationPath); + for (auto symbolicFilename : filenames) + { + catalogCache.AddCatalogFile(std::make_shared(symbolicFilename)); + } + } + // Get the CatalogLocations + + auto catRefProvider = std::static_pointer_cast(openScenario->GetAdapter(typeid(ICatalogReferenceProvider).name())); + if (!catRefProvider) + return openScenario; + + auto catalogReferences = catRefProvider->GetCatalogReferences(); + // get the catalogRefences + for (auto&& catalogReference : catalogReferences) + { + auto catalogElement = catalogCache.ImportCatalogElement(catalogReference); + if (catalogElement) + { + auto refImpl = std::dynamic_pointer_cast(catalogReference); + refImpl->SetRef(catalogElement); + OpenScenarioProcessingHelper::ResolveWithParameterAssignements(messageLogger, catalogElement, + GetMapFromParameterAssignements(catalogReference->GetParameterAssignments(), messageLogger)); + // resolve CatalogReference Parameters. + } + else + { + auto msg = FileContentMessage("Cannot resolve entry '" + catalogReference->GetEntryName() + "' in catalog '" + + catalogReference->GetCatalogName() + "'", ERROR, std::dynamic_pointer_cast(catalogReference)->GetStartMarker()); + messageLogger->LogMessage(msg); + } + } + } + + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + //run cardinality checks if no errors in resolving parameters + auto scenarioChecker = std::make_shared(); + CardinalityCheckerHelper::AddAllCardinalityCheckerRules(scenarioChecker); + scenarioChecker->CheckScenarioInFileContext(messageLogger, openScenario); + } + + return openScenario; + } + + std::map XmlScenarioImportLoader::GetMapFromParameterAssignements(const std::vector> parameterAssignments, std::shared_ptr parserMessageLogger) const + { + std::map result; + if (!parameterAssignments.empty()) + { + for (auto&& kParameterAssignment : parameterAssignments) + { + auto parameterName = kParameterAssignment->GetParameterRef()->GetNameRef(); + const auto kParameterValue = kParameterAssignment->GetValue(); + if (!result[parameterName].empty()) + { + auto msg = FileContentMessage("Parameter '" + parameterName + "assigned multiple times (last wins)", WARNING, + std::dynamic_pointer_cast(kParameterAssignment)->GetStartMarker()); + parserMessageLogger->LogMessage(msg); + } + result[parameterName] = kParameterValue; + } + } + return result; + } + + std::vector XmlScenarioImportLoader::GetCatalogLocations(std::shared_ptr& openScenario, IResourceLocator& resourceLocator, std::string& filename, std::shared_ptr messageLogger) + { + std::vector result; + + auto temp = std::dynamic_pointer_cast(openScenario)->GetOpenScenarioCategory(); + auto scenarioDefinition = openScenario->GetOpenScenarioCategory()->GetScenarioDefinition(); + if (scenarioDefinition) + { + auto catalogLocations = scenarioDefinition->GetCatalogLocations(); + if (catalogLocations) + { + auto controllerCatalogLocation = catalogLocations->GetControllerCatalog(); + if (controllerCatalogLocation) + { + const auto kDirectory = controllerCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto maneuverCatalogLocation = catalogLocations->GetManeuverCatalog(); + if (maneuverCatalogLocation) + { + const auto kDirectory = maneuverCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto vehicleCatalogLocation = catalogLocations->GetVehicleCatalog(); + if (vehicleCatalogLocation) + { + const auto kDirectory = vehicleCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto miscObjectCatalogLocation = catalogLocations->GetMiscObjectCatalog(); + if (miscObjectCatalogLocation) + { + const auto kDirectory = miscObjectCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto trajectoryCatalogLocation = catalogLocations->GetTrajectoryCatalog(); + if (trajectoryCatalogLocation) + { + const auto kDirectory = trajectoryCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto environmentCatalogLocation = catalogLocations->GetEnvironmentCatalog(); + if (environmentCatalogLocation) + { + const auto kDirectory = environmentCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto routeCatalogLocation = catalogLocations->GetRouteCatalog(); + if (routeCatalogLocation) + { + const auto kDirectory = routeCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + + auto pedestrianCatalogLocation = catalogLocations->GetPedestrianCatalog(); + if (pedestrianCatalogLocation) + { + const auto kDirectory = pedestrianCatalogLocation->GetDirectory(); + AddPath(resourceLocator, filename, messageLogger, result, kDirectory); + } + } + } + return result; + } + + void XmlScenarioImportLoader::AddPath(IResourceLocator& resourceLocator, std::string& filename, std::shared_ptr& messageLogger, std::vector& result, std::shared_ptr directory, const std::string& type ) + { + if (directory) + { + auto path = directory->GetPath(); + if (!path.empty()) + { + auto modValueIt = _customCatalogLocations.find(type); + if (modValueIt != _customCatalogLocations.end()) + { + path = modValueIt->second; + std::static_pointer_cast(directory->GetAdapter(typeid(DirectoryImpl).name()))->SetPath(modValueIt->second); + } + const auto kSymbolicDirname = resourceLocator.GetSymbolicDirname(filename, path); + if (!kSymbolicDirname.empty()) + { + result.push_back(kSymbolicDirname); + } + else { + auto locator = std::static_pointer_cast(directory->GetAdapter(typeid(ILocator).name())); + auto attributeString = OSC_CONSTANTS::ATTRIBUTE__PATH; + const auto kTextmarker = locator->GetStartMarkerOfProperty(attributeString); + + auto msg = FileContentMessage("Cannot resolve catalog directory '" + path + "' (" + kSymbolicDirname + ")", ERROR, kTextmarker); + messageLogger->LogMessage(msg); + } + } + } + } + + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.h b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.h new file mode 100644 index 00000000..8ce9d557 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioImportLoaderV1_3.h @@ -0,0 +1,94 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include +#include "ApiClassInterfacesV1_3.h" +#include "IParserMessageLogger.h" +#include "ApiClassImplV1_3.h" +#include "XmlScenarioLoaderV1_3.h" +#include "XmlScenarioLoaderFactoryV1_3.h" + +#undef ERROR +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * Implemens a loader for catalogs + */ + class XmlScenarioImportLoader : public IScenarioLoader + { + + private: + std::shared_ptr _innerScenarioLoader; + std::shared_ptr _catalogMessageLogger; + std::map _customCatalogLocations; + + public: + /** + * Replace the catalog locations of the open scenario file with a set of different ones. + * To be used for fixing catalog locations while opening without modifying the file itself. + * @param valueMap map of oldCatalogPath and newCatalogPath for catalog locations to be replaced + */ + void setExternalCatalogLocations(const std::map& valueMap); + /** + * Constructor + * @param innerScenarioLoader scenario loader that is used to get properties from (Resource locators, filename) + * @param catalogMessageLogger message logger for catalogs. + */ + XmlScenarioImportLoader(std::shared_ptr& innerScenarioLoader, std::shared_ptr& catalogMessageLogger); + + std::shared_ptr Load(std::shared_ptr messageLogger) override; + + std::shared_ptr Load(std::shared_ptr messageLogger, std::map& injectedParameters) override; + + private: + /** + * The map for the list of parameter assignment that maps parameter names + * to assigned parameter values. + * @param parameterAssignments list of parameter assignments from a catalog referernce + * @param parserMessageLogger to log errors and warnings + * @return the table that maps parameter names to parameter values + */ + std::map GetMapFromParameterAssignements(const std::vector> parameterAssignments, std::shared_ptr parserMessageLogger) const; + + /** + * @param openScenario the IOpenScenario instance + * Extract the catalog locations from a IOpenScenario instance + * @param resourceLocator locator for the symbolic filenames + * @param filename a base directory + * @param messageLogger to log errors and warnings + * @return a set of symbolic directory names + */ + std::vector GetCatalogLocations(std::shared_ptr& openScenario, IResourceLocator& resourceLocator, std::string& filename, std::shared_ptr messageLogger); + + /** + * Adding symbolic directory names from an IDirectory model element + * @param resourceLocator resource locator for abstracting from file system + * @param filename base file name + * @param messageLogger to log messages + * @param result in/out parameter + * @param directory the IDirectorx model element + */ + void AddPath(IResourceLocator& resourceLocator, std::string& filename, std::shared_ptr& messageLogger, std::vector& result, std::shared_ptr directory, const std::string& type = std::string()); + + + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.cpp b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.cpp new file mode 100644 index 00000000..7d82c320 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.cpp @@ -0,0 +1,33 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlScenarioLoaderFactoryV1_3.h" +#include "XmlScenarioLoaderV1_3.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + XmlScenarioLoaderFactory::XmlScenarioLoaderFactory(const std::string filename, bool supressDeprecationWarnings) : _filename(filename), _supressDeprecationWarnings(supressDeprecationWarnings){} + + std::shared_ptr XmlScenarioLoaderFactory::CreateLoader(std::shared_ptr resourceLocator) + { + return std::make_shared(_filename, resourceLocator, _supressDeprecationWarnings); + } + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.h b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.h new file mode 100644 index 00000000..63aa373d --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderFactoryV1_3.h @@ -0,0 +1,47 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "IScenarioLoaderFactory.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * Factory for a XML loader + */ + class XmlScenarioLoaderFactory : public IScenarioLoaderFactory + { + + private: + std::string _filename; + bool _supressDeprecationWarnings; + + public: + /** + * Constructor + * @param filename for the created loader + */ + OPENSCENARIOLIB_EXP XmlScenarioLoaderFactory(const std::string filename, bool supressDeprecationWarnings = false); + OPENSCENARIOLIB_EXP std::shared_ptr CreateLoader(std::shared_ptr resourceLocator) override; + + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.cpp b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.cpp new file mode 100644 index 00000000..06422b57 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.cpp @@ -0,0 +1,182 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "XmlScenarioLoaderV1_3.h" +#include "ResourceNotFoundException.h" +#include +#include "XMLLexer.h" +#include +#include "CardinalityCheckerHelperV1_3.h" +#include "ScenarioCheckerImplV1_3.h" +#include "XmlParsersV1_3.h" +#include "CatalogReferenceParserContextV1_3.h" +#include "DeprecatedCheckerV1_3.h" +#include "ScenarioLoaderException.h" +#include "VariableCheckerV1_3.h" +#include "XmlToSimpleNodeConverter.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + XmlScenarioLoader::XmlScenarioLoader(std::string& filename, std::shared_ptr& resourceLocator, bool supressDeprecationWarnings) : _filename(filename), _resourceLocator(resourceLocator), _supressDeprecationWarnings(supressDeprecationWarnings){} + + XmlScenarioLoader::~XmlScenarioLoader() = default; + + std::shared_ptr XmlScenarioLoader::GetResourceLocator() const + { + return _resourceLocator; + } + + std::string XmlScenarioLoader::GetFilename() const + { + return _filename; + } + std::shared_ptr XmlScenarioLoader::Load(std::shared_ptr messageLogger) + { + std::map injectedParameters; + return Load(messageLogger, injectedParameters); + } + + std::shared_ptr XmlScenarioLoader::Load(std::shared_ptr messageLogger, std::map& injectedParameters) + { + try + { + auto inputStream = _resourceLocator->GetInputStream(_filename); + tinyxml2::XMLDocument doc; + + // read data as a block: + inputStream->seekg(0, inputStream->end); + const auto kLength = static_cast(inputStream->tellg()); + inputStream->seekg(0, inputStream->beg); + char * buffer = new char[kLength]; + inputStream->read(buffer, kLength); + std::string fileData; + fileData.assign(buffer, kLength); + delete[] buffer; + inputStream->close(); + + auto errorCode = doc.Parse(fileData.c_str()); + switch (errorCode) + { + case tinyxml2::XML_SUCCESS: break; + case tinyxml2::XML_NO_ATTRIBUTE: + throw ScenarioLoaderException("XML_NO_ATTRIBUTE"); + case tinyxml2::XML_WRONG_ATTRIBUTE_TYPE: + throw ScenarioLoaderException("XML_WRONG_ATTRIBUTE_TYPE"); + case tinyxml2::XML_ERROR_FILE_NOT_FOUND: + throw ScenarioLoaderException("XML_ERROR_FILE_NOT_FOUND"); + case tinyxml2::XML_ERROR_FILE_COULD_NOT_BE_OPENED: + throw ScenarioLoaderException("XML_ERROR_FILE_COULD_NOT_BE_OPENED"); + case tinyxml2::XML_ERROR_FILE_READ_ERROR: + throw ScenarioLoaderException("XML_ERROR_FILE_READ_ERROR"); + case tinyxml2::XML_ERROR_PARSING_ELEMENT: + throw ScenarioLoaderException("XML_ERROR_PARSING_ELEMENT"); + case tinyxml2::XML_ERROR_PARSING_ATTRIBUTE: + throw ScenarioLoaderException("XML_ERROR_PARSING_ATTRIBUTE"); + case tinyxml2::XML_ERROR_PARSING_TEXT: + throw ScenarioLoaderException("XML_ERROR_PARSING_TEXT"); + case tinyxml2::XML_ERROR_PARSING_CDATA: + throw ScenarioLoaderException("XML_ERROR_PARSING_CDATA"); + case tinyxml2::XML_ERROR_PARSING_COMMENT: + throw ScenarioLoaderException("XML_ERROR_PARSING_COMMENT"); + case tinyxml2::XML_ERROR_PARSING_DECLARATION: + throw ScenarioLoaderException("XML_ERROR_PARSING_DECLARATION"); + case tinyxml2::XML_ERROR_PARSING_UNKNOWN: + throw ScenarioLoaderException("XML_ERROR_PARSING_UNKNOWN"); + case tinyxml2::XML_ERROR_EMPTY_DOCUMENT: + throw ScenarioLoaderException("XML_ERROR_EMPTY_DOCUMENT"); + case tinyxml2::XML_ERROR_MISMATCHED_ELEMENT: + throw ScenarioLoaderException("XML_ERROR_MISMATCHED_ELEMENT"); + case tinyxml2::XML_ERROR_PARSING: + throw ScenarioLoaderException("XML_ERROR_PARSING"); + case tinyxml2::XML_CAN_NOT_CONVERT_TEXT: + throw ScenarioLoaderException("XML_CAN_NOT_CONVERT_TEXT"); + case tinyxml2::XML_NO_TEXT_NODE: + throw ScenarioLoaderException("XML_NO_TEXT_NODE"); + case tinyxml2::XML_ELEMENT_DEPTH_EXCEEDED: + throw ScenarioLoaderException("XML_ELEMENT_DEPTH_EXCEEDED"); + case tinyxml2::XML_ERROR_COUNT: + throw ScenarioLoaderException("XML_ERROR_COUNT"); + default:; + } + + // antlr indexing + antlr4::ANTLRInputStream input(fileData); + XMLLexer lexer(&input); + antlr4::CommonTokenStream tokens(&lexer); + XMLParser parser(&tokens); + parser.document(); + + auto positionIndex = parser.GetPositionIndex(); + // Get simple structure from dom and antlr results + XmlToSimpleNodeConverter xmlToSimpleNodeConverter(positionIndex); + auto indexedElement = xmlToSimpleNodeConverter.Convert(doc); + + // Finally do parsing from dom result + ParserOptions parserOptions; + parserOptions.SetOptionSupressDeprecationWarnings(_supressDeprecationWarnings); + OpenScenarioXmlParser openScenarioXmlParser(*messageLogger.get(), _filename, parserOptions); + + auto openScenarioImpl = std::make_shared(); + auto parserContext = std::dynamic_pointer_cast(std::make_shared()); + openScenarioXmlParser.ParseElement(indexedElement, parserContext, openScenarioImpl); + + + // resolve parameter only when no errors occured + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + // Check + ScenarioCheckerImpl scenarioChecker; + OpenScenarioProcessingHelper::Resolve(messageLogger, openScenarioImpl, injectedParameters); + openScenarioImpl->AddAdapter(typeid(ICatalogReferenceProvider).name(), std::dynamic_pointer_cast(parserContext)); + auto scenarioCheckerImpl = std::make_shared(); + openScenarioImpl->AddAdapter(typeid(IScenarioChecker).name(), scenarioCheckerImpl); + } + + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + //run cardinality checks if no errors in resolving parameters + auto scenarioChecker = std::make_shared(); + CardinalityCheckerHelper::AddAllCardinalityCheckerRules(scenarioChecker); + scenarioChecker->CheckScenarioInFileContext(messageLogger, openScenarioImpl); + } + + // Check variables + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + VariableChecker variableChecker; + variableChecker.CheckScenarioInFileContext(messageLogger, openScenarioImpl); + } + if (messageLogger->GetMessagesFilteredByWorseOrEqualToErrorLevel(ErrorLevel::ERROR).empty()) + { + DeprecatedChecker deprecatedChecker; + deprecatedChecker.CheckScenarioInFileContext(messageLogger, openScenarioImpl); + } + return openScenarioImpl; + } + + catch (ResourceNotFoundException& e) + { + auto msg = FileContentMessage(std::string(e.what()), ERROR, Textmarker(-1, -1, _filename)); + messageLogger->LogMessage(msg); + return nullptr; + } + } + } +} diff --git a/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.h b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.h new file mode 100644 index 00000000..48ba6bdf --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/loader/XmlScenarioLoaderV1_3.h @@ -0,0 +1,69 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "IParserMessageLogger.h" +#include "OpenScenarioProcessingHelperV1_3.h" +#include "ScenarioCheckerImplV1_3.h" +#include "IScenarioLoader.h" +#include "IResourceLocator.h" +#include "ExportDefinitions.h" +#include "ParameterDeclarationCheckerV1_3.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * A loader for a scenario from XML + */ + class XmlScenarioLoader : public IScenarioLoader + { + private: + std::string _filename; + std::shared_ptr _resourceLocator; + bool _supressDeprecationWarnings; + + public: + /** + * Constructor + * @param filename symbolic filename of the scenario + * @param resourceLocator locator abstracting from storage. + * @param supressDeprecationWarnings flag that supresses deprecation Warnung throught parsing + */ + XmlScenarioLoader(std::string& filename, std::shared_ptr& resourceLocator, bool supressDeprecationWarnings = false); + virtual ~XmlScenarioLoader(); + + /** + * The resource locator of the loader + * @return the resource locator + */ + std::shared_ptr GetResourceLocator() const; + + /** + * The filename od the loader + * @return the filename + */ + std::string GetFilename() const; + + OPENSCENARIOLIB_EXP std::shared_ptr Load(std::shared_ptr messageLogger) override; + OPENSCENARIOLIB_EXP std::shared_ptr Load(std::shared_ptr messageLogger, std::map& injectedParameters) override; + + }; + } +} diff --git a/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.cpp b/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.cpp new file mode 100644 index 00000000..8e81e14c --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.cpp @@ -0,0 +1,40 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "CatalogReferenceParserContextV1_3.h" +#include +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + + void CatalogReferenceParserContext::AddCatalogReference(const std::shared_ptr catalogReference) + { + _catalogReferences.push_back(catalogReference); + } + + std::vector> CatalogReferenceParserContext::GetCatalogReferences() + { + return _catalogReferences; + } + + + } +} diff --git a/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.h b/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.h new file mode 100644 index 00000000..7b31ecc9 --- /dev/null +++ b/cpp/openScenarioLib/src/v1_3/parser/CatalogReferenceParserContextV1_3.h @@ -0,0 +1,51 @@ +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "ParserContext.h" +#include "ICatalogReferenceProviderV1_3.h" +#include +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace v1_3 + { + /** + * Specific parser for version 1.0 + */ + + class CatalogReferenceParserContext : public ParserContext, public ICatalogReferenceProvider + { + private: + std::vector> _catalogReferences; + + public: + + /** + * Adds a found catalog reference. At the end of the parsing process any + * catalog reference is in the list as a preparation for the next step to resolve the + * catalog references. + * @param catalogReference a catalog reference to be added. + */ + void AddCatalogReference(const std::shared_ptr catalogReference); + + std::vector> GetCatalogReferences() override; + + }; + } +} diff --git a/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/TemplateProcessor.groovy b/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/TemplateProcessor.groovy index a183a247..64130efc 100644 --- a/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/TemplateProcessor.groovy +++ b/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/TemplateProcessor.groovy @@ -30,7 +30,7 @@ class TemplateProcessor { TemplateProcessor(String type, String version) { assert(type.equals(CPP)) - assert(version.equals("v1_0") || version.equals("v1_1") || version.equals("v1_2")) + assert(version.equals("v1_0") || version.equals("v1_1") || version.equals("v1_2") || version.equals("v1_3")) this.type = type; this.version = version; } diff --git a/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/cpp/GeneratorCpp.groovy b/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/cpp/GeneratorCpp.groovy index eff03d8f..55567162 100644 --- a/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/cpp/GeneratorCpp.groovy +++ b/generator/de.rac.openscenario.generator/src/main/java/de/rac/openscenario/generator/cpp/GeneratorCpp.groovy @@ -58,6 +58,7 @@ public class GeneratorCpp { private static final String V1_0 = "v1_0" private static final String V1_1 = "v1_1" private static final String V1_2 = "v1_2" + private static final String V1_3 = "v1_3" private static versionMap = [:]; @@ -81,6 +82,13 @@ public class GeneratorCpp { versionMap[V1_2]["rangeCheckerRulesFile"] = "input/RangeCheckerRules_1.2.0.json"; versionMap[V1_2]["fileSuffix"] = "V1_2"; versionMap[V1_2]["oscVersion"] = "1.2"; + + versionMap[V1_3] = [:]; + versionMap[V1_3]["modelFile"] = "input/OpenSCENARIO_Ea_1.3.0.xmi"; + versionMap[V1_3]["defaultValues"] = "input/DefaultValues_1.3.0.json"; + versionMap[V1_3]["rangeCheckerRulesFile"] = "input/RangeCheckerRules_1.3.0.json"; + versionMap[V1_3]["fileSuffix"] = "V1_3"; + versionMap[V1_3]["oscVersion"] = "1.3"; } public static void main(String[] args) { diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassInterface.tpl new file mode 100644 index 00000000..e74da56c --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassInterface.tpl @@ -0,0 +1,99 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> + +<%=JavaLicenseHelper.getApache2License()%> +#pragma once + +#include +#include +#include "INamedReference.h" +#include "Enumerations<%=fileSuffix%>.h" +#include "OscInterfaces<%=fileSuffix%>.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + + <%- model.getClasses().each{ element->-%> + class I<%=element.name.toClassName()%>; + <%-}-%> + + + <%- model.getClasses().each{ element->-%> + +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class I<%=element.name.toClassName()%> <%=helper.getExtendsExpressionCpp(element)%> + { + public: + virtual ~I<%=element.name.toClassName()%>() = default; +<% List properties = element.umlProperties-%> +<%properties.each{ property ->-%> + +<%=helper.makeGetterCppDoc(element, property, " ")%> +<%-if (property.isList()) {-%> + virtual std::vector<<%=property.type.toCppName()%>> Get<%=property.name.toClassName()%>() const + { + return std::vector<<%=property.type.toCppName()%>>(); + } +<%}else if (property.isProxy()){-%> + virtual std::shared_ptr>> Get<%=property.name.toClassName()%>() const + { + return std::make_shared>>(); + } +<%}else{-%> + virtual <%=property.type.toCppName()%> Get<%=property.name.toClassName()%>() const + { + return <%=property.type.toCppDefaultValue()%>; + } +<%}}-%> + +<%-properties.each{ property ->-%> +<%-if (property.isList()) {-%> + /** + * Retrieves the size of the list + * @return the size of the list + */ + virtual int Get<%=property.name.toClassName()%>Size() const { return 0; } + + /** + * The element at specific index + * @param index the index of the list + * @return the element at index + */ + virtual <%=property.type.toCppName()%> Get<%=property.name.toClassName()%>AtIndex(const unsigned int index) const + { + return <%=property.type.toCppDefaultValue()%>; + } +<%-}}-%> + +<%-properties.each{ property ->-%> + /** + * Retrieves whether property <%=property.name.toMemberName()%> is set + * @return true when the property is set + */ + virtual bool IsSet<%=property.name.toClassName()%>() const = 0; +<%-}-%> + + }; + +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImpl.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImpl.tpl new file mode 100644 index 00000000..b011b51d --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImpl.tpl @@ -0,0 +1,41 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include "ApiClassImpl<%=fileSuffix%>.h" +#include "IOpenScenarioWriterFactory<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class OpenScenarioWriterFactoryImpl: public IOpenScenarioWriterFactory + { + public: +<%- element.each{ umlClass ->-%> + + OPENSCENARIOLIB_EXP std::shared_ptrWriter> Create<%=umlClass.name.toClassName()%>Writer() override; +<%-}-%> + }; + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImplSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImplSource.tpl new file mode 100644 index 00000000..9cc82a4e --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryImplSource.tpl @@ -0,0 +1,36 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "OpenScenarioWriterFactoryImpl<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> +<%- element.each{ umlClass ->-%> + + std::shared_ptrWriter> OpenScenarioWriterFactoryImpl::Create<%=umlClass.name.toClassName()%>Writer() + { + return std::make_shared<<%=umlClass.name.toClassName()%>Impl>(); + } +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryInterface.tpl new file mode 100644 index 00000000..03ed4187 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterFactoryInterface.tpl @@ -0,0 +1,39 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> +#pragma once +#include +#include "ApiClassWriterInterfaces<%=fileSuffix%>.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class IOpenScenarioWriterFactory + { + public: +<%- element.each{ umlClass ->-%> + virtual std::shared_ptrWriter> Create<%=umlClass.name.toClassName()%>Writer() = 0; +<%-}-%> + + }; + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterInterface.tpl new file mode 100644 index 00000000..cc897d4b --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiClassWriterInterface.tpl @@ -0,0 +1,114 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> +#pragma once + +#include +#include +#include "INamedReference.h" +#include "IOpenScenarioModelElement.h" +#include "Enumerations<%=fileSuffix%>.h" +#include "OscInterfaces<%=fileSuffix%>.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "ApiWriterInterfaces<%=fileSuffix%>.h" +#include "IOpenScenarioElementWriter.h" +#include "MemLeakDetection.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + + <%- model.getClasses().each{ element->-%> + class I<%=element.name.toClassName()%>Writer; + <%-}-%> + + + <%- model.getClasses().each{ element->-%> + +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class I<%=element.name.toClassName()%>Writer <%=helper.getExtendsExpressionCpp(element)%> + { + public: + virtual ~I<%=element.name.toClassName()%>Writer() = default; + +<%properties = element.umlProperties-%> +<%-if(properties){-%> + // Setters for all attributes +<%-}-%> +<%-properties.each{ property ->-%> + +<%=helper.makeGetterCppDoc(element, property, " ")%> +<%- if (property.isProxy() && !property.isList()){-%> + virtual void Set<%=property.name.toClassName()%>(std::shared_ptr>> <%=property.name.toMemberName()%>) = 0; +<%}else if (property.isTransient() && property.isList()){-%> + virtual void Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppName()%>>& <%=property.name.toMemberName()%>) = 0; +<%}else if (property.isTransient() && !property.isList()){-%> + virtual void Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) = 0; +<%}else if (property.isXmlElementProperty() && !property.isList()){-%> + virtual void Set<%=property.name.toClassName()%>(<%=property.type.toCppWriterName()%> <%=property.name.toMemberName()%>) = 0; +<%}else if (property.isXmlElementProperty() && property.isList()){-%> + virtual void Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppWriterName()%>>& <%=property.name.toMemberName()%>) = 0; +<%}else {-%> + virtual void Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) = 0; +<%-}}-%> + +<%properties = element.getParametrizableAttributes()-%> +<%-properties.each{ property ->-%> +<%=helper.makeAttributeSetterParameterCppDoc(element, property, " ")%> + virtual void WriteParameterTo<%=property.name.toClassName()%>(std::string& parameterName) = 0; +<%-}-%> + +<%-properties.each{ property ->-%> +<%=helper.makeAttributeGetterParameterCppDoc(element, property, " ")%> + virtual std::string GetParameterFrom<%=property.name.toClassName()%>() const = 0; +<%-}-%> + +<%-properties.each{ property ->-%> +<%=helper.makeIsParameterizedCppDoc(element, property, " ")%> + virtual bool Is<%=property.name.toClassName()%>Parameterized() = 0; +<%-}-%> + + // children +<%-properties = element.getXmlElementProperties().findAll(){ !it.isList() }-%> +<%-properties.each{ property ->-%> +<%=helper.makeChildWriterGetterCppDoc(element, property, " ")%> + virtual <%=property.type.toCppWriterName()%> GetWriter<%=property.name.toClassName()%>() const = 0; +<%-}-%> + +<%-properties = element.getXmlElementProperties().findAll(){ it.isList() }-%> +<%-properties.each{ property ->-%> +<%=helper.makeChildListWriterGetterCppDoc(element, property, " ")%> + virtual std::vector<<%=property.type.toCppWriterName()%>> GetWriter<%=property.name.toClassName()%>() const = 0; +<%-}-%> +<%-properties = element.umlProperties-%> +<%-properties.each{ property ->-%> +<%-if (property.lower == 0) {-%> + /** + * Resets the optional property (IsSet<%=property.name.toClassName()%>() will return false); + */ + virtual void Reset<%=property.name.toClassName()%>() = 0; + +<%-}}-%> + }; + +<%-}-%> + } +} diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationHeader.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationHeader.tpl new file mode 100644 index 00000000..ae03ea8c --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationHeader.tpl @@ -0,0 +1,109 @@ + +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include +#include +#include +#include "DateTime.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getEnumerations().each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%> + { + public: + enum <%=element.name.toClassName()%>Enum + { + UNKNOWN = -1, + <%- helper.getEnumElementsCpp(element).each{ enumLiteralElement ->-%> + <%=enumLiteralElement%> + <%-}-%> + }; + + private: + std::string _literal; + <%=element.name.toClassName()%>Enum _<%=element.name.toMemberName()%>Enum; + static std::mapEnum> _stringToEnum; + <%-if (element.hasDeprecatedLiterals()){-%> + static std::map<<%=element.name.toClassName()%>Enum, bool> _enumToDeprecated; + static std::map<<%=element.name.toClassName()%>Enum, std::string> _enumToDeprecatedVersion; + static std::map<<%=element.name.toClassName()%>Enum, std::string> _enumToDeprecatedComment; + <%}-%> + + public: + const std::vector k<%=element.name.toClassName()%>EnumString + { + "UNKNOWN", + <%- element.enumerationValues.each{ property ->-%> + "<%=property.literal.toMemberName()%>", + <%-}-%> + }; + + /** + * Default Constructor + */ + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>(); + + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>(<%=element.name.toClassName()%>Enum& <%=element.name.toMemberName()%>); + + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>); + + OPENSCENARIOLIB_EXP static bool IsDeprecated(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedVersion(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>); + + OPENSCENARIOLIB_EXP static std::string GetDeprecatedComment(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>); + + /** + * Constructor using the literal + * @param literal_ as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>(std::string& literal_); + + /** + * The literal from this enumeration value. + * @return the literal as defined in OpenSCENARIO + */ + OPENSCENARIOLIB_EXP std::string GetLiteral() const; + + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>& operator= (const <%=element.name.toClassName()%>Enum &rhs); + + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>& operator= (const <%=element.name.toClassName()%> &rhs ); + + OPENSCENARIOLIB_EXP bool operator== (const <%=element.name.toClassName()%>Enum &rhs) const; + /** + * The enumeration value from the literal + * @param literal_ as defined in OpenSCENARIO + * @return the enumeration value + */ + OPENSCENARIOLIB_EXP static <%=element.name.toClassName()%>Enum GetFromLiteral(const std::string literal_); + + }; + + +<%-}-%> + } +} diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationSource.tpl new file mode 100644 index 00000000..c14a34be --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiEnumerationSource.tpl @@ -0,0 +1,155 @@ + +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "Enumerations<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getEnumerations().each{ element->-%> + std::map::<%=element.name.toClassName()%>Enum> <%=element.name.toClassName()%>::_stringToEnum = + { + <%- element.enumerationValues.each{ property ->-%> + {"<%=property.literal.toMemberName()%>", <%=property.literal.toUpperNameFromMemberName()%>}, + <%-}-%> + }; + + <%-if (element.hasDeprecatedLiterals()){-%> + std::map<<%=element.name.toClassName()%>::<%=element.name.toClassName()%>Enum, bool> <%=element.name.toClassName()%>::_enumToDeprecated = + { + <%- element.enumerationValues.each{ property ->-%> + <%- if(property.isDeprecated()){-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, true}, + <%-} else {-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, false}, + <%-}-%> + <%-}-%> + }; + std::map<<%=element.name.toClassName()%>::<%=element.name.toClassName()%>Enum, std::string> <%=element.name.toClassName()%>::_enumToDeprecatedVersion + { + <%- element.enumerationValues.each{ property ->-%> + <%- if(property.isDeprecated() && property.getDeprecatedVersion()){-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, "<%=property.getDeprecatedVersion().replaceAll("\"", "\\\\\"")%>"}, + <%-} else {-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, ""}, + <%-}-%> + <%-}-%> + }; + std::map<<%=element.name.toClassName()%>::<%=element.name.toClassName()%>Enum, std::string> <%=element.name.toClassName()%>::_enumToDeprecatedComment + { + <%- element.enumerationValues.each{ property ->-%> + <%- if(property.isDeprecated() && property.getDeprecatedComment()){-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, "<%=property.getDeprecatedComment().replaceAll("\"", "\\\\\"")%>"}, + <%-} else {-%> + {<%=element.name.toClassName()%>::<%=property.literal.toUpperNameFromMemberName()%>, ""}, + <%-}-%> + <%-}-%> + }; + + + <%}-%> + + <%=element.name.toClassName()%>::<%=element.name.toClassName()%>() + { + _literal = k<%=element.name.toClassName()%>EnumString[0]; + _<%=element.name.toMemberName()%>Enum = GetFromLiteral(_literal); + } + + <%=element.name.toClassName()%>::<%=element.name.toClassName()%>(<%=element.name.toClassName()%>Enum& <%=element.name.toMemberName()%>) + { + _literal = k<%=element.name.toClassName()%>EnumString[<%=element.name.toMemberName()%>+1]; + _<%=element.name.toMemberName()%>Enum = GetFromLiteral(_literal); + } + + <%=element.name.toClassName()%>::<%=element.name.toClassName()%>(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>) + { + _literal = k<%=element.name.toClassName()%>EnumString[<%=element.name.toMemberName()%>+1]; + _<%=element.name.toMemberName()%>Enum = GetFromLiteral(_literal); + } + + <%=element.name.toClassName()%>::<%=element.name.toClassName()%>(std::string& literal_):_literal(literal_) + { + _<%=element.name.toMemberName()%>Enum = GetFromLiteral(_literal); + } + + bool <%=element.name.toClassName()%>::IsDeprecated(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>) + { + <%-if (!element.hasDeprecatedLiterals()){-%> + return false; + <%-} else {-%> + return _enumToDeprecated[<%=element.name.toMemberName()%>]; + <%-}-%> + } + + std::string <%=element.name.toClassName()%>::GetDeprecatedVersion(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>) + { + <%-if (!element.hasDeprecatedLiterals()){-%> + return ""; + <%-} else {-%> + return _enumToDeprecatedVersion[<%=element.name.toMemberName()%>]; + <%-}-%> + } + + std::string <%=element.name.toClassName()%>::GetDeprecatedComment(const <%=element.name.toClassName()%>Enum <%=element.name.toMemberName()%>) + { + <%-if (!element.hasDeprecatedLiterals()){-%> + return ""; + <%-} else {-%> + return _enumToDeprecatedComment[<%=element.name.toMemberName()%>]; + <%-}-%> + } + + std::string <%=element.name.toClassName()%>::GetLiteral() const + { + return _literal; + } + + <%=element.name.toClassName()%>& <%=element.name.toClassName()%>::operator= (const <%=element.name.toClassName()%>Enum &rhs) + { + _<%=element.name.toMemberName()%>Enum = rhs; + _literal = k<%=element.name.toClassName()%>EnumString[_<%=element.name.toMemberName()%>Enum+1]; + return *this; + } + + <%=element.name.toClassName()%>& <%=element.name.toClassName()%>::operator= (const <%=element.name.toClassName()%> &rhs ) + { + _literal = rhs._literal; + _<%=element.name.toMemberName()%>Enum = rhs._<%=element.name.toMemberName()%>Enum; + return *this; + } + + bool <%=element.name.toClassName()%>::operator== (const <%=element.name.toClassName()%>Enum &rhs) const + { + return _<%=element.name.toMemberName()%>Enum == rhs; + } + + <%=element.name.toClassName()%>::<%=element.name.toClassName()%>Enum <%=element.name.toClassName()%>::GetFromLiteral(const std::string literal_) + { + const auto kIt = _stringToEnum.find(literal_); + if (kIt != _stringToEnum.end()) + return kIt->second; + return UNKNOWN; + } + +<%-}-%> + } +} diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiInterface.tpl new file mode 100644 index 00000000..0228e29e --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiInterface.tpl @@ -0,0 +1,38 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%- model.getInterfaces().each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class I<%=element.name.toClassName()%> + { + public: + I<%=element.name.toClassName()%>() = default; + virtual ~I<%=element.name.toClassName()%>() = default; + }; +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiWriterInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiWriterInterface.tpl new file mode 100644 index 00000000..ad18de39 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ApiWriterInterface.tpl @@ -0,0 +1,39 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> +#pragma once + +#include "IOpenScenarioModelElement.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%- model.getInterfaces().each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class I<%=element.name.toClassName()%>Writer: public virtual IOpenScenarioModelElement + { + public: + I<%=element.name.toClassName()%>Writer() = default; + virtual ~I<%=element.name.toClassName()%>Writer() = default; + }; + +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelper.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelper.tpl new file mode 100644 index 00000000..a828857c --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelper.tpl @@ -0,0 +1,43 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include "IScenarioChecker<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class CardinalityCheckerHelper + { + public: + /** + * Connects all cardinality checker rules to a global scenarioChecker + * @param scenarioChecker the global scenarioChecker + */ + static void AddAllCardinalityCheckerRules(std::shared_ptr scenarioChecker); + }; + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelperSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelperSource.tpl new file mode 100644 index 00000000..1f8db3e8 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerHelperSource.tpl @@ -0,0 +1,38 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + + +#include "CardinalityCheckerHelper<%=fileSuffix%>.h" +#include "CardinalityCheckerRules<%=fileSuffix%>.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + void CardinalityCheckerHelper::AddAllCardinalityCheckerRules(std::shared_ptr scenarioChecker) + { + <%- element.each{ umlClass ->-%> + scenarioChecker->Add<%=umlClass.name.toClassName()%>CheckerRule(std::shared_ptr<<%=umlClass.name.toClassName()%>CardinalityCheckerRule>(new <%=umlClass.name.toClassName()%>CardinalityCheckerRule())); + <%-}-%> + } + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRule.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRule.tpl new file mode 100644 index 00000000..0751fa40 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRule.tpl @@ -0,0 +1,54 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> +#pragma once + +#include +#include +#include "CardinalityCheckerRule.h" +#include "IParserMessageLogger.h" +#include "ITreeMessageLogger.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "PropertyTreeContext.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + +<%- element.each{ umlClass ->-%> +<%= helper.makeClassJavaDoc(umlClass, oscVersion, " ")%> + class <%=umlClass.name.toClassName()%>CardinalityCheckerRule: public CardinalityCheckerRule + { + private: + + std::string GetMsg(CardinalityViolation& violation); + std::vector GetAllViolations(std::shared_ptr> object); + + public: + <%=umlClass.name.toClassName()%>CardinalityCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRuleSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRuleSource.tpl new file mode 100644 index 00000000..20ed69e5 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CardinalityCheckerRuleSource.tpl @@ -0,0 +1,149 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + + +#include "CardinalityCheckerRules<%=fileSuffix%>.h" +#include "OscConstants<%=fileSuffix%>.h" + + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + +<%- element.each{ umlClass ->-%> + std::string <%=umlClass.name.toClassName()%>CardinalityCheckerRule::GetMsg(CardinalityViolation& violation) + { + std::string message; + if (violation.violationType == VIOLATION_TYPE::REQUIRED) + { + message = GetRequiredMessage(violation.propertyName); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_FEW) + { + message = GetTooFewMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::TOO_MANY) + { + message = GetTooManyMessage(violation.propertyName, violation.expected, violation.actual); + } + else if (violation.violationType == VIOLATION_TYPE::REQUIRED_XOR) + { + message = GetRequiredXorMessage(violation.propertiesName); + } + else + { + message = GetRequiredContentMessage(); + } + return message; + + } + + std::vector <%=umlClass.name.toClassName()%>CardinalityCheckerRule::GetAllViolations(std::shared_ptr> object) + { + std::vector violations; + <%-properties = umlClass.umlProperties;-%> + <%-properties.each{ property -> -%> + <%-if (!property.isOptional() && !property.isOptionalUnboundList() && !property.isTransient() && !property.appliedStereotypes.find(){s -> s.getName() == "xor"}){-%> + // Check violation + <%-if (property.isList() && (property.lower != 0 || property.upper > 0)){-%> + const auto k<%=property.name.toClassName()%>Size = object->Get<%=property.name.toClassName()%>Size(); + <%-if (property.lower != 0){-%> + // Check too few elements + if (k<%=property.name.toClassName()%>Size < <%=property.lower%>) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toUpperNameFromMemberName()%>, <%=property.lower%>, k<%=property.name.toClassName()%>Size, VIOLATION_TYPE::TOO_FEW) ); + } + <%-} -%> + <%- if (property.upper > 0 ){-%> + // Check too many elements + if (k<%=property.name.toClassName()%>Size > <%=property.upper%>) + { + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT_<%=property.getXmlTagName().toUpperNameFromMemberName()%>, <%=property.upper%>, k<%=property.name.toClassName()%>Size, VIOLATION_TYPE::TOO_MANY) ); + } + <%-}-%> + <%-}else {-%> + // Check required + if (!object->IsSet<%=property.name.toClassName()%>()) + { + <%- if (property.appliedStereotypes.find(){s -> s.getName() == "XSDattribute"}){-%> + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, 0, 1, VIOLATION_TYPE::REQUIRED) ); + <%-}else if (umlClass.isSimpleContent()) {-%> + violations.push_back( CardinalityViolation("", 0, 1, VIOLATION_TYPE::REQUIRED_SIMPLE_CONTENT) ); + <%-} else {-%> + violations.push_back( CardinalityViolation(OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toUpperNameFromMemberName()%>, 0, 1, VIOLATION_TYPE::REQUIRED) ); + <%-}-%> + } + <%-}-%> + <%-}-%> + <%-}-%> + + //Xor elements check + <%-if (umlClass.doPropertiesContainXorElements()){ -%> + uint16_t elementsDefined = 0; + std::vector propertiesName; + <%-properties.each{ property -> -%> + <%-if (property.appliedStereotypes.find(){s -> s.getName() == "xor"}){ -%> + elementsDefined += object->IsSet<%=property.name.toClassName()%>()?1:0; + <%- if (property.appliedStereotypes.find(){s -> s.getName() == "XSDattribute"}){-%> + propertiesName.push_back( OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%> ); + <%-}else if (umlClass.isSimpleContent()) {-%> + propertiesName.push_back( "" ); + <%-} else {-%> + propertiesName.push_back( OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toUpperNameFromMemberName()%> ); + <%-}-%> + <%-}-%> + <%-}-%> + + if (elementsDefined != 1) + violations.push_back( CardinalityViolation(propertiesName, 0, 1, VIOLATION_TYPE::REQUIRED_XOR) ); + <%-}-%> + + return violations; + } + + + <%=umlClass.name.toClassName()%>CardinalityCheckerRule::<%=umlClass.name.toClassName()%>CardinalityCheckerRule() = default; + + void <%=umlClass.name.toClassName()%>CardinalityCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast>(object)); + + for (auto&& violation : violations) + { + auto msg = FileContentMessage(GetMsg(violation), ERROR, *GetTextmarker(object)); + messageLogger->LogMessage(msg); + } + } + + void <%=umlClass.name.toClassName()%>CardinalityCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto violations = GetAllViolations(std::dynamic_pointer_cast>(object)); + + for (auto&& violation : violations) + { + auto msg = TreeContentMessage(GetMsg(violation), ERROR, PropertyTreeContext::Create(object, violation.propertyName)); + messageLogger->LogMessage(msg); + } + } + +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelper.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelper.tpl new file mode 100644 index 00000000..9fb52598 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelper.tpl @@ -0,0 +1,70 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class CatalogHelper + { + public: + <%- element.each{ umlClass ->-%> + /** + * Tests for the type I<%=umlClass.name.toClassName()%> + * @param catalogElement the catalog element + * @return true if the catalog element is of type I<%=umlClass.name.toClassName()%> + */ + OPENSCENARIOLIB_EXP static bool Is<%=umlClass.name.toClassName()%>(std::shared_ptr& catalogElement); + + <%-}-%> + <%- element.each{ umlClass ->-%> + /** + * Conversion to type I<%=umlClass.name.toClassName()%> + * @param catalogElement the catalog element + * @return converted value of type I<%=umlClass.name.toClassName()%> or null if the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::shared_ptr> As<%=umlClass.name.toClassName()%>(std::shared_ptr& catalogElement); + + <%-}-%> + /** + * Provides the name of the catalogElement + * @param catalogElement the catalog element + * @return the name of the catalogElement + * cannot be converted + */ + OPENSCENARIOLIB_EXP static std::string GetName(std::shared_ptr& catalogElement); + + /** + * Provides the ParameterDeclarations of the catalogElement + * @param catalogElement the catalog element + * @return The list with the parameter declarations + */ + OPENSCENARIOLIB_EXP static std::vector> GetParameterDeclarations(std::shared_ptr& catalogElement); + + }; + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelperSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelperSource.tpl new file mode 100644 index 00000000..5ef606a1 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/CatalogHelperSource.tpl @@ -0,0 +1,86 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "CatalogHelper<%=fileSuffix%>.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + +<%- element.each{ umlClass ->-%> + /** + * Tests for the type I<%=umlClass.name.toClassName()%> + * @param catalogElement the catalog element + * @return true if the catalog element is of type I<%=umlClass.name.toClassName()%> + */ + bool CatalogHelper::Is<%=umlClass.name.toClassName()%>(std::shared_ptr& catalogElement) + { + return std::dynamic_pointer_cast>(catalogElement) != nullptr; + } + +<%-}-%> +<%- element.each{ umlClass ->-%> + /** + * Conversion to type I<%=umlClass.name.toClassName()%> + * @param catalogElement the catalog element + * @return converted value of type I<%=umlClass.name.toClassName()%> or null if the catalogElement + * cannot be converted + */ + std::shared_ptr> CatalogHelper::As<%=umlClass.name.toClassName()%>(std::shared_ptr& catalogElement) + { + if (Is<%=umlClass.name.toClassName()%>(catalogElement)) + return std::dynamic_pointer_cast>(catalogElement); + return std::shared_ptr>(nullptr); + } + +<%-}-%> + /** + * Provides the name of the catalogElement + * @param catalogElement the catalog element + * @return the name of the catalogElement + * cannot be converted + */ + std::string CatalogHelper::GetName(std::shared_ptr& catalogElement) + { + <%- element.each{ umlClass ->-%> + if (Is<%=umlClass.name.toClassName()%>(catalogElement)) + return std::dynamic_pointer_cast>(catalogElement)->GetName(); + <%-}-%> + return ""; + } + /** + * Provides the ParameterDeclarations of the catalogElement + * @param catalogElement the catalog element + * @return The list with the parameter declarations + */ + std::vector> CatalogHelper::GetParameterDeclarations(std::shared_ptr& catalogElement) + { + <%- element.each{ umlClass ->-%> + if (Is<%=umlClass.name.toClassName()%>(catalogElement)) + return std::dynamic_pointer_cast>(catalogElement)->GetParameterDeclarations(); + <%-}-%> + return std::vector>(); + } + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ConstantClass.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ConstantClass.tpl new file mode 100644 index 00000000..e583b50f --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ConstantClass.tpl @@ -0,0 +1,37 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +<%= helper.makeClassJavaDoc(oscVersion)%> +#pragma once +#include +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + namespace OSC_CONSTANTS + { + <%-element.keySet().sort().each{ key->-%> + const std::string <%=key%> = "<%=element.get(key)%>"; + <%-}-%> + } + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClass.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClass.tpl new file mode 100644 index 00000000..4f9b65a5 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClass.tpl @@ -0,0 +1,206 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "ApiClassWriterInterfaces<%=fileSuffix%>.h" +#include "BaseImpl.h" +#include "IParserMessageLogger.h" +#include "ParserHelper.h" +#include "ParameterValue.h" +#include "INamedReference.h" +#include "MemLeakDetection.h" +#include "KeyNotSupportedException.h" +#include "OscConstants<%=fileSuffix%>.h" +#include "ExportDefinitions.h" + +// helper.getTypeImportCpp(element,packageName).each{importedType->%>import =importedType%> + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getClasses().each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%>Impl: public BaseImpl, public I<%=element.name.toClassName()%>Writer, public std::enable_shared_from_this<<%=element.name.toClassName()%>Impl> + { + <%- List properties = element.umlProperties-%> + private: + <%-properties.each{ property ->-%> + bool _isSet<%=property.name.toClassName()%> = false; +<%- if (property.isProxy() && !property.isList()){-%> + std::shared_ptr>> _<%=property.name.toMemberName()%> = nullptr; +<%}else if (property.isTransient() && property.isList()){-%> + std::vector<<%=property.type.toCppName()%>> _<%=property.name.toMemberName()%> {}; +<%}else if (property.isTransient() && !property.isList()){-%> + <%=property.type.toCppName()%> _<%=property.name.toMemberName()%> {<%=defaultValueHelper.getDefaultValue(element.name.toClassName(),property.name.toMemberName())%>}; +<%}else if (property.isXmlElementProperty() && !property.isList()){-%> + <%=property.type.toCppWriterName()%> _<%=property.name.toMemberName()%> {}; +<%}else if (property.isXmlElementProperty() && property.isList()){-%> + std::vector<<%=property.type.toCppWriterName()%>> _<%=property.name.toMemberName()%> {}; +<%}else {-%> + <%=property.type.toCppName()%> _<%=property.name.toMemberName()%> {<%=defaultValueHelper.getDefaultValue(element.name.toClassName(),property.name.toMemberName())%>}; +<%-}}-%> + + public: + +<%-addResolveFunction(element, "unsignedInt", "unsigned int")-%> +<%-addResolveFunction(element, "unsignedShort", "unsigned short")-%> +<%-addResolveFunction(element, "boolean", "bool")-%> +<%-addResolveFunction(element, "string", "std::string")-%> +<%-addResolveFunction(element, "double", "double")-%> +<%-addResolveFunction(element, "int", "int")-%> +<%-addResolveFunction(element, "dateTime", "DateTime")-%> +<%-if (helper.hasStringTypedValue(element)){-%> + virtual bool IsTypedStringAttribute(std::string& attributeKey) override; + +<%-}-%> + OPENSCENARIOLIB_EXP <%=element.name.toClassName()%>Impl(); + + IOpenScenarioFlexElement* GetOpenScenarioFlexElement() override; + + <%-properties.each{ property ->-%> + <%-if (property.upper== -1){-%> + OPENSCENARIOLIB_EXP std::vector<<%=property.type.toCppName()%>> Get<%=property.name.toClassName()%>() const override; + + <%- if (!property.isTransient()){-%> + OPENSCENARIOLIB_EXP std::vector<<%=property.type.toCppWriterName()%>> GetWriter<%=property.name.toClassName()%>() const override; + <%-} -%> + OPENSCENARIOLIB_EXP int Get<%=property.name.toClassName()%>Size() const override; + OPENSCENARIOLIB_EXP <%=property.type.toCppName()%> Get<%=property.name.toClassName()%>AtIndex(unsigned int index) const override; + <%-}else if (property.isProxy()){-%> + OPENSCENARIOLIB_EXP std::shared_ptr>> Get<%=property.name.toClassName()%>() const override; + <%-}else{-%> + OPENSCENARIOLIB_EXP <%=property.type.toCppName()%> Get<%=property.name.toClassName()%>() const override; + <%-}-%> + <%-}-%> + +<%-properties.each{ property ->-%> + +<%- if (property.isProxy() && !property.isList()){-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(std::shared_ptr>> <%=property.name.toMemberName()%>) override; +<%}else if (property.isTransient() && property.isList()){-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppName()%>>& <%=property.name.toMemberName()%>) override; +<%}else if (property.isTransient() && !property.isList()){-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) override; +<%}else if (property.isXmlElementProperty() && !property.isList()){-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(<%=property.type.toCppWriterName()%> <%=property.name.toMemberName()%>) override; +<%}else if (property.isXmlElementProperty() && property.isList()){-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppWriterName()%>>& <%=property.name.toMemberName()%>) override; +<%}else {-%> + OPENSCENARIOLIB_EXP void Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) override; +<%-}-%> +<%-}-%> + + OPENSCENARIOLIB_EXP void ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) override; + + OPENSCENARIOLIB_EXP SimpleType GetTypeFromAttributeName(std::string& attributeKey) const override; + + <%-def parameterDeclaration = element.getParameterDefinitionProperty();-%> + <%-if (parameterDeclaration){-%> + OPENSCENARIOLIB_EXP bool HasParameterDefinitions() override; + OPENSCENARIOLIB_EXP std::vector> GetParameterDefinitions() const override; + <%-}-%> + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + OPENSCENARIOLIB_EXP std::vector> GetChildren() const override; + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + OPENSCENARIOLIB_EXP std::shared_ptr Clone() override; + + std::shared_ptr GetAdapter(const std::string classifier) override; + + std::weak_ptr GetParent() const override; + + // Implement the IOpenScenarioFlexElement interface + + OPENSCENARIOLIB_EXP std::string GetStringProperty(std::string key) const override; + + uint32_t GetUnsignedIntProperty(std::string key) const override; + + int GetIntProperty(std::string key) const override; + + double GetDoubleProperty(std::string key) const override; + + uint16_t GetUnsignedShortProperty(std::string key) const override; + + bool GetBooleanProperty(std::string key) const override; + + DateTime GetDateTimeProperty(std::string key) const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetChildElement(std::string key) const override; + <%-List listChildElements = element.getXmlElementProperties().findAll(){ it.isList() }-%> + <%-if (!listChildElements.isEmpty()){-%> + <%-}-%> + OPENSCENARIOLIB_EXP std::vector> GetListChildElement(std::string key) const override; + + std::weak_ptr GetParentFlexElement() const override; + + OPENSCENARIOLIB_EXP std::shared_ptr GetReferencedElement(std::string key, std::string name) const override; + + OPENSCENARIOLIB_EXP std::string GetEnumerationLiteral(std::string key) const override; + + std::string GetModelType() const override; + +<%properties = element.getParametrizableAttributes()-%> +<%-properties.each{ property ->-%> + OPENSCENARIOLIB_EXP void WriteParameterTo<%=property.name.toClassName()%>(std::string& parameterName) override; + +<%-}-%> +<%-properties.each{ property ->-%> + OPENSCENARIOLIB_EXP std::string GetParameterFrom<%=property.name.toClassName()%>() const override; + +<%-}-%> +<%-properties.each{ property ->-%> + OPENSCENARIOLIB_EXP bool Is<%=property.name.toClassName()%>Parameterized() override; +<%-}-%> + // children +<%-properties = element.getXmlElementProperties().findAll(){ !it.isList() }-%> +<%-properties.each{ property ->-%> + OPENSCENARIOLIB_EXP <%=property.type.toCppWriterName()%> GetWriter<%=property.name.toClassName()%>() const override; +<%-}-%> +<%-properties = element.umlProperties-%> +<%-properties.each{ property ->-%> +<%-if (property.lower == 0) {-%> + OPENSCENARIOLIB_EXP virtual void Reset<%=property.name.toClassName()%>() override; +<%-}-%> + OPENSCENARIOLIB_EXP virtual bool IsSet<%=property.name.toClassName()%>() const override; +<%-}-%> + }; + + <%-}-%> + + } +} + +<%-def addResolveFunction(element, primitiveType, cTypeString){-%> + <%- def attributes = element.getParametrizableAttributes().findAll(){property -> property.type.name == primitiveType};-%> + <%- if(!attributes.isEmpty()){-%> + virtual void Resolve<%=primitiveType.toClassName()%>Expression(std::string& attributeKey, <%=cTypeString%>& value) override; +<%-}-%> +<%-}-%> \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClassSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClassSource.tpl new file mode 100644 index 00000000..859b5694 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ImplClassSource.tpl @@ -0,0 +1,604 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "ApiClassImpl<%=fileSuffix%>.h" +#include "OscConstants<%=fileSuffix%>.h" +#include "FileContentMessage.h" +#include "IOpenScenarioModelElement.h" +#include "ErrorLevel.h" +#include "NamedReferenceProxy.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getClasses().each{ element->-%> + + IOpenScenarioFlexElement* <%=element.name.toClassName()%>Impl::GetOpenScenarioFlexElement() + { + return this; + } + <%- properties = element.umlProperties-%> + <%-properties.each{ property ->-%> + <%-if (property.upper== -1){-%> + std::vector<<%=property.type.toCppName()%>> <%=element.name.toClassName()%>Impl::Get<%=property.name.toClassName()%>() const + { + std::vector<<%=property.type.toCppName()%>> temp; + for(auto&& elm: _<%=property.name.toMemberName()%>) + temp.push_back(elm); + return temp; + } + <%- if (!property.isTransient()){-%> + std::vector<<%=property.type.toCppWriterName()%>> <%=element.name.toClassName()%>Impl::GetWriter<%=property.name.toClassName()%>() const + { + return _<%=property.name.toMemberName()%>; + } + <%-} -%> + + int <%=element.name.toClassName()%>Impl::Get<%=property.name.toClassName()%>Size() const + { + return static_cast(_<%=property.name.toMemberName()%>.size()); + } + + <%=property.type.toCppName()%> <%=element.name.toClassName()%>Impl::Get<%=property.name.toClassName()%>AtIndex(unsigned int index) const + { + if (index >= 0 && _<%=property.name.toMemberName()%>.size() > index) + { + return _<%=property.name.toMemberName()%>[index]; + } + return <%=property.type.toCppDefaultValue()%>; + } + <%-}else if (property.isProxy()){-%> + std::shared_ptr>> <%=element.name.toClassName()%>Impl::Get<%=property.name.toClassName()%>() const + { + return _<%=property.name.toMemberName()%>; + } + <%-}else{-%> + <%=property.type.toCppName()%> <%=element.name.toClassName()%>Impl::Get<%=property.name.toClassName()%>() const + { + return _<%=property.name.toMemberName()%>; + } + <%-}-%> + <%-}-%> + +<%-properties.each{ property ->-%> + +<%- if (property.isProxy() && !property.isList()){-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(std::shared_ptr>> <%=property.name.toMemberName()%>) +<%}else if (property.isTransient() && property.isList()){-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppName()%>>& <%=property.name.toMemberName()%>) +<%}else if (property.isTransient() && !property.isList()){-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) +<%}else if (property.isXmlElementProperty() && !property.isList()){-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(<%=property.type.toCppWriterName()%> <%=property.name.toMemberName()%>) +<%}else if (property.isXmlElementProperty() && property.isList()){-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(std::vector<<%=property.type.toCppWriterName()%>>& <%=property.name.toMemberName()%>) +<%}else {-%> + void <%=element.name.toClassName()%>Impl::Set<%=property.name.toClassName()%>(const <%=property.type.toCppName()%> <%=property.name.toMemberName()%>) +<%-}-%> + { +<%- if (property.isXmlElementProperty() && property.isList()){-%> + _<%=property.name.toMemberName()%> = <%=property.name.toMemberName()%>; +<%}else {-%> + _<%=property.name.toMemberName()%> = <%=property.name.toMemberName()%>; +<%-}-%> +<%-if (property.isXorElement()){-%> +<%- element.getXmlElementProperties().each{ siblingProperty -> siblingProperty-%> +<%-if (siblingProperty.isXorElement()){-%> +<%-if (siblingProperty != property){-%> + _<%=siblingProperty.name.toMemberName()%> = {}; +<%-}-%> +<%-}else{-%> +<%-throw new Error();-%> +<%-}-%> +<%-}}-%> +<%-if (property.isParameterizableProperty()){-%> + //RemoveAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); +<%-}-%> + _isSet<%=property.name.toClassName()%> = true; + } +<%-}-%> + + std::shared_ptr <%=element.name.toClassName()%>Impl::GetAdapter(const std::string classifier) + { + if (classifier == typeid(<%=element.name.toClassName()%>Impl).name()) + return shared_from_this(); + else if (classifier == typeid(I<%=element.name.toClassName()%>).name()) + return std::dynamic_pointer_cast>(shared_from_this()); + else if (classifier == typeid(I<%=element.name.toClassName()%>Writer).name()) + return std::dynamic_pointer_castWriter>(shared_from_this()); + return BaseImpl::GetAdapter(classifier); + } + + std::weak_ptr <%=element.name.toClassName()%>Impl::GetParent() const + { + return BaseImpl::GetParent(); + } + + // Implement the IOpenScenarioFlexElement interface + + + uint32_t <%=element.name.toClassName()%>Impl::GetUnsignedIntProperty(std::string key) const + { + <%addTypeCode(element,"UnsignedInt")%> + } + + int <%=element.name.toClassName()%>Impl::GetIntProperty(std::string key) const + { + <%addTypeCode(element,"Int")%> + } + + double <%=element.name.toClassName()%>Impl::GetDoubleProperty(std::string key) const + { + <%addTypeCode(element,"Double")%> + } + + uint16_t <%=element.name.toClassName()%>Impl::GetUnsignedShortProperty(std::string key) const + { + <%addTypeCode(element,"UnsignedShort")%> + } + + bool <%=element.name.toClassName()%>Impl::GetBooleanProperty(std::string key) const + { + <%addTypeCode(element,"Boolean")%> + } + + DateTime <%=element.name.toClassName()%>Impl::GetDateTimeProperty(std::string key) const + { + <%addTypeCode(element,"DateTime")%> + } + + <%-List listChildElements = element.getXmlElementProperties().findAll(){ it.isList() }-%> + <%-if (!listChildElements.isEmpty()){-%> + <%-}-%> + + std::weak_ptr <%=element.name.toClassName()%>Impl::GetParentFlexElement() const + { + return std::dynamic_pointer_cast(GetParent().lock()); + } + + + std::string <%=element.name.toClassName()%>Impl::GetModelType() const + { + return "<%=element.name.toClassName()%>"; + } + +<%properties = element.getParametrizableAttributes()-%> +<%-properties.each{ property ->-%> + void <%=element.name.toClassName()%>Impl::WriteParameterTo<%=property.name.toClassName()%>(std::string& parameterName) + { + Textmarker nullTextMarker(-1, -1, ""); + SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, parameterName, nullTextMarker /*no textmarker*/); + _<%=property.name.toMemberName()%> = {}; + } + +<%-}-%> +<%-properties.each{ property ->-%> + std::string <%=element.name.toClassName()%>Impl::GetParameterFrom<%=property.name.toClassName()%>() const + { + auto <%=property.name.toMemberName()%> = OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>; + return GetParameterNameFromAttribute(<%=property.name.toMemberName()%>); + } + +<%-}-%> +<%-properties.each{ property ->-%> + bool <%=element.name.toClassName()%>Impl::Is<%=property.name.toClassName()%>Parameterized() + { + auto keys = GetParameterizedAttributeKeys(); + const auto kIt = std::find(keys.begin(), keys.end(), OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); + if (kIt != keys.end()) + return true; + return false; + } + +<%-}-%> + // children +<%-properties = element.getXmlElementProperties().findAll(){ !it.isList() }-%> +<%-properties.each{ property ->-%> + <%=property.type.toCppWriterName()%> <%=element.name.toClassName()%>Impl::GetWriter<%=property.name.toClassName()%>() const + { + return std::dynamic_pointer_cast<<%=property.type.toCppTemplateName()%>Writer>(_<%=property.name.toMemberName()%>); + } +<%-}-%> + <%- properties = element.umlProperties-%> + + <%=element.name.toClassName()%>Impl::<%=element.name.toClassName()%>Impl() + { + /** + * Filling the property to type map + */ + <%-properties.each{ property ->-%> + <%-if (property.isProxy()){-%> + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, SimpleType::STRING); + <%-} else if (property.type.isPrimitiveType()){-%> + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, SimpleType::<%=property.type.name.toUpperNameFromMemberName()%>); + <%-} else if (property.type.isEnumeration()){-%> + _propertyToType.emplace(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, SimpleType::ENUM_TYPE); + <%-}-%> + <%-}-%> + } + + void <%=element.name.toClassName()%>Impl::ResolveParameterInternal(IParserMessageLogger& logger, std::string& attributeKey, std::string& parameterLiteralValue) + { + <%-element.getParametrizableAttributes().eachWithIndex { property, index ->-%> + <%=index==0?"":"else "%>if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + <%-if (property.isProxy()){-%> + // Proxy + const auto kProxy = std::make_shared>>(parameterLiteralValue); + _<%=property.name.toMemberName()%> = std::dynamic_pointer_cast>>(kProxy); + AddResolvedParameter(attributeKey); + _isSet<%=property.name.toClassName()%> = true; + <%-} else if (property.type.isPrimitiveType()) {-%> + // Simple type + _<%=property.name.toMemberName()%> = ParserHelper::Parse<%=property.type.name.toClassName()%>(logger, parameterLiteralValue, *GetTextmarker(attributeKey)); + AddResolvedParameter(attributeKey); + _isSet<%=property.name.toClassName()%> = true; + <%-} else {-%> + // Enumeration Type + const auto kResult = <%=property.type.name.toClassName()%>::GetFromLiteral(parameterLiteralValue); + if (kResult != <%=property.type.name.toClassName()%>::UNKNOWN) + { + _<%=property.name.toMemberName()%> = kResult; + AddResolvedParameter(attributeKey); + _isSet<%=property.name.toClassName()%> = true; + } + else + { + auto msg = FileContentMessage("Value '" + parameterLiteralValue + "' is not allowed.", ERROR, *GetTextmarker(attributeKey)); + logger.LogMessage(msg ); + } + <%-}-%> + } + <%-}-%> + } + + SimpleType <%=element.name.toClassName()%>Impl::GetTypeFromAttributeName(std::string& attributeKey) const + { + const auto kIt = _propertyToType.find(attributeKey); + if (kIt != _propertyToType.end()) + return kIt->second; + return SimpleType::UNKNOWN; + } + + <%-def parameterDeclaration = element.getParameterDefinitionProperty();-%> + <%-if (parameterDeclaration){-%> + + bool <%=element.name.toClassName()%>Impl::HasParameterDefinitions() + { + return true; + } + + std::vector> <%=element.name.toClassName()%>Impl::GetParameterDefinitions() const + { + std::vector> result; + if (!_<%=parameterDeclaration.name.toMemberName()%>.empty()) + { + for (auto&& parameterDeclaration :_<%=parameterDeclaration.name.toMemberName()%>) + { + auto parameterType = parameterDeclaration->GetParameterType().GetLiteral(); + auto parameterValue = std::make_shared(parameterDeclaration->GetName(), GetParameterType(parameterType), parameterDeclaration->GetValue()); + result.push_back(parameterValue); + } + } + return result; + } + <%-}-%> + + /** + * A list of all aggregated children (lists are flattened). This may be used for applying a specific + * method for any child. + * @return a list with all children (as BaseImpl) + */ + std::vector> <%=element.name.toClassName()%>Impl::GetChildren() const + { + std::vector> result; + + <%-properties = element.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + <%- if (property.isList()){-%> + auto <%=property.name.toMemberName()%> = GetWriter<%=property.name.toClassName()%>(); + if (!<%=property.name.toMemberName()%>.empty()) + { + for(auto&& item : <%=property.name.toMemberName()%>) + { + result.push_back(std::dynamic_pointer_cast(item) ); + } + } + <%-} else{-%> + const auto k<%=property.name.toClassName()%> = GetWriter<%=property.name.toClassName()%>(); + if (k<%=property.name.toClassName()%>) + { + result.push_back(std::dynamic_pointer_cast(k<%=property.name.toClassName()%>)); + } + <%-}-%> + <%-}-%> + return result; + } + + /** + * Making a (deep) clone this object. This is useful and used for importing elements from catalogs. + * @return a deep copy of the object. + */ + std::shared_ptr <%=element.name.toClassName()%>Impl::Clone() + { + auto clonedObject = std::make_shared<<%=element.name.toClassName()%>Impl>(); + CloneStartMarker(*clonedObject); + CloneEndMarker(*clonedObject); + CloneAttributeKeyToStartMarker(*clonedObject); + CloneAttributeKeyToEndMarker(*clonedObject); + CloneAttributeKeyToParameterNameMap(*clonedObject); + + // clone attributes; + <%-properties = element.getXmlAttributeProperties();-%> + <%-properties.each{ property -> -%> + <%-if (property.isProxy()){-%> + // Proxy + auto proxy = std::make_shared>>(*std::dynamic_pointer_cast>>(Get<%=property.name.toClassName()%>())); + proxy->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->_<%=property.name.toMemberName()%> = proxy; + + <%-} else if (property.type.isPrimitiveType()) {-%> + // Simple type + clonedObject->_<%=property.name.toMemberName()%> = Get<%=property.name.toClassName()%>(); + <%-} else {-%> + // Enumeration Type + const auto k<%=property.name.toClassName()%> = Get<%=property.name.toClassName()%>(); + if ( k<%=property.name.toClassName()%>.GetLiteral() != "UNKNOWN" ) + { + clonedObject->_<%=property.name.toMemberName()%> = <%=property.type.name.toClassName()%>::GetFromLiteral(k<%=property.name.toClassName()%>.GetLiteral()); + } + <%-}-%> + <%-}-%> + // clone indicators + <%-properties.findAll(){property -> property.lower == 0}.each{ property ->-%> + clonedObject->_isSet<%=property.name.toClassName()%> = _isSet<%=property.name.toClassName()%>; + <%-}-%> + // clone children + <%-properties = element.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + <%- if (property.isList()){-%> + const auto k<%=property.name.toClassName()%> = GetWriter<%=property.name.toClassName()%>(); + if (!k<%=property.name.toClassName()%>.empty()) + { + std::vectorWriter>> clonedList; + for(auto&& kItem : k<%=property.name.toClassName()%>) + { + auto clonedChild = std::dynamic_pointer_cast<<%=property.type.name.toClassName()%>Impl>(kItem)->Clone(); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedList.push_back(std::dynamic_pointer_castWriter>(clonedChild)); + } + clonedObject->Set<%=property.name.toClassName()%>(clonedList); + } + <%-} else{-%> + const auto k<%=property.name.toClassName()%> = GetWriter<%=property.name.toClassName()%>(); + if (k<%=property.name.toClassName()%>) + { + auto clonedChild = std::dynamic_pointer_cast<<%=property.type.name.toClassName()%>Impl>(k<%=property.name.toClassName()%>)->Clone(); + auto clonedChildI<%=property.type.name.toClassName()%> = std::dynamic_pointer_cast>(clonedChild); + clonedChild->SetParent(std::static_pointer_cast(clonedObject)); + clonedObject->Set<%=property.name.toClassName()%>(std::dynamic_pointer_castWriter>(clonedChildI<%=property.type.name.toClassName()%>)); + } + <%-}-%> + <%-}-%> + return clonedObject; + } + + std::string <%=element.name.toClassName()%>Impl::GetStringProperty(std::string key) const + { + // proxies and string attributes + <%- List proxiesAndStringAttributes = element.umlProperties.findAll(){ it.isProxy() || (it.type.isPrimitiveType() && it.type.name.toClassName().equals("String")) }-%> + <%-if (proxiesAndStringAttributes.isEmpty()){-%> + throw KeyNotSupportedException(); + <%-} else {-%> + if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-proxiesAndStringAttributes.eachWithIndex{ property, index ->-%> + <%=index != 0?"else ":" "%> + if (key == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + <%-if(property.isProxy()){-%> + // Get the Proxy + auto <%=property.name.toMemberName()%> = Get<%=property.name.toClassName()%>(); + return <%=property.name.toMemberName()%>!= nullptr ? <%=property.name.toMemberName()%>->GetNameRef() : ""; + <%-}else{-%> + return Get<%=property.name.toClassName()%>(); + <%-}-%> + } + <%-}-%> + throw KeyNotSupportedException(); + <%-}-%> + } + + std::shared_ptr <%=element.name.toClassName()%>Impl::GetChildElement(std::string key) const + { + <%-List childElements = element.getXmlElementProperties().findAll(){ !it.isList() }-%> + <%-if (childElements.isEmpty()){-%> + throw KeyNotSupportedException(); + <%-} else {-%> + if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-childElements.eachWithIndex{ property, index ->-%> + <%index!=0?"else ":" "%> + if (key == OSC_CONSTANTS::ELEMENT__<%=property.name.toUpperNameFromMemberName()%>) + { + return std::dynamic_pointer_cast(Get<%=property.name.toClassName()%>()); + } + <%-}-%> + throw KeyNotSupportedException(); + <%-}-%> + } + + std::vector> <%=element.name.toClassName()%>Impl::GetListChildElement(std::string key) const + { + <%-if (listChildElements.isEmpty()){-%> + throw KeyNotSupportedException(); + <%-} else {-%> + if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-listChildElements.eachWithIndex{ property, index ->-%> + <%-if (!property.isWrappedList()){-%> + <%index!=0?"else ":" "%> + if (key == OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toMemberName().toUpperNameFromMemberName()%>) + { + std::vector> vect; + for (auto&& elem : Get<%=property.name.toClassName()%>()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + <%-} else {-%> + if (key == OSC_CONSTANTS::ELEMENT__<%=property.getXsdWrapperElementName().toMemberName().toUpperNameFromMemberName()%>) + { + std::vector> vect; + for (auto&& elem : Get<%=property.name.toClassName()%>()) + vect.push_back(std::dynamic_pointer_cast(elem)); + return vect; + <%-}%> + }<%-}-%> + + throw KeyNotSupportedException(); + <%-}-%> + } + + std::shared_ptr <%=element.name.toClassName()%>Impl::GetReferencedElement(std::string key, std::string name) const + { + <%- List proxies = element.umlProperties.findAll(){ it.isProxy() }-%> + <%-if (proxies.isEmpty()){-%> + throw KeyNotSupportedException(); + <%-} else {-%> + if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-proxies.eachWithIndex{ property, index ->-%> + <%index!=0?"else ":" "%> + if (key == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + // Get the Proxy + auto <%=property.name.toMemberName()%> = Get<%=property.name.toClassName()%>(); + return <%=property.name.toMemberName()%> != nullptr ? std::dynamic_pointer_cast(<%=property.name.toMemberName()%>->GetTargetObject()) : nullptr; + }<%-}-%> + + throw KeyNotSupportedException(); + <%-}-%> + } + + std::string <%=element.name.toClassName()%>Impl::GetEnumerationLiteral(std::string key) const + { + <%- List enumerationProperties = element.umlProperties.findAll(){ it.type.isEnumeration()}-%> + <%-if (enumerationProperties.isEmpty()){-%> + throw KeyNotSupportedException(); + <%-} else {-%> + if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-enumerationProperties.eachWithIndex{ property, index ->-%> + <%=index!= 0?"else ":" "%> + if (key == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + auto <%=property.name.toMemberName()%> = Get<%=property.name.toClassName()%>(); + return <%=property.name.toMemberName()%>.GetLiteral() != "UNKNOWN" ? <%=property.name.toMemberName()%>.GetLiteral() : ""; + }<%-}-%> + + throw KeyNotSupportedException(); + <%-}-%> + } +<%-addResolveFunction(element, "unsignedInt", "unsigned int")-%> +<%-addResolveFunction(element, "unsignedShort", "unsigned short")-%> +<%-addResolveFunction(element, "boolean", "bool")-%> +<%-addResolveFunction(element, "string", "std::string")-%> +<%-addResolveFunction(element, "double", "double")-%> +<%-addResolveFunction(element, "int", "int")-%> +<%-addResolveFunction(element, "dateTime", "DateTime")-%> + +<%-if (helper.hasStringTypedValue(element)){-%> + bool <%=element.name.toClassName()%>Impl::IsTypedStringAttribute(std::string& attributeKey) + { + return (attributeKey == OSC_CONSTANTS::ATTRIBUTE__VALUE); + } +<%-}-%> + +<%-properties = element.umlProperties-%> +<%-properties.each{ property ->-%> +<%-if (property.lower == 0) {-%> + void <%=element.name.toClassName()%>Impl::Reset<%=property.name.toClassName()%>() + { + _isSet<%=property.name.toClassName()%> = false; + <%- if (property.isProxy() && !property.isList()){-%> + _<%=property.name.toMemberName()%> = nullptr; + <%-}else{-%> + _<%=property.name.toMemberName()%> = {<%=defaultValueHelper.getDefaultValue(element.name.toClassName(),property.name.toMemberName())%>}; + <%-}-%> + + } +<%-}-%> + bool <%=element.name.toClassName()%>Impl::IsSet<%=property.name.toClassName()%>() const + { + return _isSet<%=property.name.toClassName()%>; + } +<%-}-%> +<%-}-%> + } +} + +<%-def addTypeCode(element, String primitiveTypeName){-%> +<%- List properties = element.umlProperties.findAll(){ it.type.isPrimitiveType() && it.type.name.toClassName().equals(primitiveTypeName) }-%> + <%-if (properties.isEmpty()){-%> +throw KeyNotSupportedException(); + <%-} else {-%> +if (key.empty()) + { + throw KeyNotSupportedException(); + } + <%-properties.eachWithIndex{ property, index ->-%> + <%=index != 0?"else ":" "%> + if (key == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + return Get<%=property.name.toClassName()%>(); + }<%-}-%> + + throw KeyNotSupportedException(); + <%-}-%> + <%-}-%> + + <%-def addResolveFunction(element, primitiveType, cTypeString){-%> + <%- def attributes = element.getParametrizableAttributes().findAll(){property -> property.type.name == primitiveType};-%> + <%- if(!attributes.isEmpty()){-%> + void <%=element.name.toClassName()%>Impl::Resolve<%=primitiveType.toClassName()%>Expression(std::string& attributeKey, <%=cTypeString%>& value) + { + <%-attributes.eachWithIndex { property, index ->-%> + <%=index==0?"":"else "%>if (attributeKey == OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>) + { + // Simple type + _<%=property.name.toMemberName()%> = value; + AddResolvedParameter(attributeKey); + _isSet<%=property.name.toClassName()%> = true; + } + <%-}-%> + + } +<%-}-%> +<%-}-%> \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelper.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelper.tpl new file mode 100644 index 00000000..e12e6c38 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelper.tpl @@ -0,0 +1,43 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include "IScenarioChecker<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class RangeCheckerHelper + { + public: + /** + * Connects all range checker rules to a global scenarioChecker + * @param scenarioChecker the global scenarioChecker + */ + OPENSCENARIOLIB_EXP static void AddAllRangeCheckerRules(std::shared_ptr scenarioChecker); + }; + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelperSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelperSource.tpl new file mode 100644 index 00000000..3c613919 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerHelperSource.tpl @@ -0,0 +1,38 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + + +#include "RangeCheckerHelper<%=fileSuffix%>.h" +#include "RangeCheckerRules<%=fileSuffix%>.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + void RangeCheckerHelper::AddAllRangeCheckerRules(std::shared_ptr scenarioChecker) + { + <%- element.each{ umlClass ->-%> + scenarioChecker->Add<%=umlClass.name.toClassName()%>CheckerRule(std::shared_ptr<<%=umlClass.name.toClassName()%>RangeCheckerRule>(new <%=umlClass.name.toClassName()%>RangeCheckerRule())); + <%-}-%> + } + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRule.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRule.tpl new file mode 100644 index 00000000..9bd69850 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRule.tpl @@ -0,0 +1,48 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include "IParserMessageLogger.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "RangeCheckerRule.h" +#include "MemLeakDetection.h" +#include "ExportDefinitions.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getClasses().findAll(){element->rangeCheckerRules[element.name.toClassName()] != null}.each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%>RangeCheckerRule: public RangeCheckerRule + { + private: + void Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const; + public: + <%=element.name.toClassName()%>RangeCheckerRule() = default; + OPENSCENARIOLIB_EXP void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + OPENSCENARIOLIB_EXP void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + }; + + <%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRuleSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRuleSource.tpl new file mode 100644 index 00000000..a76bb3e3 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/RangeCheckerRuleSource.tpl @@ -0,0 +1,83 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#define _USE_MATH_DEFINES +#include "RangeCheckerRules<%=fileSuffix%>.h" +#include "OscConstants<%=fileSuffix%>.h" +#include + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- model.getClasses().findAll(){element->rangeCheckerRules[element.name.toClassName()] != null}.each{ element->-%> + void <%=element.name.toClassName()%>RangeCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(messageLogger, nullptr, object); + } + + void <%=element.name.toClassName()%>RangeCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + Apply(nullptr, messageLogger, object); + } + + void <%=element.name.toClassName()%>RangeCheckerRule::Apply(std::shared_ptr fileMessageLogger, std::shared_ptr treeMessageLogger, std::shared_ptr object) const + { + <%-Map propertyMap = rangeCheckerRules[element.name.toClassName()];-%> + <%-List properties = element.getXmlAttributeProperties().findAll(){property-> propertyMap[property.name.toMemberName()] != null};-%> + <%-properties.each{property -> -%> + <%-Map rangeMap = propertyMap[property.name.toMemberName()]-%> + if (object) + { + auto typedObject = std::dynamic_pointer_cast>(object); + const auto k<%=property.name.toClassName()%> = typedObject->Get<%=property.name.toClassName()%>(); + <%-if (rangeMap["upperBoundValue"]){-%> + if (!(k<%=property.name.toClassName()%> <%=rangeMap["upperBoundOperator"]%> <%=rangeMap["upperBoundValue"].replaceFirst("java.lang.Math.PI", "M_PI")%>)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>,std::to_string(typedObject->Get<%=property.name.toClassName()%>()), "<%=rangeMap["upperBoundOperator"]%>", "<%=rangeMap["upperBoundValueDisplay"]%>", OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>,std::to_string(typedObject->Get<%=property.name.toClassName()%>()), "<%=rangeMap["upperBoundOperator"]%>", "<%=rangeMap["upperBoundValueDisplay"]%>", OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); + } + } + <%-}-%> + <%-if (rangeMap["lowerBoundValue"]){-%> + if (!(k<%=property.name.toClassName()%> <%=rangeMap["lowerBoundOperator"]%> <%=rangeMap["lowerBoundValue"].replaceFirst("java.lang.Math.PI", "M_PI")%>)) + { + if (fileMessageLogger) + { + LogFileContentMessage(typedObject, fileMessageLogger, OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%> , std::to_string(typedObject->Get<%=property.name.toClassName()%>()), "<%=rangeMap["lowerBoundOperator"]%>", "<%=rangeMap["lowerBoundValueDisplay"]%>", OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); + } + else + { + LogTreeContentMessage(typedObject, treeMessageLogger, OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%> , std::to_string(typedObject->Get<%=property.name.toClassName()%>()), "<%=rangeMap["lowerBoundOperator"]%>", "<%=rangeMap["lowerBoundValueDisplay"]%>", OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>); + } + } + <%-}-%> + } + <%-}-%> + } + + <%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImpl.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImpl.tpl new file mode 100644 index 00000000..f0b003c5 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImpl.tpl @@ -0,0 +1,98 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include +#include +#include "IParserMessageLogger.h" +#include "ICheckerRule.h" +#include "IScenarioChecker<%=fileSuffix%>.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include +#include "ExportDefinitions.h" +#include "IContentMessageLogger.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class ScenarioCheckerImpl: public IScenarioChecker + { + private: + enum ContextMode { MODE_TREE, MODE_FILE }; + + //string is typeid(class).name() + std::map>> _typeToCheckerRuleList; + <%- element.each{ umlClass ->-%> + void Apply<%=umlClass.name.toClassName()%>CheckerRules(std::shared_ptr messageLogger, const std::shared_ptr object, const ContextMode contextMode) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(I<%=umlClass.name.toClassName()%>).name()]; + + auto typedObject = std::dynamic_pointer_cast>(object); + if ( !checkerRulesForType.empty() ) + { + for (auto& checkerRule:checkerRulesForType) + { + auto typedCheckerRule = std::dynamic_pointer_cast (checkerRule); + if (contextMode == MODE_FILE) + { + typedCheckerRule->ApplyRuleInFileContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + else + { + typedCheckerRule->ApplyRuleInTreeContext(std::dynamic_pointer_cast(messageLogger), typedObject); + } + } + } + + // getChildren + <%-properties = umlClass.getXmlElementProperties();-%> + <%- properties.each { property -> -%> + <%-if (property.isList()){-%> + const auto k<%=property.name.toClassName()%> = typedObject->Get<%=property.name.toClassName()%>(); + for(auto& kListItem: k<%=property.name.toClassName()%>) + { + if ( kListItem ) + Apply<%=property.type.name.toClassName()%>CheckerRules(messageLogger, kListItem, contextMode); + } + <%-} else {-%> + const auto k<%=property.name.toClassName()%> = typedObject->Get<%=property.name.toClassName()%>(); + if ( k<%=property.name.toClassName()%>) + { + Apply<%=property.type.name.toClassName()%>CheckerRules(messageLogger, k<%=property.name.toClassName()%>, contextMode); + } + <%-}-%> + <%-}-%> + } + <%-}-%> + + public: + OPENSCENARIOLIB_EXP void CheckScenarioInFileContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) override; + OPENSCENARIOLIB_EXP void CheckScenarioInTreeContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) override; + <%- element.each{ umlClass ->-%> + OPENSCENARIOLIB_EXP void Add<%=umlClass.name.toClassName()%>CheckerRule(std::shared_ptr checkerRule) override; + <%-}-%> + }; + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImplSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImplSource.tpl new file mode 100644 index 00000000..bac82ef5 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerImplSource.tpl @@ -0,0 +1,48 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "ScenarioCheckerImpl<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + void ScenarioCheckerImpl::CheckScenarioInFileContext(std::shared_ptr messageLogger, const std::shared_ptr openScenario) + { + ApplyOpenScenarioCheckerRules(std::dynamic_pointer_cast(messageLogger), openScenario, MODE_FILE); + } + + void ScenarioCheckerImpl::CheckScenarioInTreeContext(std::shared_ptr messageLogger, const std::shared_ptr openScenario) + { + ApplyOpenScenarioCheckerRules(std::dynamic_pointer_cast(messageLogger), openScenario, MODE_TREE); + } + + <%- element.each{ umlClass ->-%> + void ScenarioCheckerImpl::Add<%=umlClass.name.toClassName()%>CheckerRule(const std::shared_ptr checkerRule) + { + auto checkerRulesForType = _typeToCheckerRuleList[typeid(I<%=umlClass.name.toClassName()%>).name()]; + checkerRulesForType.push_back(std::static_pointer_cast (checkerRule)); + _typeToCheckerRuleList[typeid(I<%=umlClass.name.toClassName()%>).name()] = checkerRulesForType; + } + + <%-}-%> + + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerInterface.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerInterface.tpl new file mode 100644 index 00000000..d7d7d032 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/ScenarioCheckerInterface.tpl @@ -0,0 +1,62 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include "IParserMessageLogger.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "ICheckerRule.h" +#include "MemLeakDetection.h" +#include "ITreeMessageLogger.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(oscVersion, " ")%> + class IScenarioChecker + { + public: + IScenarioChecker() = default; + virtual ~IScenarioChecker() = default; + + /** + * Checks the scenario in a file context + * + * @param messageLogger the logger for file context + * @param openScenario the root of the tree + */ + + virtual void CheckScenarioInFileContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) = 0; + + /** + * Checks the scenario in a tree context + * + * @param messageLogger the logger for file context + * @param openScenario the root of the tree + */ + + virtual void CheckScenarioInTreeContext(std::shared_ptr messageLogger, std::shared_ptr openScenario) = 0; + + <%- element.each{ umlClass ->-%> + virtual void Add<%=umlClass.name.toClassName()%>CheckerRule(std::shared_ptr checkerRule) = 0; + <%-}-%> + }; + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRule.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRule.tpl new file mode 100644 index 00000000..88033012 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRule.tpl @@ -0,0 +1,56 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include +#include +#include "UnionCheckerRule.h" +#include "IParserMessageLogger.h" +#include "ITreeMessageLogger.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" +#include "PropertyTreeContext.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + +<%- element.each{ umlClass ->-%> +<%= helper.makeClassJavaDoc(umlClass, oscVersion, " ")%> + class <%=umlClass.name.toClassName()%>UnionCheckerRule: public UnionCheckerRule + { + private: + std::vector GetNotNullChildren(std::shared_ptr> object); + + <%-if (!(properties.findAll(){property-> property.lower==0})){-%> + std::vector GetAllChildren(); + + public: + <%=umlClass.name.toClassName()%>UnionCheckerRule(); + + void ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) override; + void ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object); + <%-}-%> + + }; +<%-}-%> + } +} + diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRuleSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRuleSource.tpl new file mode 100644 index 00000000..3d74e131 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/UnionCheckerRuleSource.tpl @@ -0,0 +1,104 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "UnionCheckerRules<%=fileSuffix%>.h" +#include "OscConstants<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + +<%- element.each{ umlClass ->-%> + std::vector <%=umlClass.name.toClassName()%>UnionCheckerRule::GetNotNullChildren(std::shared_ptr> object) + { + std::vector propertyNamesNotNull; + <%-properties = umlClass.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + <%-if (!property.isList()){-%> + if (object->Get<%=property.name.toClassName()%>()) + <%-}else{-%> + if (object->Get<%=property.name.toClassName()%>Size() != 0) + <%-}-%> + { + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__<%=property.name.toUpperNameFromMemberName()%>); + } + <%-}-%> + return propertyNamesNotNull; + } + + <%-if (!(properties.findAll(){property-> property.lower==0})){-%> + std::vector <%=umlClass.name.toClassName()%>UnionCheckerRule::GetAllChildren() + { + std::vector propertyNamesNotNull; + <%-properties = umlClass.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + propertyNamesNotNull.push_back(OSC_CONSTANTS::ELEMENT__<%=property.name.toUpperNameFromMemberName()%>); + <%-}-%> + return propertyNamesNotNull; + } + <%-}-%> + + <%=umlClass.name.toClassName()%>UnionCheckerRule::<%=umlClass.name.toClassName()%>UnionCheckerRule() = default; + + void <%=umlClass.name.toClassName()%>UnionCheckerRule::ApplyRuleInFileContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast>(object); + + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = FileContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + <%-if (!(properties.findAll(){property-> property.lower==0})){-%> + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto msg = FileContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, *GetTextmarker(typedObject)); + messageLogger->LogMessage(msg); + } + <%-}-%> + } + + void <%=umlClass.name.toClassName()%>UnionCheckerRule::ApplyRuleInTreeContext(std::shared_ptr messageLogger, std::shared_ptr object) + { + auto typedObject = std::dynamic_pointer_cast>(object); + auto propertyNamesNotNull = GetNotNullChildren(typedObject); + if (propertyNamesNotNull.size() > 1) + { + auto msg = TreeContentMessage(GetTooManyMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, propertyNamesNotNull)); + messageLogger->LogMessage(msg); + } + <%-if (!(properties.findAll(){property-> property.lower==0})){-%> + // There must be one item set + if (propertyNamesNotNull.size() == 0) + { + auto allChildren = GetAllChildren(); + auto msg = TreeContentMessage(GetTooFewMessage(propertyNamesNotNull), ERROR, std::make_shared(typedObject, allChildren)); + messageLogger->LogMessage(msg); + } + <%-}-%> + } +<%-}-%> + } +} + + diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClass.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClass.tpl new file mode 100644 index 00000000..1e59a3b3 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClass.tpl @@ -0,0 +1,53 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once +#include "ApiClassWriterInterfaces<%=fileSuffix%>.h" +#include "MemLeakDetection.h" +#include "tinyxml2.h" +#include "ExportDefinitions.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + + class OpenScenarioXmlExporter + { + + public: + OPENSCENARIOLIB_EXP std::shared_ptr CreateXmlDocument(std::shared_ptr openScenarioWriter); + private: +<%- element.getClasses().each{ umlClass ->-%> + + /** + * Fills a dom element of type <%=umlClass.name.toClassName()%> + * @param document the xml document to create child elements + * @param elementNode the element node to fill + * @param <%=umlClass.name.toMemberName()%>Writer the writer the element is filled from. + */ + void Fill<%=umlClass.name.toClassName()%>Node(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptrWriter> <%=umlClass.name.toMemberName()%>Writer); +<%-}-%> + }; + + } +} + diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClassSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClassSource.tpl new file mode 100644 index 00000000..755d94c7 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlExporterClassSource.tpl @@ -0,0 +1,159 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + + +#include +#include +#include "XmlExportHelper.h" +#include "IParserMessageLogger.h" +#include "OscConstants<%=fileSuffix%>.h" +#include "INamedReference.h" +#include "ApiClassImpl<%=fileSuffix%>.h" +#include "ApiClassInterfaces<%=fileSuffix%>.h" + +#include "OpenScenarioXmlExporter<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + std::shared_ptr OpenScenarioXmlExporter::CreateXmlDocument(std::shared_ptr openScenarioWriter) + { + auto document = std::make_shared(); + + try + { + tinyxml2::XMLNode* root = document->NewElement("OpenSCENARIO"); + document->InsertFirstChild(root); + FillOpenScenarioNode(document, root, openScenarioWriter); + } + catch (std::exception& e) + { + (void)e; + // do nothing + } + + return document; + } + + <%- element.getClasses().each{ umlClass ->-%> + void OpenScenarioXmlExporter::Fill<%=umlClass.name.toClassName()%>Node(std::shared_ptr document, tinyxml2::XMLNode* elementNode, std::shared_ptrWriter> <%=umlClass.name.toMemberName()%>Writer) + { + // Add Attributes (Parameters) + <%- umlClass.umlProperties.findAll(){p-> !p.isTransient()}.each{ property -> -%> + <%- if (property.isParameterizableProperty() && !property.isProxy()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->Get<%=property.name.toClassName()%>(); + <%-if (property.isOptional()){-%> + if (!( k<%=property.name.toClassName()%><%=property.type.toCppIsDefaultValue()%>)) + { + <%-if (property.type.isPrimitiveType()){-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), XmlExportHelper::ToXmlStringFrom<%=property.type.name.toClassName()%>( k<%=property.name.toClassName()%>).c_str()); + <%-} else {-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), k<%=property.name.toClassName()%>.GetLiteral().c_str()); + <%-}-%> + } + else if (<%=umlClass.name.toMemberName()%>Writer->Is<%=property.name.toClassName()%>Parameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), <%=umlClass.name.toMemberName()%>Writer->GetParameterFrom<%=property.name.toClassName()%>().c_str()); + } + <%-} else {-%> + if (<%=umlClass.name.toMemberName()%>Writer->Is<%=property.name.toClassName()%>Parameterized()) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), <%=umlClass.name.toMemberName()%>Writer->GetParameterFrom<%=property.name.toClassName()%>().c_str()); + } + else + { + <%-if (property.type.isPrimitiveType()){-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), XmlExportHelper::ToXmlStringFrom<%=property.type.name.toClassName()%>( k<%=property.name.toClassName()%>).c_str()); + <%-} else {-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), k<%=property.name.toClassName()%>.GetLiteral().c_str()); + <%-}-%> + } + <%-}-%> + <%-}else if (property.isProxy()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->Get<%=property.name.toClassName()%>(); + if (k<%=property.name.toClassName()%>) + { + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), XmlExportHelper::ToXmlStringFromString(k<%=property.name.toClassName()%>->GetNameRef()).c_str()); + } + <%-}else if (!property.isXmlElementProperty()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->Get<%=property.name.toClassName()%>(); + if (!(k<%=property.name.toClassName()%><%=property.type.toCppIsDefaultValue()%>)) + { + <%-if (property.type.isPrimitiveType()){-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), XmlExportHelper::ToXmlStringFrom<%=property.type.name.toClassName()%>(k<%=property.name.toClassName()%>).c_str()); + <%-} else {-%> + elementNode->ToElement()->SetAttribute(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>.c_str(), k<%=property.name.toClassName()%>.GetLiteral().c_str()); + <%-}-%> + } + <%-}else if (umlClass.isSimpleContent()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->Get<%=property.name.toClassName()%>(); + if (!k<%=property.name.toClassName()%>.empty()) + { + elementNode->InsertEndChild(document->NewText(k<%=property.name.toClassName()%>.c_str())); + } + <%-}else if (!property.isList()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->GetWriter<%=property.name.toClassName()%>(); + if (k<%=property.name.toClassName()%>) + { + <%-if (property.type.isGroup()){-%> + Fill<%=property.type.name.toClassName()%>Node(document, elementNode, k<%=property.name.toClassName()%>); + <%-} else {-%> + tinyxml2::XMLNode* <%=property.name.toMemberName()%>Element = document->NewElement(OSC_CONSTANTS::ELEMENT__<%=property.name.toUpperNameFromMemberName()%>.c_str()); + elementNode->InsertEndChild(<%=property.name.toMemberName()%>Element); + Fill<%=property.type.name.toClassName()%>Node(document, <%=property.name.toMemberName()%>Element, k<%=property.name.toClassName()%>); + <%-}-%> + } + <%-}else if (property.isWrappedList()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->GetWriter<%=property.name.toClassName()%>(); + if (!k<%=property.name.toClassName()%>.empty()) + { + tinyxml2::XMLNode* <%=property.name.toMemberName()%>WrapperElement = document->NewElement(OSC_CONSTANTS::ELEMENT__<%=property.getXsdWrapperElementName().toUpperNameFromMemberName()%>.c_str()); + elementNode->InsertEndChild(<%=property.name.toMemberName()%>WrapperElement); + for (auto <%=property.name.toMemberName()%>WriterItem : k<%=property.name.toClassName()%>) + { + tinyxml2::XMLNode* <%=property.name.toMemberName()%>Element = document->NewElement(OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toUpperNameFromMemberName()%>.c_str()); + <%=property.name.toMemberName()%>WrapperElement->InsertEndChild(<%=property.name.toMemberName()%>Element); + Fill<%=property.type.name.toClassName()%>Node(document, <%=property.name.toMemberName()%>Element, <%=property.name.toMemberName()%>WriterItem); + } + } + <%-}else if (property.isList()){-%> + const auto k<%=property.name.toClassName()%> = <%=umlClass.name.toMemberName()%>Writer->GetWriter<%=property.name.toClassName()%>(); + if (!k<%=property.name.toClassName()%>.empty()) + { + for (auto <%=property.name.toMemberName()%>WriterItem : k<%=property.name.toClassName()%>) + { + tinyxml2::XMLNode* <%=property.name.toMemberName()%>Element = document->NewElement(OSC_CONSTANTS::ELEMENT__<%=property.getXmlTagName().toUpperNameFromMemberName()%>.c_str()); + elementNode->InsertEndChild(<%=property.name.toMemberName()%>Element); + Fill<%=property.type.name.toClassName()%>Node(document, <%=property.name.toMemberName()%>Element, <%=property.name.toMemberName()%>WriterItem); + + } + } + <%-} else {-%> + Error <%=property.name.toMemberName()%> + <%-}-%> + <%-}-%> + // Add Children (Normal, Wrapped, Unwrapped, simpleContent); + } +<%-}-%> + + } +} + diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClass.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClass.tpl new file mode 100644 index 00000000..84c77f27 --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClass.tpl @@ -0,0 +1,162 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#pragma once + +#include "IParserMessageLogger.h" +#include "OscConstants<%=fileSuffix%>.h" +#include "IndexedElement.h" +#include "ParserContext.h" +#include "BaseImpl.h" +#include +#include "ApiClassImpl<%=fileSuffix%>.h" +#include "XmlAllParser.h" +#include "XmlChoiceParser.h" +#include "XmlSequenceParser.h" +#include +#include "XmlComplexTypeParser.h" +#include "XmlGroupParser.h" +#include "XmlSimpleContentParser.h" +#include "MemLeakDetection.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + <%- element.each{ element->-%> + class <%=element.name.toClassName()%>XmlParser; + <%-}-%> + + <%- element.each{ element->-%> + + <%- if (element.isComplexType()){-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%>XmlParser: public XmlComplexTypeParser + { + <%-}else if (element.isGroup()){-%> + +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%>XmlParser: public XmlGroupParser + { + <%-}else if (element.isSimpleContent()){-%> + +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + class <%=element.name.toClassName()%>XmlParser: public XmlSimpleContentParser + { + <%-}-%> + + <%- if (element.isComplexType() || element.isSimpleContent()){-%> + protected: + std::map> GetAttributeNameToAttributeParserMap() override; + <%-}-%> + <%-if (element.isSimpleContent()){-%> + protected: + void SetContentProperty(const std::string content, std::shared_ptr object) override; + bool IsContentRequired() override; + <%-}else{-%> + private: + /** + * Parser for all subelements + */ + <%- if (element.isModelGroupAll()){-%> + class SubElementParser: public XmlAllParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + <%-}else if (element.isModelGroupChoice()){-%> + class SubElementParser: public XmlChoiceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + <%-}else if (element.isModelGroupSequence()){-%> + class SubElementParser: public XmlSequenceParser + { + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser + */ + SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + <%-}-%> + protected: + /* + * Creates a list of parser + */ + std::vector> CreateParserList() override; + }; + <%-}-%> + + <%-properties = element.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + /** + * A parser for subelement <%=property.name.toMemberName()%> + */ + class SubElement<%=property.name.toClassName()%>Parser: public IElementParser + { + private: + std::shared_ptr<<%=property.type.name.toClassName()%>XmlParser> _<%=property.type.name.toMemberName()%>XmlParser; + + public: + /** + * Constructor + */ + SubElement<%=property.name.toClassName()%>Parser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + + void Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) override; + + int GetMinOccur() override; + + int GetMaxOccur() override; + + bool DoesMatch(std::string& elementName) override; + + std::vector GetExpectedTagNames() override; + }; + +<%-}-%> + + public: + /** + * Constructor + * @param messageLogger to log messages during parsing + * @param filename to locate the messages in a file + * @param parserOptions options for the parser */ + <%=element.name.toClassName()%>XmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions); + }; + +<%-}-%> + } +} \ No newline at end of file diff --git a/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClassSource.tpl b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClassSource.tpl new file mode 100644 index 00000000..c8bff4bb --- /dev/null +++ b/generator/de.rac.openscenario.generator/src/main/resources/templates/cpp/v1_3/XmlParserClassSource.tpl @@ -0,0 +1,275 @@ +<%- +/* + * Copyright 2020 RA Consulting + * + * RA Consulting GmbH licenses this file under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +-%> +<%=JavaLicenseHelper.getApache2License()%> + +#include "XmlParsers<%=fileSuffix%>.h" +#include "NamedReferenceProxy.h" +#include "FileContentMessage.h" +#include "Position.h" +#include "Textmarker.h" +#include "ErrorLevel.h" +#include "WrappedListParser.h" +#include "CatalogReferenceParserContext<%=fileSuffix%>.h" + +namespace NET_ASAM_OPENSCENARIO +{ + namespace <%=versionNamespace%> + { + + <%- element.each{ element->-%> +<%= helper.makeClassJavaDoc(element, oscVersion, " ")%> + <%-if (element.isSimpleContent()){-%> + bool <%=element.name.toClassName()%>XmlParser::IsContentRequired() + { + return false; + } + <%-}else{-%> + <%- if (element.isModelGroupAll()){-%> + <%=element.name.toClassName()%>XmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlAllParser(messageLogger, filename, parserOptions) {} + + <%-}else if (element.isModelGroupChoice()){-%> + <%=element.name.toClassName()%>XmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlChoiceParser(messageLogger, filename, parserOptions) {} + + <%-}else if (element.isModelGroupSequence()){-%> + <%=element.name.toClassName()%>XmlParser::SubElementParser::SubElementParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): XmlSequenceParser(messageLogger, filename, parserOptions) {} + <%-}-%> + <%-}-%> + + <%- if (element.isComplexType() || element.isSimpleContent()){-%> + std::map> <%=element.name.toClassName()%>XmlParser::GetAttributeNameToAttributeParserMap() + { + std::map> result; + + <%-List properties = element.getXmlAttributeProperties();-%> + <%-properties.each{ property -> -%> + class Attribute<%=property.name.toClassName()%>: public IAttributeParser, public XmlParserBase + { + public: + Attribute<%=property.name.toClassName()%>(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions):XmlParserBase(messageLogger, filename, parserOptions) {} + + void Parse(Position& startPosition, Position& endPosition, Position& startValuePosition, std::string& attributeName, std::string& attributeValue, std::shared_ptr object) override + { + Textmarker startMarker(startPosition.GetLine(), startPosition.GetColumn(), _filename); + Textmarker endMarker(endPosition.GetLine(), endPosition.GetColumn(), _filename); + Textmarker startValueMarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), _filename); + auto typedObject = std::static_pointer_cast<<%=element.name.toClassName()%>Impl>(object); + <%-if (property.isParameterizableProperty()){-%> + if (IsParametrized(attributeValue)) + { + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, attributeValue, startValueMarker); + } + <%-if(helper.isExpressionAllowed(property.type, element.name.toClassName(), property.name.toMemberName())){-%> + else if (IsExpression(attributeValue)) + { + // Expressions allowed for datatype <%=property.type.name%> + typedObject->SetAttributeParameter(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, attributeValue, startValueMarker); + } + <%-}-%> + else + { + + // Parse value + <%-if (property.isProxy()){-%> + // Proxy + auto proxy = std::make_shared>>(attributeValue); + proxy->SetParent(typedObject); + typedObject->Set<%=property.name.toClassName()%>(proxy); + <%-} else if (property.type.isPrimitiveType()) {-%> + // Simple type + typedObject->Set<%=property.name.toClassName()%>(Parse<%=property.type.name.toClassName()%>(attributeValue, startMarker)); + <%-} else {-%> + // Enumeration Type + const auto kResult = <%=property.type.name.toClassName()%>::GetFromLiteral(attributeValue); + if (kResult != <%=property.type.name.toClassName()%>::UNKNOWN) + { + typedObject->Set<%=property.name.toClassName()%>(attributeValue); + } + else + { + auto msg = FileContentMessage("Value '" + attributeValue + "' is not allowed.", ERROR, startMarker); + _messageLogger.LogMessage(msg); + } + if (<%=property.type.name.toClassName()%>::IsDeprecated(kResult) && !_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + auto msg = FileContentMessage("Enumeration literal '" + attributeValue + "' is deprecated since standard version '" + <%=property.type.name.toClassName()%>::GetDeprecatedVersion(kResult) +"'. " + <%=property.type.name.toClassName()%>::GetDeprecatedComment(kResult) + "'.", WARNING, Textmarker(startValuePosition.GetLine(), startValuePosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + <%-}-%> + } + typedObject->PutPropertyStartMarker(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, std::make_shared(startMarker)); + typedObject->PutPropertyEndMarker(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, std::make_shared(endMarker)); + + <%-} else {-%> + // This is a special case for ParameterDeclaration.name or ParamterAssignment.parameterRef + <%-if (property.isProxy()){-%> + // Proxy + auto proxy = std::make_shared>>(StripDollarSign(attributeValue)); + proxy->SetParent(typedObject); + typedObject->Set<%=property.name.toClassName()%>(proxy); + <%-} else if (property.type.isPrimitiveType()) {-%> + // Simple type + typedObject->Set<%=property.name.toClassName()%>(Parse<%=property.type.name.toClassName()%>(StripDollarSign(attributeValue), startMarker)); + <%-}-%> + <%-}-%> + + <%-if (property.isDeprecated()){-%> + if (!_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + <%-String version = property.getDeprecatedVersion();-%> + <%- version = version? version.replaceAll("\"", "\\\\\""):"n/a";-%> + <%-String comment = property.getDeprecatedComment();-%> + <%- comment = comment? comment.replaceAll("\"", "\\\\\""):"n/a";-%> + auto msg = FileContentMessage("Attribute '" + attributeName + "' is deprecated since standard version '<%=version%>'. Comment: '<%=comment%>'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), this->_filename)); + this->_messageLogger.LogMessage(msg); + } + <%-}-%> + } + + int GetMinOccur() override + { + return <%=property.lower%>; + } + }; + result.emplace(std::make_pair(OSC_CONSTANTS::ATTRIBUTE__<%=property.name.toUpperNameFromMemberName()%>, std::make_shared>(_messageLogger, _filename, _parserOptions))); + <%-}-%> + return result; + } + <%-}-%> + <%-if (element.isSimpleContent()){-%> + void <%=element.name.toClassName()%>XmlParser::SetContentProperty(const std::string content, std::shared_ptr object) + { + auto typedObject = std::static_pointer_cast<<%=element.name.toClassName()%>Impl>(object); + typedObject->Set<%=element.getContentPropertyName().toClassName()%>(content); + } + <%-}else{-%> + + std::vector> <%=element.name.toClassName()%>XmlParser::SubElementParser::CreateParserList() + { + std::vector> result; + <%-properties = element.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + <%- if (property.isWrappedList()){-%> + result.push_back(std::make_shared(_messageLogger, _filename, std::make_sharedParser>(_messageLogger, _filename, _parserOptions), OSC_CONSTANTS::ELEMENT__<%=property.name.toClassName().toUpperNameFromMemberName()%>, _parserOptions) ); + <%-} else { -%> + result.push_back(std::make_sharedParser>(_messageLogger, _filename, _parserOptions)); + <%-}-%> + <%-}-%> + return result; + } + + <%-}-%> + <%-properties = element.getXmlElementProperties();-%> + <%-properties.each{ property -> -%> + <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::SubElement<%=property.name.toClassName()%>Parser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions) + { + _<%=property.type.name.toMemberName()%>XmlParser = std::make_shared<<%=property.type.name.toClassName()%>XmlParser>(messageLogger, filename, parserOptions); + } + + void <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::Parse(std::shared_ptr& indexedElement, std::shared_ptr& parserContext, std::shared_ptr object) + { + auto <%=property.name.toMemberName()%> = std::make_shared<<%=property.type.name.toClassName()%>Impl>(); + auto typedObject = std::static_pointer_cast<<%=element.name.toClassName()%>Impl>(object); + // Setting the parent + <%=property.name.toMemberName()%>->SetParent(object); + _<%=property.type.name.toMemberName()%>XmlParser->ParseElement(indexedElement, parserContext, <%=property.name.toMemberName()%>); + <%-if (property.isList()){-%> + auto <%=property.name.toMemberName()%>List = typedObject->GetWriter<%=property.name.toClassName()%>(); + <%=property.name.toMemberName()%>List.push_back(<%=property.name.toMemberName()%>); + typedObject->Set<%=property.name.toClassName()%>(<%=property.name.toMemberName()%>List); + <%-} else {%> + typedObject->Set<%=property.name.toClassName()%>(<%=property.name.toMemberName()%>); + <%-}-%> + <%- if (property.type.name.toClassName() == "CatalogReference"){-%> + std::dynamic_pointer_cast(parserContext)->AddCatalogReference(std::dynamic_pointer_cast>(<%=property.name.toMemberName()%>)); + <%-}-%> + + + <%-if (property.isDeprecated()){-%> + if (!_<%=property.type.name.toMemberName()%>XmlParser->_parserOptions.IsOptionSetSupressDeprecationWarnings()) + { + // This element is deprecated + std::string name = indexedElement->GetElement()->Name(); + <%-String version = property.getDeprecatedVersion();-%> + <%-version = version? version.replaceAll("\"", "\\\\\""):"n/a";-%> + <%-String comment = property.getDeprecatedComment();-%> + <%- comment = comment? comment.replaceAll("\"", "\\\\\""):"n/a";-%> + Position startPosition = indexedElement->GetStartElementLocation(); + auto msg = FileContentMessage("Element '" + name + "' is deprecated since standard version '<%=version%>'. Comment: '<%=comment%>'.", WARNING, Textmarker(startPosition.GetLine(), startPosition.GetColumn(), _<%=property.type.name.toMemberName()%>XmlParser->_filename)); + _<%=property.type.name.toMemberName()%>XmlParser->_messageLogger.LogMessage(msg); + } + <%-}-%> + } + + int <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::GetMinOccur() + { + return <%=property.lower%>; + } + + int <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::GetMaxOccur() + { + return <%=property.upper%>; + } + + bool <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::DoesMatch(std::string& elementName) + { + <%-if (property.isWrappedList()){-%> + return elementName == OSC_CONSTANTS::ELEMENT__<%=property.getXsdWrapperElementName().toMemberName().toUpperNameFromMemberName()%>; + <%-} else {-%> + return + <%-helper.splitEqualToCpp(property.getPossibleTagNames(),"elementName").each{ name ->-%> + <%=name%> + <%-}-%> + <%-}-%> + } + + std::vector <%=element.name.toClassName()%>XmlParser::SubElement<%=property.name.toClassName()%>Parser::GetExpectedTagNames() + { + <%-if (property.isWrappedList()){-%> + return {OSC_CONSTANTS::ELEMENT__<%=property.getXsdWrapperElementName().toMemberName().toUpperNameFromMemberName()%>}; + <%-} else {-%> + return { + <%-helper.splitStringListCpp(property.getPossibleTagNames()).each{ name ->-%> + <%=name%> + <%-}-%> + }; + <%-}-%> + } + <%-}-%> + + <%=element.name.toClassName()%>XmlParser::<%=element.name.toClassName()%>XmlParser(IParserMessageLogger& messageLogger, std::string& filename, ParserOptions& parserOptions): + <%- if (element.isComplexType()){-%> + XmlComplexTypeParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + <%-}else if (element.isSimpleContent()){-%> + XmlSimpleContentParser(messageLogger, filename, parserOptions) {} + <%-}else if (element.isGroup()){-%> + XmlGroupParser(messageLogger, filename, parserOptions) + { + _subElementParser = std::make_shared(messageLogger, filename, parserOptions); + } + <%-}-%> + + + <%-}-%> + + } +} \ No newline at end of file